We had a few odd dependencies that caused nothing but pain in dependent projects
like libphysis. One of these was libunshield (a C library) that our game_install
feature used, but to be honest this was the wrong library to put this code. It
was really only ever used by Astra, and should live there instead - there's no
reason to have it shared between applications (and it's small enough to be
copied if *you* need it.) Also that also killed the system-deps dependency which
had a significant impact on our build time.
Another dependency was replaced: libz-sys. This is replaced by the pure Rust
libz-rs (through libz-rs-sys) which should simplify deploying physis without
having to worry about manually linking libz or other nonsense. Some leftover
copied code from flate2 can also be removed.
I also removed the visual_data feature as Astra ended up using it anyway, and
the distinction doesn't make much sense now. It was previously to gate some
dependencies needed for visual data extraction, but the bitflags and half crates
are small. I can look into splitting the crate up into more features if needed
later.
A dependency that was erroneously included in the refactoring was quote, which
has been removed. Also ran cargo fmt, clippy too.
Now it reads much more of the index file format, and tries to handle
index1/index2 differences more opaquely. I'm not yet happy with the API, it
needs a bit more work.
After a frustrating fight match with .NET, this is useful to see why it
failed to launch and whatnot. It only prints out when the process fails
though, to prevent spam.
These are giant dependencies that for some reason pull in winapi(???)
and we actually don't need all of their features.
Criterion can be replaced with brunch, a minimalist alternative.
walkdir is replaced with a single function.
system-dep can be replaced with a single line. Eventually I would like
to make it a little bit more than one line, but that's all we need for
now.
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.
Before this change, if you wanted to include physis you had to include
a bunch of dependencies you didn't need. For example, a launcher would
have to pull in texpresso which is completely useless. By default,
the features from before (excluding game_install) are included.
Also this creates a game_install feature for eventual Windows builds,
where unshield is not supported.
Currently only the first two game patches are checked, eventually want
to check boot patching as well. Hopefully this should weed out the
remaining patching issues I encounter.