- sprite building would save a file with just the sprite file header
and then immediately open it again at the beginning of compilation
- sprite file generation is now entirely in memory until the final
output file is saved on success
- added validation of no file activity in the failed build test case;
failed builds will not generate a file or edit an existing one
* Merge all cmdsprite global state into single struct
* Move MakeEntries into a member function
* Use std::optional for sprite file open
* Move sprite_file_save to a member function
* Make sprite_file_close a member function and rename open
* Remove global variable
* Make Entries a vector
* Make Data a vector
* Use FileStream for Open
* Use FileStream for Save
* Renmae Image Import/Export functions and cleanup
* Extract out common item AddImage
* Simplify SpriteFile::AddImage
* Header and struct cleanup
* Make suggested changes
As not all objects load images in the same order the previous code could end up with sprite index's that were incorrect. There also was no reason to make the code object specific as we can just access the image table directly.
Previously when the arguments of a function wouldn't fit on a single line, clang-format would put each argument on its own line instead. By enabling the binpack parameter setting, it tried to fit as many on one line as possible instead.
Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
Clang-format sees the text behind `#pragma region` as code and formats it. Instead of stating the copyright and date there, it's now in the comment block right below it. The text "Copyright" is left in the `#pragma region` line, as clang-format sees it as a single identifier.
I took the opportunity to normalize the dates, and add the copyright notice to the source files where it was missing them (except for third-party and the generated resources.h file).
This aims to make future refactoring easier. The arguments are removed where possible, but kept and marked with C++17's [[maybe_unused]] where they could not be removed (e.g. when they are used as a callback, rather than called directly).
I've skipped the rides/<category>/* and peep/* source files, because the rides source files are mostly generated and have a ton of unused variables, and the peep source files are being refactored.
I've also skipped most of window/* source files, because most of the functions are used as callbacks and will be bulk-renamed at some point.