471 Commits
Author SHA1 Message Date
Gleb MazovetskiyandClaude Sonnet 5 92927ca913 Migrate ClassAttributes, player HP/mana, item HP/mana bonuses, and monster HP to Fixed10_6/Fixed26_6
Replaces ParseFixed6/parseFixed6/readFixed6/readDecimal's raw-int
plumbing with the new FixedPoint type, then propagates strongly-typed
fixed-point fields through everywhere that consumed them: player
_pHitPoints/_pMana (and their base/max variants), ClassAttributes'
percentage/multiplier fields, Item::_iPLHP/_iPLMana, and
Monster::hitPoints/maxHitPoints. Eliminates manual <<6/>>6 bit-shifting
at nearly every call site in favor of fromInt/fromRaw/whole() and the
new fixed-point arithmetic operators, while preserving raw() only at
genuine serialization/network wire-format boundaries.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-10-11 21:55:08 +01:00
Gleb MazovetskiyandClaude Opus 5.5 b569d8acfd Don't repeat held actions that need walking while nothing affecting the path has changed
While a mouse button or controller action is held, the last action is
re-sent every game tick. This affects walking, melee attacks on targets
out of reach and operating objects the player isn't next to. If no path
to the target exists, each repeat runs two or three worst-case path
searches for the same result, which noticeably reduces FPS.

Add WalkabilityGeneration, bumped whenever tile solidity, objects or
the tiles occupied by monsters and players change. RepeatPlayerAction
remembers the last request that needed walking and skips an identical
one while the start tile, destination, generation and player life
states are unchanged. A request that finds a path moves the player, so
this only skips requests that failed or are still pending.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-11 18:18:29 +01:00
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 63e85d9b1b Replace tl::expected with std::expected
Now that the project targets C++23, use the standard library's
std::expected instead of the vendored tl::expected polyfill:

