From 68893d67ed0c95e569145519c889da39c31ada19 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Tue, 27 Feb 2024 10:13:00 -0500 Subject: [PATCH] Implement/match LegoAnimPresenter::FUN_10069150 (#600) --- .../lego/legoomni/include/legoanimpresenter.h | 2 +- .../legoomni/include/legounksavedatawriter.h | 1 + .../src/common/legounksavedatawriter.cpp | 7 +++++ .../legoomni/src/video/legoanimpresenter.cpp | 28 ++++++++++++++++--- 4 files changed, 33 insertions(+), 5 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legoanimpresenter.h b/LEGO1/lego/legoomni/include/legoanimpresenter.h index ac585d53..0cf8f2bb 100644 --- a/LEGO1/lego/legoomni/include/legoanimpresenter.h +++ b/LEGO1/lego/legoomni/include/legoanimpresenter.h @@ -48,7 +48,7 @@ class LegoAnimPresenter : public MxVideoPresenter { protected: void Init(); void Destroy(MxBool p_fromDestructor); - LegoChar* FUN_10069150(const LegoChar*); + LegoChar* FUN_10069150(const LegoChar* p_und1); void FUN_100692b0(); void FUN_100695c0(); LegoChar* FUN_100697c0(const LegoChar* p_und1, const LegoChar* p_und2); diff --git a/LEGO1/lego/legoomni/include/legounksavedatawriter.h b/LEGO1/lego/legoomni/include/legounksavedatawriter.h index deea67b0..8013699c 100644 --- a/LEGO1/lego/legoomni/include/legounksavedatawriter.h +++ b/LEGO1/lego/legoomni/include/legounksavedatawriter.h @@ -60,6 +60,7 @@ class LegoUnkSaveDataWriter { static void InitSaveData(); static void SetCustomizeAnimFile(const char* p_value); + static MxBool FUN_10084c00(const LegoChar*); void FUN_100832a0(); void FUN_10083db0(LegoROI* p_roi); diff --git a/LEGO1/lego/legoomni/src/common/legounksavedatawriter.cpp b/LEGO1/lego/legoomni/src/common/legounksavedatawriter.cpp index 52c57f71..ad3f91c6 100644 --- a/LEGO1/lego/legoomni/src/common/legounksavedatawriter.cpp +++ b/LEGO1/lego/legoomni/src/common/legounksavedatawriter.cpp @@ -110,6 +110,13 @@ void LegoUnkSaveDataWriter::FUN_10083f10(LegoROI* p_roi) // TODO } +// STUB: LEGO1 0x10084c00 +MxBool LegoUnkSaveDataWriter::FUN_10084c00(const LegoChar*) +{ + // TODO + return FALSE; +} + // FUNCTION: LEGO1 0x100851a0 void LegoUnkSaveDataWriter::SetCustomizeAnimFile(const char* p_value) { diff --git a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp index 10cffd9c..3572137b 100644 --- a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp @@ -106,11 +106,31 @@ MxResult LegoAnimPresenter::CreateAnim(MxStreamChunk* p_chunk) return result; } -// STUB: LEGO1 0x10069150 -LegoChar* LegoAnimPresenter::FUN_10069150(const LegoChar*) +// FUNCTION: LEGO1 0x10069150 +LegoChar* LegoAnimPresenter::FUN_10069150(const LegoChar* p_und1) { - // TODO - return NULL; + LegoChar* str; + + if (LegoUnkSaveDataWriter::FUN_10084c00(p_und1 + 1)) { + str = new LegoChar[strlen(p_und1)]; + + if (str != NULL) { + strcpy(str, p_und1 + 1); + } + } + else { + LegoChar buffer[32]; + sprintf(buffer, "%d", m_action->GetUnknown24()); + str = new LegoChar[strlen(p_und1) + strlen(buffer) + strlen(GetActionObjectName()) + 1]; + + if (str != NULL) { + strcpy(str, p_und1); + strcat(str, buffer); + strcat(str, GetActionObjectName()); + } + } + + return str; } // FUNCTION: LEGO1 0x100692b0