Handle animated texture cycle lists not being the same size as keyframes (#91)

This commit is contained in:
Garrett Cox
2024-05-22 09:04:58 -05:00
parent 91b2641ad1
commit 420c5e77de
2 changed files with 5 additions and 4 deletions
@@ -100,12 +100,13 @@ void LUS::TextureAnimationFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReade
auto* e = new AnimatedMatTexCycleParams;
e->keyFrameLength = reader->ReadUInt16();
e->textureList = new void*[e->keyFrameLength];
uint32_t textureListSize = reader->ReadUInt32();
e->textureList = new void*[textureListSize];
e->textureIndexList = new uint8_t[e->keyFrameLength];
tAnim->textureCycleTextures.reserve(e->keyFrameLength);
tAnim->textureCycleTextures.reserve(textureListSize);
for (size_t i = 0; i < e->keyFrameLength; i++) {
for (size_t i = 0; i < textureListSize; i++) {
tAnim->textureCycleTextures.emplace_back("__OTR__" + reader->ReadString());
e->textureList[i] = (Gfx*)tAnim->textureCycleTextures[i].c_str();
}