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.
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.
Reduces the size of the `PathNodes` array from 28 KiB to just 8 KiB.
Also reduces the size of `pnode_tblptr` from `300 * sizeof(void *)` to
`300 * 2` bytes.
The pre-calculated crawl table is replaced with partially unrolled loops to handle the special cases covered by the table.
Arbitrary limit of 50 placed to allow using this function for searches where vanilla logic would check up to (±49, ±49).
Identified and removed an instance of Direction being used as an argument for a bool parameter
Removed a single-use temporary variable being cast from sprite frame to direction to size_t
Co-authored-by: Anders Jenbo <anders@jenbo.dk>
Fix alignment of WalkSettings array
In cases like path_get_h_cost this allows simplifying logic where Point provides functions for the intended behaviour in a much simpler to understand package.
This also makes it clearer which functions are const/don't modify the node and which potentially have side effects.
- Add file documentation to about 1/4 of the files in Source
- Copy over a lot of the documentation from the sanctuary/notes repo
- Standardise all the existing documentation
- Create a configuration for Doxygen
- Add more documentation (engine.cpp is now fully documented)
Finished refactoring spells.cpp, modifying other files only as needed.
Some functions are 99% binary exact now, like PlacePlayer, for example.
Added notes/TODOs for places with remaining discrepancies.