Add the ability to load IFP animations without compression#4664
Add the ability to load IFP animations without compression#4664FileEX wants to merge 8 commits intomultitheftauto:masterfrom
Conversation
qaisjp
left a comment
There was a problem hiding this comment.
I haven't review the code but
@MegadreamsBE tested this.
Could you go into more detail into what the actual tests were? E.g. sample resources that they tested against
This branch master...FileEX:mtasa-blue:megadreams/object-animations_with_clumps was used for testing, because currently MTA doesn’t include object animations or the ability to replace clump-type models (#4555 and #4052). Test resource: I personally don’t know cutscene animations very well, but MegaDreams is familiar with them, and the test resource comes from him. |
| } | ||
| } | ||
|
|
||
| void CClientIFP::ReadKr00FramesUncompressed(std::unique_ptr<CAnimBlendSequence>& pAnimationSequence, const std::int32_t& cFrames) |
There was a problem hiding this comment.
It seems like the ReadKr* methods are practically doing the same thing, couldn't an interface help cut down code-duplication here?
There was a problem hiding this comment.
That's true, it could be done better, but in my opinion, that's not the topic of this PR. This PR simply adds a new argument to the function, rather than refactoring the existing code.
Two-fold: I ran multiple cutscene IFPs, which rely on uncompressed animations with this new code through my Sphene project. No crashes nor issues were observed. I can vow for the stability of this change. |
Summary
This PR adds an optional uncompressedAnimations argument to the
engineLoadIFPfunction, allowing you to specify which animations should be loaded without compression.Motivation
Currently, all IFP animations are loaded as compressed by default, regardless of whether compression is necessary. While testing PR #4555, @MegadreamsBE discovered several issues when using cutscene animations, including broken facial bones (fixed in #4565) and offset problems. It was determined that the issue occurs because all animations are loaded as compressed by default, whereas GTA loads some cutscene animations in a special way as uncompressed (the uncompress section in .cut files).
Test plan
@MegadreamsBE tested this.
Thanks to @Merlin for helping with the crash investigation.
Checklist