So we had a couple copies of a Platform enum, so now there's a public
one in the common module. It wasn't possible to specify what platform
the GameData is, so now it's part of initialization. While I'm at it,
remove the stupid reload_repositories() requirement and make that a
private part of the API.
We can simplify some of the repository code since there's now two
separate functions for base/expansion repositories. Added tests to make
sure reading doesn't regress like it did before.
In Hotspot it was revealed that a huge chunk of performance is lost due
to repeated IndexFile::from_existing calls, which may be on the same
index file. Now GameData transparently keeps a cache of these in memory
which speeds up the slowest link here.
Currently, we not handle repairing version files well, so I
sought to seek a solution to the problem. This is one of part of the
puzzle, by implementing a simple "game repair". This is not
IndexedZiPatch support, but simply checking if we can restore version
files if possible, or otherwise wipe the directory.
* Move PlatformId to common module.
* Platform id is no longer hardcoded to win32.
* Parse apply options correctly.
* Parse target info better, use more native structures.
* All errors are now handled properly, and propagated up.
* Added a new Region enum.
* Added todo!() to all unhandled patching branches.
* Paths are now built using PathBuf instead of format!().
* process_patch function is no longer accessible, now you have to use
the function found in GameData and BootData.