From 60161c43b5b49f3676cae03bc030b153bc23c78f Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Mon, 26 Feb 2024 13:39:03 -0500 Subject: [PATCH] Implement/match LegoAnimPresenter::FUN_100698b0 (#598) * Implement/match LegoAnimPresenter::FUN_100698b0 * Use const_iterator --- .../lego/legoomni/include/legoanimpresenter.h | 2 +- LEGO1/lego/legoomni/include/legoroilist.h | 3 ++ .../legoomni/src/video/legoanimpresenter.cpp | 32 ++++++++++++++++--- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legoanimpresenter.h b/LEGO1/lego/legoomni/include/legoanimpresenter.h index 3e2f98f4..ac585d53 100644 --- a/LEGO1/lego/legoomni/include/legoanimpresenter.h +++ b/LEGO1/lego/legoomni/include/legoanimpresenter.h @@ -52,7 +52,7 @@ class LegoAnimPresenter : public MxVideoPresenter { void FUN_100692b0(); void FUN_100695c0(); LegoChar* FUN_100697c0(const LegoChar* p_und1, const LegoChar* p_und2); - LegoBool FUN_100698b0(CompoundObject&, const LegoChar*); + LegoBool FUN_100698b0(const CompoundObject& p_und1, const LegoChar* p_und2); LegoAnim* m_anim; // 0x64 undefined4 m_unk0x68; // 0x68 diff --git a/LEGO1/lego/legoomni/include/legoroilist.h b/LEGO1/lego/legoomni/include/legoroilist.h index fb2cb3f1..3e1239bb 100644 --- a/LEGO1/lego/legoomni/include/legoroilist.h +++ b/LEGO1/lego/legoomni/include/legoroilist.h @@ -51,4 +51,7 @@ class LegoROIList : public MxPtrList { // SYNTHETIC: LEGO1 0x1005f660 // MxPtrList::`scalar deleting destructor' +// TEMPLATE: LEGO1 0x1006ea00 +// MxListEntry::MxListEntry + #endif // LEGOROILIST_H diff --git a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp index a98b3b49..10cffd9c 100644 --- a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp @@ -251,11 +251,35 @@ LegoChar* LegoAnimPresenter::FUN_100697c0(const LegoChar* p_und1, const LegoChar return result; } -// STUB: LEGO1 0x100698b0 -LegoBool LegoAnimPresenter::FUN_100698b0(CompoundObject&, const LegoChar*) +// FUNCTION: LEGO1 0x100698b0 +LegoBool LegoAnimPresenter::FUN_100698b0(const CompoundObject& p_und1, const LegoChar* p_und2) { - // TODO - return FALSE; + LegoBool result = FALSE; + + LegoChar* str; + if (*(str = FUN_100697c0(p_und2, NULL)) == '*') { + LegoChar* tmp = FUN_10069150(str); + delete[] str; + str = tmp; + } + + if (str != NULL && *str != '\0' && p_und1.size() > 0) { + for (CompoundObject::const_iterator it = p_und1.begin(); it != p_und1.end(); it++) { + LegoROI* roi = (LegoROI*) *it; + const char* name = roi->GetName(); + + if (name != NULL) { + if (!strcmpi(name, str)) { + m_unk0x70->Append(roi); + result = TRUE; + break; + } + } + } + } + + delete[] str; + return result; } // STUB: LEGO1 0x1006ad30