diff --git a/Source/Contents/Models/ModelTextureAnimation.cpp b/Source/Contents/Models/ModelTextureAnimation.cpp index e044a3c..746a41c 100644 --- a/Source/Contents/Models/ModelTextureAnimation.cpp +++ b/Source/Contents/Models/ModelTextureAnimation.cpp @@ -1,4 +1,5 @@ #include "Contents/Models/ModelNode.h" +#include "File/File.h" // OFFSET: 0x00540EA0 // FUNCTION: fn_01727 @@ -32,3 +33,79 @@ void SampleModelTexture(const ModelTextureChannels& channels, float frame, Model output.values[channel] = first + second; } } + +struct ModelKeyList1 : std::vector { + void Read(CFile& file); +}; + +// OFFSET: 0x00541160 +// FUNCTION: fn_01728 +void ModelKeyList1::Read(CFile& file) { + int count = 0; + file.Read(&count, sizeof(count)); + for (int i = 0; i < count; ++i) { + ModelRotationKey key{}; + file.Read(&key, sizeof(key)); + this->push_back(key); + } +} + +struct ModelKeyList2 : std::vector { + void Read(CFile& file); +}; + +// OFFSET: 0x005411E0 +// FUNCTION: fn_01729 +void ModelKeyList2::Read(CFile& file) { + int count = 0; + file.Read(&count, sizeof(count)); + for (int i = 0; i < count; ++i) { + ModelRotationKey key{}; + file.Read(&key, sizeof(key)); + this->push_back(key); + } +} + +struct ModelKeyList3 : std::vector { + void Read(CFile& file); +}; + +// OFFSET: 0x00541250 + +struct ModelKeyList4 : std::vector { + void Read(CFile& file); +}; + +// OFFSET: 0x00541350 +// FUNCTION: fn_01731 +void ModelKeyList4::Read(CFile& file) { + int count = 0; + file.Read(&count, sizeof(count)); + for (int i = 0; i < count; ++i) { + ModelRotationKey key{}; + file.Read(&key, sizeof(key)); + this->push_back(key); + } +} + +struct ModelTextureChannelMap : ModelTextureChannels { + void Read(CFile& file); +}; + +// OFFSET: 0x005413D0 +// FUNCTION: fn_01732 +void ModelTextureChannelMap::Read(CFile& file) { + int count = 0; + file.Read(&count, sizeof(count)); + for (int i = 0; i < count; ++i) { + int id = 0; + int keyCount = 0; + file.Read(&id, sizeof(id)); + file.Read(&keyCount, sizeof(keyCount)); + for (int k = 0; k < keyCount; ++k) { + ModelTextureKey key{}; + file.Read(&key, sizeof(key)); + (*this)[id].push_back(key); + } + } +}