diff --git a/LEGO1/lego/legoomni/include/legolocomotionanimpresenter.h b/LEGO1/lego/legoomni/include/legolocomotionanimpresenter.h index b70841ea..1a06ab35 100644 --- a/LEGO1/lego/legoomni/include/legolocomotionanimpresenter.h +++ b/LEGO1/lego/legoomni/include/legolocomotionanimpresenter.h @@ -2,6 +2,7 @@ #define LEGOLOCOMOTIONANIMPRESENTER_H #include "legoloopinganimpresenter.h" +#include "legoroimaplist.h" // VTABLE: LEGO1 0x100d9170 // SIZE 0xd8 @@ -50,12 +51,12 @@ class LegoLocomotionAnimPresenter : public LegoLoopingAnimPresenter { void Init(); void Destroy(MxBool p_fromDestructor); - undefined4 m_unk0xc0; // 0xc0 - undefined4* m_unk0xc4; // 0xc4 - MxCore* m_unk0xc8; // 0xc8 - MxS32 m_unk0xcc; // 0xcc - MxS32 m_unk0xd0; // 0xd0 - undefined2 m_unk0xd4; // 0xd4 + undefined4 m_unk0xc0; // 0xc0 + undefined4* m_unk0xc4; // 0xc4 + LegoROIMapList* m_roiMapList; // 0xc8 + MxS32 m_unk0xcc; // 0xcc + MxS32 m_unk0xd0; // 0xd0 + undefined2 m_unk0xd4; // 0xd4 }; #endif // LEGOLOCOMOTIONANIMPRESENTER_H diff --git a/LEGO1/lego/legoomni/include/legoroimaplist.h b/LEGO1/lego/legoomni/include/legoroimaplist.h new file mode 100644 index 00000000..697c2dd8 --- /dev/null +++ b/LEGO1/lego/legoomni/include/legoroimaplist.h @@ -0,0 +1,55 @@ +#ifndef LEGOROIMAPLIST_H +#define LEGOROIMAPLIST_H + +#include "mxlist.h" +#include "mxtypes.h" + +class LegoROI; + +// VTABLE: LEGO1 0x100d9218 +// class MxCollection + +// VTABLE: LEGO1 0x100d9230 +// class MxList + +// VTABLE: LEGO1 0x100d9248 +// class MxPtrList + +// VTABLE: LEGO1 0x100d9260 +// SIZE 0x18 +class LegoROIMapList : public MxPtrList { +public: + LegoROIMapList() : MxPtrList(TRUE) {} + + // SYNTHETIC: LEGO1 0x1006d360 + // LegoROIMapList::`scalar deleting destructor' +}; + +// TEMPLATE: LEGO1 0x1006d250 +// MxCollection::Compare + +// TEMPLATE: LEGO1 0x1006d260 +// MxCollection::~MxCollection + +// TEMPLATE: LEGO1 0x1006d2b0 +// MxCollection::Destroy + +// TEMPLATE: LEGO1 0x1006d2c0 +// MxList::~MxList + +// TEMPLATE: LEGO1 0x1006d3d0 +// MxPtrList::~MxPtrList + +// TEMPLATE: LEGO1 0x1006d350 +// MxPtrList::Destroy + +// SYNTHETIC: LEGO1 0x1006d420 +// MxCollection::`scalar deleting destructor' + +// SYNTHETIC: LEGO1 0x1006d490 +// MxList::`scalar deleting destructor' + +// SYNTHETIC: LEGO1 0x1006d540 +// MxPtrList::`scalar deleting destructor' + +#endif // LEGOROIMAPLIST_H diff --git a/LEGO1/lego/legoomni/src/video/legolocomotionanimpresenter.cpp b/LEGO1/lego/legoomni/src/video/legolocomotionanimpresenter.cpp index a5302e47..90b6533e 100644 --- a/LEGO1/lego/legoomni/src/video/legolocomotionanimpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legolocomotionanimpresenter.cpp @@ -1,8 +1,14 @@ #include "legolocomotionanimpresenter.h" +#include "anim/legoanim.h" +#include "legoanimactor.h" #include "legomain.h" #include "legoworld.h" #include "misc.h" +#include "mxautolock.h" +#include "mxdssubscriber.h" +#include "mxmisc.h" +#include "mxvariabletable.h" DECOMP_SIZE_ASSERT(LegoLocomotionAnimPresenter, 0xd8) @@ -22,10 +28,10 @@ LegoLocomotionAnimPresenter::~LegoLocomotionAnimPresenter() void LegoLocomotionAnimPresenter::Init() { m_unk0xc0 = 0; - m_unk0xc4 = 0; + m_unk0xc4 = NULL; m_unk0xcc = -1; m_unk0xd0 = -1; - m_unk0xc8 = 0; + m_roiMapList = NULL; m_unk0xd4 = 0; } @@ -38,8 +44,8 @@ void LegoLocomotionAnimPresenter::Destroy(MxBool p_fromDestructor) delete[] m_unk0xc4; } - if (m_unk0xc8) { - delete m_unk0xc8; + if (m_roiMapList) { + delete m_roiMapList; } m_roiMap = NULL; @@ -48,7 +54,7 @@ void LegoLocomotionAnimPresenter::Destroy(MxBool p_fromDestructor) m_criticalSection.Leave(); if (!p_fromDestructor) { - LegoAnimPresenter::Destroy(); + LegoLoopingAnimPresenter::Destroy(); } } @@ -59,10 +65,17 @@ MxResult LegoLocomotionAnimPresenter::CreateAnim(MxStreamChunk* p_chunk) return result == SUCCESS ? SUCCESS : result; } -// STUB: LEGO1 0x1006d160 +// FUNCTION: LEGO1 0x1006d160 +// FUNCTION: BETA10 0x100528c7 MxResult LegoLocomotionAnimPresenter::AddToManager() { - return MxVideoPresenter::AddToManager(); + m_roiMapList = new LegoROIMapList(); + + if (m_roiMapList == NULL) { + return FAILURE; + } + + return LegoAnimPresenter::AddToManager(); } // FUNCTION: LEGO1 0x1006d5b0 @@ -92,10 +105,18 @@ void LegoLocomotionAnimPresenter::ReadyTickle() } } -// STUB: LEGO1 0x1006d610 +// FUNCTION: LEGO1 0x1006d610 +// FUNCTION: BETA10 0x10052a34 void LegoLocomotionAnimPresenter::StartingTickle() { - // TODO + if (m_subscriber->PeekData()) { + MxStreamChunk* chunk = m_subscriber->PopData(); + m_subscriber->FreeDataChunk(chunk); + } + + if (m_roiMapList->GetCount() != 0) { + ProgressTickleState(e_streaming); + } } // FUNCTION: LEGO1 0x1006d660 @@ -114,8 +135,30 @@ void LegoLocomotionAnimPresenter::EndAction() } } -// STUB: LEGO1 0x1006d680 +// FUNCTION: LEGO1 0x1006d680 +// FUNCTION: BETA10 0x10052b3d void LegoLocomotionAnimPresenter::FUN_1006d680(LegoAnimActor* p_actor, MxFloat p_value) { - // TODO + AUTOLOCK(m_criticalSection); + + MxVariableTable* variableTable = VariableTable(); + + const char* key = ((LegoAnimNodeData*) m_anim->GetRoot()->GetData())->GetName(); + variableTable->SetVariable(key, p_actor->GetROI()->GetName()); + + FUN_100695c0(); + FUN_10069b10(); + + if (m_roiMap != NULL) { + m_roiMapList->Append(m_roiMap); + p_actor->FUN_1001c450(m_anim, p_value, m_roiMap, m_roiMapSize); + m_roiMap = NULL; + } + + variableTable->SetVariable(key, ""); + + if (m_unk0x70 != NULL) { + delete m_unk0x70; + m_unk0x70 = NULL; + } }