- tl::expected -> std::expected, tl::unexpected/tl::make_unexpected -> std::unexpected
- .map()/.map_error() -> .transform()/.transform_error()
- #include <expected.hpp> -> #include <expected>, grouped with std headers
- Remove 3rdParty/tl/expected.hpp (the tl target remains for function_ref.hpp)

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
Eric Robinson 5937734b85 Move *dat files to tables dir 2026-01-05 20:14:23 +01:00
Eric Robinson e6032a69a8 Split control.cpp (#8347) 2025-12-13 08:32:02 +00:00
LP 16b96e2c31 Fix broken catacombs wall tile (#8296)
* Fix broken catacombs wall tile

When tile 15 is followed by tile 1 below, change tile 1 to tile 8
(left corner) to fix a visual glitch in the catacombs.

* Silence fmt catch warnings and guard SaveHelper copy
2025-11-30 11:51:25 +01:00
obligaron 2c4e69c5c9 Fix MSVC warnings 2025-11-16 15:53:37 +01:00
Gleb Mazovetskiy 1bbe8bfe08 SDL3: Even more migration 2025-10-09 01:28:37 +01:00
Gleb Mazovetskiy 842b23803f SDL3: Use endianness swap helpers throughout 2025-10-09 01:28:37 +01:00
Gleb Mazovetskiy 3bcc869d85 Replace fmt with utils/str_cat in a few places
`fmt::format_to` is overkill for our simple formatting needs.
2025-09-29 08:36:34 +01:00
Andrettin 7d1aebd91b Added support for mapping IDs for item types 2025-08-21 03:03:19 +02:00
Andrettin e2e8446be1 Added Lua Bindings for Adding Unique Items 2025-08-18 23:11:46 +02:00
Andrettin be956f0608 Added Lua Bindings for Adding New Monster Types 2025-08-16 19:57:22 +02:00
Anders Jenbo 1c76897f2c Apply simple const rules using clang-tidy 2025-08-16 01:21:36 +02:00
Anders Jenbo 6a4c5e42ec Clean up const and shadow variables 2025-08-15 04:42:15 +02:00
Andrettin cfb52ee239 Added support for mods to add unique monsters without replacing any data (#8092) 2025-08-10 23:03:27 +02:00
Anders Jenbo 7b2de562c2 Extract more Hellfire into data 2025-07-21 00:42:33 +02:00
Eric Robinson e538b457bf Refactor Missile direction/frame group handling 2025-05-09 18:15:48 +02:00
Anders JenboandGleb Mazovetskiy 3b18dd35d9 Move some Hellfire differences to data files (#7943)
Co-authored-by: Gleb Mazovetskiy <[email protected]>
2025-04-25 22:56:59 +02:00
staphen 887f68e2a7 Validate stash size to avoid in-game corruption 2025-04-19 06:03:20 +02:00
Yggdrasill 176819a072 Make RecreateItem() take whole dwBuff flag as argument (#7870) 2025-03-21 15:16:39 +00:00
staphen 234606ad9d Validate player/item names coming from save file 2025-03-02 18:50:20 +01:00
staphen c798253587 Use constexpr for length of item names 2025-03-02 18:50:20 +01:00
Gleb Mazovetskiy 3e6b501d82 Fix pathfinding and increase player path limit
The previous implementation didn't behave quite like A-* is supposed to.

After trying to figure out what's causing it and giving up,
I've reimplemented it in a straightforward manner.
Now it seems to work a lot better.

Also increases maximum player path length to 100 steps.
We still only store the first 25 steps in the save file for vanilla
compatibility.
2025-01-26 17:38:05 +01:00
Gleb Mazovetskiy d7647d6c63 More dependency untangling
1. Moves more assets-related stuff from `init` to `engine/assets`.
2. Removes `SDL_audiolib` dependency from `soundsample.h`.
3. Cleans up some unused/missing includes.
2025-01-09 18:19:44 +00:00
Gleb Mazovetskiy c31836eab8 Split up engine.{h,cpp}
Untangles dependencies by splitting up `engine.{h,cpp}` into 3 files:

1. `primitive_render`
2. `ticks` -- only contains `GetAnimationFrame` for now.
3. `GetWidth2` renamed to `CalculateSpriteTileCenterX` and moved to `levels/dun_tile.hpp`.
2025-01-09 08:51:55 +00:00
Gleb Mazovetskiy dd76f17e4b Rename endian.hpp to endian_read.hpp
Following #7620, which split the write functions into a separate header.
2025-01-08 17:38:36 +09: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
staphen 6215de6e76 Compute monster toHit on the fly 2024-11-28 21:00:05 +01:00
Eric Robinson cfac786daf Make invalid items unusable (#7506) 2024-11-15 04:59:40 +01:00
Gleb Mazovetskiy 7b0558146e Async load: Handle errors 2024-11-10 13:49:01 +01:00
Gleb Mazovetskiy f15fbcf61a Async loading
Does the loading on a separate thread, so we're
now loading while fading in and while updating
the progress bar.
2024-11-10 13:49:01 +01:00
Eric Robinson 9f197f5ebc Rename Missile::_mirange to Missile::duration (#7214) 2024-09-23 10:56:16 +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
Stephen C. Wills cfe9a8ccdd Introduce xoshiro RNG to generate dungeon seeds (#7030) 2024-09-17 23:34:44 +02:00
Anders Jenbo e949f41d83 Clean up selection type 2024-09-15 09:35:25 -04:00
qndel 24f108f193 fix many typos (#7322) 2024-08-09 21:13:42 +02:00
Gleb Mazovetskiy e9c29fa806 Switch to ankerl::unordered_dense 2024-08-05 01:17:13 +01:00
Eric Robinson 557fd2a4a3 Fix illegal spell levels (#7112) 2024-05-10 13:53:42 +02:00
staphen af07b71127 Fix crash loading game with Search missile 2024-04-30 21:47:06 +02:00
staphen eb5e32aee5 Fix level conversion when migrating saves between Diablo and Hellfire 2024-04-23 08:29:22 +02:00
matheusgomes28 7848ab731e Splitting CheckInvPaste() into smaller functions (#6984) 2024-04-20 11:30:51 +02:00
staphen ba02a739da Call the functions to save/load level seeds in the SP save files 2024-03-09 19:53:21 +01:00
staphen 3c5b298391 Capture the level seed and use it to skip failed dungeon layouts 2024-03-06 05:43:34 +01:00
staphen 9e682afe13 Rename glSeedTbl 2024-03-06 05:43:34 +01:00
Gleb Mazovetskiy 25c1c5b372 Fix a few -Wsign-compare warnings 2024-02-04 11:14:14 +00:00
staphen c4792be763 Remove invalid items after loading heroitem data 2023-11-19 23:48:21 +01:00