Closed ScanMountGoat closed 2 years ago
The range of bits used for float compression seems to be 0 to 24 bits. An initial implementation could just hardcode the bit count to 24 when min and max are not equal to reduce the risk of exporting an in game animation with worse quality than the original. Min and max are simply the minimum and maximum for a particular value (ex: scale.x) taken over all frames for a particular track.
This should compress and rebuild the necessary buffers and generate any needed flags. The easiest types to start with are uncompressed (direct, const, etc) and compressed boolans (1 bit per bool). It should be possible to clean up the writing code considerably using SsbhWrite and potentially a bool to bit converter like bitvec. Compressing single floats is easier to write and test than vector or transform compression.