diff --git a/LEGO1/lego/sources/anim/legoanim.cpp b/LEGO1/lego/sources/anim/legoanim.cpp index c721487a..d11efc4d 100644 --- a/LEGO1/lego/sources/anim/legoanim.cpp +++ b/LEGO1/lego/sources/anim/legoanim.cpp @@ -289,7 +289,7 @@ LegoAnimNodeData::LegoAnimNodeData() m_translationIndex = 0; m_rotationIndex = 0; m_scaleIndex = 0; - m_unk0x30 = 0; + m_morphIndex = 0; } // FUNCTION: LEGO1 0x1009fda0 @@ -605,11 +605,27 @@ inline void LegoAnimNodeData::GetScale( p_matrix.Scale(x, y, z); } -// STUB: LEGO1 0x100a0990 +// FUNCTION: LEGO1 0x100a0990 LegoBool LegoAnimNodeData::FUN_100a0990(LegoFloat p_time) { - // TODO - return TRUE; + LegoU32 i, n; + LegoU32 index = GetMorphIndex(); + LegoBool result; + + n = FindKeys(p_time, m_numMorphKeys, m_morphKeys, sizeof(*m_morphKeys), i, index); + SetMorphIndex(index); + + switch (n) { + case 0: + result = TRUE; + break; + case 1: + case 2: + result = m_morphKeys[i].GetUnknown0x08(); + break; + } + + return result; } // STUB: LEGO1 0x100a0a00 diff --git a/LEGO1/lego/sources/anim/legoanim.h b/LEGO1/lego/sources/anim/legoanim.h index ab0aedc7..960d7c90 100644 --- a/LEGO1/lego/sources/anim/legoanim.h +++ b/LEGO1/lego/sources/anim/legoanim.h @@ -90,9 +90,10 @@ class LegoMorphKey : public LegoAnimKey { public: LegoMorphKey(); LegoResult Read(LegoStorage* p_storage); + LegoBool GetUnknown0x08() { return m_unk0x08; } protected: - undefined m_unk0x08; // 0x08 + LegoBool m_unk0x08; // 0x08 }; // SIZE 0x0c @@ -121,10 +122,12 @@ public: LegoU32 GetTranslationIndex() { return m_translationIndex; } LegoU32 GetRotationIndex() { return m_rotationIndex; } LegoU32 GetScaleIndex() { return m_scaleIndex; } + LegoU32 GetMorphIndex() { return m_morphIndex; } void SetTranslationIndex(LegoU32 p_translationIndex) { m_translationIndex = p_translationIndex; } void SetRotationIndex(LegoU32 p_rotationIndex) { m_rotationIndex = p_rotationIndex; } void SetScaleIndex(LegoU32 p_scaleIndex) { m_scaleIndex = p_scaleIndex; } + void SetMorphIndex(LegoU32 p_morphIndex) { m_morphIndex = p_morphIndex; } LegoResult CreateLocalTransform(LegoTime p_time, Matrix4& p_matrix) { @@ -188,7 +191,7 @@ protected: LegoU32 m_translationIndex; // 0x24 LegoU32 m_rotationIndex; // 0x28 LegoU32 m_scaleIndex; // 0x2c - undefined4 m_unk0x30; // 0x30 + LegoU32 m_morphIndex; // 0x30 }; // SIZE 0x08