* Use appropriate types for size constants in control.cpp
* Declare constexpr value for iterating over the cells in a stash grid
* Use appropriate type for UIRectangle dimensions
1. Do not modify the map after loading. Instead, return string views
(guaranteed to be null-terminated) from look up functions and return
the key directly if not found.
2. Use an `unorded_map` instead of `map` where available (C++20).
Saves a bit of RAM (~50 KiB) and improves lookup performance.
1. Adds a `libdevilution_so` target when tests are enabled.
2. Each test file is now a separate binary target linked against `libdevilutionx_so` (can now run tests in parallel).
3. Tests are now defined in a separate `test/CMakeLists.txt` file.
4. Building the tests is now controlled by the standard `BUILD_TESTING` option (defined by CTest).
5. Tests are now built by default.
6. On CI, test errors are now reported.
Also:
* `.clang-format`: Enable SortIncludes in tests
* `path_test.cpp`: Fix -Wsign-compare
The code previously assumed that there is an ASCII separator after each
resistance type.
Different languages may use something else entirely. Relaxes the
assumption to any single code point to avoid producing malformed
UTF-8.
* Clamp hpPer as a sanity check
* Refactor update mana routines in control.cpp to use PlayerStruct::UpdateManaPercentage
* Remove unnecessary calls to UpdateHP/ManaPercentage
* Unify logic that draws the flasks into a single internal function
* Fix style violations
* Remove unnecessary save/loads of hp/manaPer
The way this variable is used expects a value in this range and it gets clamped again anyway, but this makes the code more similar to the manaPer logic for future refactoring
Identical logic in use, the checks to see if the values are negative can be accomplished using clamp and the same divide by zero guard. I'll combine the two attributes in a near future commit.
control_update_life_mana is called during the game loop before any of the drawing functions so hpPer/manaPer are calculated based on the latest current/max of their respective attributes every frame.
There's no need to do the calculation again in the draw routines. (There's also no need to calculate this every frame but that's going to take a bit to untangle.)
This mostly change player to be by reference instead of by index.
But additionally it does stript checks for gold in the belt, move some
value types to the initialization and short circute a few functiongs.
This should gradually replace all the direct rendering of game texts
throughout the code. The interface is made to closly mirror that of the
art fonts as that is what will eventually be used for rendering Unicode
fonts both in the menus and ingame.
fixup! ✨ Generic game text render function