Oh boy, this is a big one! There are a lot of additions, some changes and also some deprecations here. Also, the
performance of phoenix has improved quite a bit, especially interacting with VDFs and parsing worlds. We've also made
the first steps to making phoenix a shared library by adding support for `cmake --install` (thanks DaDummy!) which
will be expanded on in the future. Another cool thing is the new, centralized documentation page for _phoenix_ and
_ZenGin_ internals available at https://phoenix.lmichaelis.de. It's quite bare-bones still but some interesting stuff
has already been moved over.
Anyway, here's the list of changes:
Bugfixes
* [0c29d032, 6a64eee3] Fix issues related to stack guards and externals.
* [529137d5] Fix incorrect parsing of animation sample rotations.
* [1403f5e2] Fix undefined behavior in `trigger_mover`
* [2456b7fe] Report the end of archive objects at EOF as well.
Features
* [397bacfa, 702c8382, b7a650af, 6dd7fe4a, 57037739, 9568b8ad, db6616f4, 15396f07, 63692ad2, d855c166, 89327216] Add
support for parsing save-games. This feature allows phoenix to fully parse original save-games from their directory
structure. See `save_game.hh` for additional information.
* [08bcab36] Add `archive_reader::print_structure` to print the contents of an archived object as XML. This is mainly
useful for debugging, and it only works properly with ASCII and BIN_SAFE archives since BINARY archives don't contain
field names.
* [f789a925] Add a safer version of `archive_reader::read_raw_bytes` which takes the number of bytes to read as a
parameter. This works since we normally know how many bytes to parse anyway, otherwise BINARY archives would not work.
* [0d0f07db] `archive_reader` now has an API to easily check whether it's a save-game or not (`archive_reader::is_save_game`).
* [30793759, b8db4092] Add unstable APIs for retrieving and visiting archive entries and objects without a schema. See
`archive_reader::next` and `archive_reader::visit_objects` for more details.
* [a8526c34] VM external functions may now take raw instance pointers. This allows for bypassing potentially expensive
`std::shared_ptr` copies.
* [d0ad2da0] The default external implementation now handles instances by pushing a `null`-instance instead
Changes
* [ae776007] `script::find_symbol_by_name` and everywhere the script and VM require a symbol name parameter now take
a `std::string_view` instead of `std::string`.
* [0bfd3cfd] `symbol::get_string` now returns a `std::string_view` instead of a `std::string`
* [0d1b976b] Indexes into script symbol values are now represented by a `size_t` instead of a `uint8_t`
* [fd0023b7] **Internal Change**: phoenix' tests are now much easier to identify and feature additional checks for
VObs and different game versions
* [c0ace3cb] `bsp_tree` leaf polygons are now stored in a `std::unordered_set` instead of a `std::vector` for
performance reasons. This change improves world parse times by about 6%.
* [39319e92] If the signature of a VDF files being parsed is not recognized, phoenix now throws a `vdfs_signature_error`
Deprecations
* [32770f8d] `way_net::waypoint(std::string const&)`: This is a broken and slow API which should not be used.
* [f789a925] `archive_reader::read_raw_bytes()`: This API is unsafe and should no longer be used.
* [1df2b5e0] `model_script::parse_binary(...)`: Use `model_script::parse(...)` instead, it now supports both binary
and text-based scripts.
* [30de6a4e] `camera_lock_mode` and `vob::camera_alignment`: Old and incorrect names for `sprite_alignment` and
`vob::sprite_camera_facing_mode` respectively.
* [604b61bd] `vdf_entry* vdf_entry::find_child(std::string_view) &` and `vdf_entry* vdf_file::find_child(std::string_view) &`:
Mutating VDF entries is broken, thus these APIs should not be used. Use the `const` versions instead.
Performance
* [ebb48be2] `messages::block_by_name` now makes use of a sorted vector instead of a map lookup
* [604b61bd, 1957cbb8] VDF entry lookups are now up to 90 times faster due to usage of `std::set` to contain the entries.
* [ee00a037] The VM now uses a flat array as a stack instead of an actual `std::stack`. This eliminates unnecessary
heap allocations during runtime and thus improves speed.
* [f8c69354] Improve performance of `buffer` in general by about 20%
* [5bf91b45] Improve `archive_reader::read_object_begin` performance by about 7%
Misc
* [d2b86498, 21dbecd6, bdc8bb39, b962249a] phoenix is now also compiled with `-Wpedantic` and `-Wshadow`
* [2556143e] Add support for using CMake install (thanks, DaDummy!)
* [de512dad] Clang 14 is now tested in CI and fully supported
* [cc00c0ea] `fmtlib` is no longer a dependency of phoenix
* [16328f8a, 44a59c1e, a61ab85e, 18464552, 8196b897, 3d79c512 - 55de3c63] Add centralized documentation site for both
the phoenix library and ZenGin internals. It can be found at https://phoenix.lmichaelis.de.
---