Ensures the contents can be easily copy-pasted into the terminal from
most editors on all systems.
Otherwise, on Linux, you get 2 newlines for each newline in the source
when copying from VS Code.
Fixes#566
The hero is unloaded before entering this screen from a game, hacking
the game to track the hero level would not work with single player
(planned to also have a select screen) so the only proper solution is to
load the info from the save game. Using gszHero allows us to stay synced
with the engine.
* mpqapi FStreamWrapper: Fix silly bugs
* mpqapi cleanup
1. Do not rely on stream positions for getting the initial file size.
2. Remove most `seek` calls that were unnecessary.
3. Replace magic numbers with constants.
4. A class to manage archive lifetime and all associated data.
* Revert "Revert "mpqapi: Log all fstream calls""
This reverts commit e08007670f.
* mpqapi: Fix saves on Amiga
Works around https://github.com/bebbo/libnix/issues/30
* mpqapi: Fix logging format specifiers
This fixes fstream logging on Amiga
* mpqapi: Do not ResizeFile unless it was modified
* Add tests for file_util
* mpqapi: Replace malloc/free with new[]/delete[]
* mpqapi: Keep track of size instead of using tellp
This reduces log noise and reliance on `tellp`.
* mpqapi: Refactor mpqapi_write_file_contents
* mpqapi: Ensure we don't seekp beyond EOF on Amiga
* mpqapi: Minor fixes
* mpqapi: Fix FSTREAM_CHECK on Windows
* mpqapi: Remove undefined methods from header
1. Can't use HWSURFACE, as the code doesn't lock it.
Double-buffering with HWSURFACE would be an alternative but the
current game rendering code doesn't play well with it due to how it
updates the UI
2. RG350 screen is RGB, not BGR (my microscope flipped the image),
16-bit is the correct color depth.