716 Commits
Author SHA1 Message Date
Gleb MazovetskiyandClaude Sonnet 4.6 53b91fd7a2 Untangle more dependencies
Split several monolithic files to reduce transitive dependencies and
enable the dun_render_benchmark to link without bringing in all of
DevilutionX:

- Extract dungeon tile globals and loading functions from `gendung` into
  `dun_tile_data.{hpp,cpp}`
- Extract light table data and MakeLightTable from lighting into
  `engine/light_tables.{hpp,cpp}`
- Move cursor_id and SelectionRegion to cursor_defs.hpp
- Extract quest log rendering to `panels/quest_log.{hpp,cpp}`
- Extract drlg quest setpiece logic to `levels/drlg_quests.{hpp,cpp}`
- Extract quest data loading to `tables/questdat.{hpp,cpp}`
- Move `GameData` and `gbIsMultiplayer` into `game_mode.{hpp,cpp}`
- Add `parse_sfx_id.{hpp,cpp}`
- Update CMake libraries accordingly

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-08-23 06:08:15 +01:00
Gleb MazovetskiyandClaude Fable 5 ac2d7fc731 Replace libfmt with std::format
- `fmt::format` with literal format strings -> `std::format`.
- `fmt::format(fmt::runtime(...))` -> `FormatRuntime` in the new
  `utils/format.hpp`, a std::vformat wrapper that is also safe under the
  P2905 lvalue requirement of `std::make_format_args`.
- `fmt::dynamic_format_arg_store` (Lua logging) -> a small hand-rolled
  per-field formatter over `std::variant`, returning `std::expected`.
- `fmt::format_int` -> `std::to_chars`.
- `fmt::join` -> manual joins at the two call sites.
- SDL_audiolib: new patch that rewrites aulib_log.h to use std::format
  and drops the fmt dependency from its CMakeLists.
- The `-static-libstdc++` guard now keys off
  `DEVILUTIONX_STATIC_SDL_AUDIOLIB` instead of `DEVILUTIONX_STATIC_LIBFMT`.
- libfmt removed from CMake, vcpkg, Brewfile, CI workflows,
  Dockerfiles, packaging scripts, UWP project, and docs.
- macOS bumped to 13.3+, iOS to 16.3+ (required for `<format>`)
- Amiga m68k: provide `__cmpdf2`, which is missing from the hard-float
  libgcc multilib but referenced via libstdc++'s long double paths.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-22 00:00:04 +02:00
