summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouist103 <35883445+louist103@users.noreply.github.com>2023-10-31 23:09:23 -0400
committerlouist103 <35883445+louist103@users.noreply.github.com>2025-03-29 13:50:21 -0400
commit1fa1cf237f16e92fbd7cf15eefe343ce785da0c6 (patch)
tree725d44963ec3fbb5c73f5afa6f7dac8829c38dcf
parent009a9ed77fdbf9eb95f3e313503861b052103409 (diff)
tex anim exporter
-rw-r--r--OTRExporter/RoomExporter.cpp21
-rw-r--r--OTRExporter/TextureAnimationExporter.cpp6
2 files changed, 25 insertions, 2 deletions
diff --git a/OTRExporter/RoomExporter.cpp b/OTRExporter/RoomExporter.cpp
index 7d82c50..e57d9e9 100644
--- a/OTRExporter/RoomExporter.cpp
+++ b/OTRExporter/RoomExporter.cpp
@@ -35,6 +35,8 @@
#include "CutsceneExporter.h"
#include <ZRoom/Commands/SetTransitionActorList.h>
#include <ZRoom/Commands/SetCutsceneEntryList.h>
+#include <ZRoom/Commands/SetAnimatedMaterialList.h>
+#include "TextureAnimationExporter.h"
#include "PathExporter.h"
#undef FindResource
@@ -528,6 +530,25 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite
}
break;
}
+ case RoomCommand::SetAnimatedMaterialList: {
+ SetAnimatedMaterialList* list = (SetAnimatedMaterialList*)cmd;
+ std::string listName;
+ Globals::Instance->GetSegmentedPtrName(cmd->cmdArg2, cmd->parent, "AnimatedMaterial", listName,
+ res->parent->workerID);
+ listName = OTRExporter_DisplayList::GetPathToRes(room, listName);
+ writer->Write(listName);
+
+ MemoryStream* animatedMatStream = new MemoryStream();
+ BinaryWriter animatedMatWriter = BinaryWriter(animatedMatStream);
+ OTRExporter_TextureAnimation texAnim;
+
+ texAnim.Save(&list->textureAnimation, outPath, &animatedMatWriter);
+
+ AddFile(listName, animatedMatStream->ToVector());
+
+ break;
+ }
+
default:
printf("UNIMPLEMENTED COMMAND: 0x%02X\n", (int)cmd->cmdID);
diff --git a/OTRExporter/TextureAnimationExporter.cpp b/OTRExporter/TextureAnimationExporter.cpp
index 99bde28..b5841ae 100644
--- a/OTRExporter/TextureAnimationExporter.cpp
+++ b/OTRExporter/TextureAnimationExporter.cpp
@@ -22,7 +22,6 @@ void OTRExporter_TextureAnimation::Save(ZResource* res, const fs::path& outPath,
case TextureAnimationParamsType::DualScroll: {
auto* scrollParams = (TextureScrollingParams*)params;
- writer->Write(scrollParams->count);
writer->Write(scrollParams->rows[0].xStep);
writer->Write(scrollParams->rows[0].yStep);
writer->Write(scrollParams->rows[0].width);
@@ -41,10 +40,13 @@ void OTRExporter_TextureAnimation::Save(ZResource* res, const fs::path& outPath,
case TextureAnimationParamsType::ColorChangeLagrange: {
auto* colorParams = (TextureColorChangingParams*)params;
writer->Write(colorParams->animLength);
- writer->Write((uint16_t)colorParams->primColorList.size());
+ writer->Write(colorParams->colorListCount);
+
+ writer->Write((uint32_t)colorParams->frameDataList.size());
for (const auto f : colorParams->frameDataList) {
writer->Write(f);
}
+ writer->Write((uint32_t)colorParams->primColorList.size());
for (const auto prim : colorParams->primColorList) {
writer->Write(prim.r);
writer->Write(prim.g);