Fix cycle animated textures (#57)

This commit is contained in:
Garrett Cox
2024-05-22 09:04:58 -05:00
parent b84550e1df
commit 5133d29c01
4 changed files with 8 additions and 4 deletions
+1 -1
Submodule ZAPDTR updated: d77bf8826e...aaf3714f23
@@ -36,7 +36,7 @@ void LUS::TextureAnimationFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReade
for (size_t i = 0; i < numEntries; i++) {
AnimatedMaterial anim;
anim.segment = reader->ReadInt8();
anim.type = reader->ReadInt8();
anim.type = reader->ReadInt16();
switch ((TextureAnimationParamsType)anim.type) {
case TextureAnimationParamsType::SingleScroll: {
@@ -103,8 +103,11 @@ void LUS::TextureAnimationFactoryV0::ParseFileBinary(std::shared_ptr<BinaryReade
e->textureList = new void*[e->keyFrameLength];
e->textureIndexList = new uint8_t[e->keyFrameLength];
tAnim->textureCycleTextures.reserve(e->keyFrameLength);
for (size_t i = 0; i < e->keyFrameLength; i++) {
e->textureList[i] = ResourceGetDataByName(reader->ReadString().c_str());
tAnim->textureCycleTextures.emplace_back("__OTR__" + reader->ReadString());
e->textureList[i] = (Gfx*)tAnim->textureCycleTextures[i].c_str();
}
for (size_t i = 0; i < e->keyFrameLength; i++) {
e->textureIndexList[i] = reader->ReadUByte();
+1
View File
@@ -100,5 +100,6 @@ class TextureAnimation : public Resource<AnimatedMaterial> {
size_t GetPointerSize();
std::vector<AnimatedMaterial> anims;
std::vector<std::string> textureCycleTextures;
};
} // namespace LUS