Anders Jenbo 005e7dcc23 chore: clang-tidy cleanup part 1 2026-04-03 22:57:48 +02:00
Scott RichmondandYuri Pourre 0ecc3edaed [QOL] The buy and sell functionality of NPC stores is now visually driven to align with the stash and Diablo 2 style of trading (#8434)
- Add repair buttons (including “Repair All”) with proper alignment, tooltips, and cursor hit areas
- Improve controller support:
- Fix grid snapping and cursor positioning across panels
- Allow pressing/releasing UI buttons
- Fix item selling and movement between panels (inventory, belt, store)
- Prevent invalid interactions:
- Disable tab/repair navigation while holding items
- Hide unavailable options for non-Smith vendors
- Fix UI issues:
- Item misalignment and snapping
- Floating gold cost display
- Level-up button overlapping store panel
- Fix vendor-specific issues:
- Correct tooltip for non-Smith vendors
- Clean up Adria dialog options
- Fix stability issues:
- Resolve segfault when selling items
- Refactor and cleanup:
- Unify store sell logic
- Remove unused and stale code
- Improve IsPlayerInStore() logic
- General bug fixes and UI interaction improvements
---------

Co-authored-by: Yuri Pourre <[email protected]>
2026-03-29 15:23:43 +02:00
Eric Robinson 7e8173e6ff Add Player hasNoLife helper (#8302) 2025-12-03 05:12:42 +00:00
Gleb Mazovetskiy 88f706e0d1 SDL3: Add some backports / compat helpers 2025-10-10 00:49:44 +01:00
Gleb Mazovetskiy 1bbe8bfe08 SDL3: Even more migration 2025-10-09 01:28:37 +01:00
Andrettin d87c0dcf8a Player Class Flags (#8173) 2025-09-07 04:36:57 +02:00
Andrettin f6b4665e94 Make Player Class Data Data-Driven (#8167) 2025-09-05 11:30:01 +02:00
Anders Jenbo 1c76897f2c Apply simple const rules using clang-tidy 2025-08-16 01:21:36 +02:00
Eric Robinson e303a82b1c Floating Item Info Box (#8000) 2025-08-10 02:17:39 +02:00
Eric Robinson 3aaa414f07 Draw Hotkeys on Belt (#7911) 2025-04-12 18:02:03 +02:00
chasedjones88 b47d97f14c Rebase of #7876 - Shift item order when selling to keep consistent window order (#7886)
* Shift item order when selling instead of using last item to fill the slot

Player has items i1, i2, i3, picked up in that order.

Previous Behavior:
1. Sell window at vendor shows i1, i2, i3.
2. Player sells i1
3. i3 is last in list and replaces i1
4. Sell window now shows i3, i2.

New Behavior:
1. Sell window at vendor shows i1, i2, i3.
2. Player sells i1
3. i2/i3 are shifted in index position down to fill the gap left by previous index.
4. Sell window now shows i2, i3.

* Remove whitespace
2025-03-27 03:19:22 +01:00
Andrew James b72327b972 Play the sound of the item we're pasting, not what we picked up 2025-03-25 12:50:27 -05:00
Yggdrasill 176819a072 Make RecreateItem() take whole dwBuff flag as argument (#7870) 2025-03-21 15:16:39 +00:00
Eric Robinson 8eddf55c3f Stores - IsPlayerInStore() (#7843) 2025-03-15 21:18:28 +00:00
Eric Robinson 173c662723 Remove CalcPlrStaff() 2025-02-28 18:05:44 +01:00
Gleb Mazovetskiy ee16071761 Untangle pathfinding dependencies
1. Makes `path.cpp` concerned solely with the pathfinding algorithm.
2. Turns `path_test` into a standalone test.
2025-01-25 08:14:34 +00:00
Gleb Mazovetskiy 3bb1d685af Extract current input mode into its own library
Removes a transitive dependency on the entire plrctrl from options.
2025-01-22 23:14:45 +00:00
Gleb Mazovetskiy d94bc424df sgOptions -> GetOptions()
In C++, globals initialization order accross translation units is not
defined. Accessing a global via a function ensures that it is initialized.

This will be needed for #7638, which will statically initialize change
handlers after the Options object has been initialized.
2025-01-13 11:57:25 +00:00
Gleb Mazovetskiy a49b1f2d58 Extract Is{Any,None}Of out of engine.hpp
Untangles some of the dependencies
2025-01-08 09:54:56 +09:00
Andrew James 5758e561fd allow auto-equipping two-handed weapons with both hands occupied
specifically where the larger item is in the right hand, this would fail previously in certain circumstances.
2024-10-21 14:02:10 +02:00
Andrew James 1b32872db2 Shuffle items around when auto-equipping so less inv space is required 2024-10-21 14:02:10 +02:00
Andrew James a8ca96452a Only use holditem if we're actually picking the item to hand 2024-10-21 14:02:10 +02:00
Andrew James b19f2e80ce Move anonymous namespace functions to the top of the file 2024-10-21 14:02:10 +02:00
Andrew James c7abf2f778 Extract logic from CheckInvCut/AutoPlaceItemInInventory (#7494)
* Remove unnecessary namespace

* Extract FindSlotUnderCursor

* Split logic for finding a space in the inventory to dedicated functions
2024-10-21 10:54:24 +02:00
Andrew James 59471f0828 Remove special case when auto-placing 2x2 items 2024-09-27 17:28:38 +02:00
Eric Robinson e90855b3c4 Rename stores.cpp global variables (#7425) 2024-09-21 01:08:56 +02:00
Eric Robinson 6396af1ff5 Cleanup panel code (Part 2) (#7421) 2024-09-18 04:28:17 +02:00
Anders Jenbo e949f41d83 Clean up selection type 2024-09-15 09:35:25 -04:00
Andrew James 99e12f7663 dedupe code to pick up/auto-move items from body 2024-09-08 14:54:04 +02:00
Andrew James e9bb19b60f tidy up one-hand equip logic 2024-09-08 14:54:04 +02:00
Andrew James db02222cda remove temporary ii variable 2024-09-08 14:54:04 +02:00
Andrew James 6901d9e0fb don't trample over holditem unnecessarily 2024-09-08 14:54:04 +02:00
Andrew JamesandTully 5e0b48df2e Fix not being able to equip two-handed items in a certain case
Fix a bug that caused two-handed items not to able to be equipped
if there was an item in the right hand, but not in the left one
and also there wasn't enough space to place the right item TWO times.
This was unintended, obviously, the right item should only be checked for once.

Co-authored-by: Tully <[email protected]>
2024-09-08 00:42:19 +02:00
Gleb Mazovetskiy efa94307e0 Optimize lit blending with light level 0
We don't need to worry about the custom Hell light table here (#7166)
because this change only affects CLX sprites, not dungeon tiles.
2024-08-11 15:16:24 +01:00
Gleb Mazovetskiy 712f0bac0b Remove LightTableIndex global
Also removes the redundant `DrawPlayerHelper` function.
2024-08-11 15:16:24 +01:00
Gleb Mazovetskiy df98042a1b Optimize InvDrawSlotBack
0.4% of the timedemo profile -> 0.2%
2024-08-09 23:16:28 +01:00
matheusgomes28 7848ab731e Splitting CheckInvPaste() into smaller functions (#6984) 2024-04-20 11:30:51 +02:00
Eric Robinson 0d68aed1f7 Sort inventory (#7040) 2024-03-27 18:37:55 +01:00
KPhoenix 0f90d5baba Bugfix: Auto Refill Belt not working properly 2024-03-07 16:37:05 +01:00
Gleb Mazovetskiy dc59cdaee4 Extract objcurs widths into a file
Read from the widths file when using the original CEL.
When using CLX, use width in CLX.
2024-02-17 17:00:56 +00:00
obligaron 2da492d203 Change some functions to Player reference 2023-12-05 20:40:30 +01:00
obligaron fae6b3d817 Change Player::getId() and MyPlayerId to uint8_t 2023-12-05 19:05:08 +01:00
Gleb Mazovetskiy c5a5dc9f5c Fix a few MSVC warnings 2023-11-05 12:57:59 +00:00
Anders Jenbo bb2e189327 Convert _sfx_id in to class enum 2023-11-02 14:34:24 +01:00
Gleb Mazovetskiy e5881688f4 text_render: Replace optional args with struct
4 options args are a bit unwieldy, especially when you want
to pass only the first and the last one.

With a struct, there is no need to specify the default values
for the args in between.
2023-10-25 09:19:14 +01:00
Gleb Mazovetskiy 09ab58343c Migrate gold drop/withdrawal to text_input
With this, all text input is handled in a unified way.
2023-10-24 20:11:04 +01:00
ephphatha 24a20ce8e2 Extract uses of MyPlayer to prevent future crashes in tests/game init 2023-09-20 05:49:54 +02:00
Gleb Mazovetskiy af869ac732 Merge branch 'master' into dev-merged 2023-09-01 20:49:34 +01:00