diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 519c3e21..c54cc6c4 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -2,7 +2,6 @@ ## Nomenclature - **Script**: SI File (it appears they wanted to use SI much more as actual scripts, but ended up hard-coding almost everything) -- **Action**: Mostly media file inside SI ## Core Concepts @@ -38,7 +37,7 @@ IsA() Checks ALL parents. ### MxTickleManager : MxCore -Holds a list of MxTickleClient*. Goes though the on Tickle() and calls Tickle() if interval time has passed. +Holds a list of MxTickleClient*. Goes though them on Tickle() and calls Tickle() if interval time has passed. ### MxTickleClient Holds a MxCore*, Interval, LastUpdateTime and Flags (only used for TICKLE_MANAGER_FLAG_DESTROY?). @@ -82,9 +81,20 @@ Then reads a list of strings (presumably numbers) into a list. Then reads the sa ### MxDSSound : MxDSMediaAction Deserializes a volume. +### MxDSObjectAction : MxDSMediaAction +Adds nothing. + ### MxVariableTable : MxHashTable MxOmni holds a VariableTable that is just a key/value store string/string. +### MxPresenter : MxCore +Abstract base class for all presenters. Separates the tickle down to ReadyTickle(), StartingTickle(), StreamingTickle(), RepeatingTickle(), FreezingTickle() and DoneTickle() + +Similar to DeserializeDSObjectDispatch, there is a PresenterNameDispatch() that reads the media format (" FLC", " SMK", " MID", " WAV") and returns the corresponding HandlerClassName(). + +### MxMediaPresenter : MxPresenter +Hold a MxDSSubscriber* and reads data from it on the tickles. + ### LegoBuildingManager : MxCore #### CreateBuilding() diff --git a/LEGO1/lego/legoomni/include/legoanimationmanager.h b/LEGO1/lego/legoomni/include/legoanimationmanager.h index f216ca30..a1cf9ce5 100644 --- a/LEGO1/lego/legoomni/include/legoanimationmanager.h +++ b/LEGO1/lego/legoomni/include/legoanimationmanager.h @@ -43,7 +43,7 @@ struct AnimInfo { MxU8 m_modelCount; // 0x20 MxU16 m_unk0x22; // 0x22 ModelInfo* m_models; // 0x24 - MxS8 m_unk0x28; // 0x28 + MxS8 m_characterIndex; // 0x28 MxBool m_unk0x29; // 0x29 MxS8 m_unk0x2a[3]; // 0x2a }; diff --git a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp index 08f6abed..60584735 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp @@ -679,7 +679,7 @@ MxResult LegoAnimationManager::LoadWorldInfo(LegoOmni::World p_worldId) goto done; } - m_anims[j].m_unk0x28 = GetCharacterIndex(m_anims[j].m_name + strlen(m_anims[j].m_name) - 2); + m_anims[j].m_characterIndex = GetCharacterIndex(m_anims[j].m_name + strlen(m_anims[j].m_name) - 2); m_anims[j].m_unk0x29 = FALSE; for (k = 0; k < 3; k++) { @@ -1615,7 +1615,7 @@ MxU16 LegoAnimationManager::FUN_10062110( MxS8 index = GetCharacterIndex(p_roi->GetName()); for (MxU16 i = m_unk0x0e; i <= m_unk0x10; i++) { - if (m_anims[i].m_unk0x28 == index && m_anims[i].m_unk0x0c & p_unk0x0c && m_anims[i].m_unk0x29) { + if (m_anims[i].m_characterIndex == index && m_anims[i].m_unk0x0c & p_unk0x0c && m_anims[i].m_unk0x29) { MxS32 vehicleId = g_characters[index].m_vehicleId; if (vehicleId >= 0) { MxBool found = FALSE; @@ -1636,7 +1636,7 @@ MxU16 LegoAnimationManager::FUN_10062110( MxU16 unk0x22 = m_anims[i].m_unk0x22; for (i = i + 1; i <= m_unk0x10; i++) { - if (m_anims[i].m_unk0x28 == index && m_anims[i].m_unk0x0c & p_unk0x0c && + if (m_anims[i].m_characterIndex == index && m_anims[i].m_unk0x0c & p_unk0x0c && m_anims[i].m_unk0x29 && m_anims[i].m_unk0x22 < unk0x22) { result = i; unk0x22 = m_anims[i].m_unk0x22; diff --git a/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp b/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp index d579beb1..ec5f9ff9 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp @@ -400,7 +400,7 @@ MxBool LegoAnimMMPresenter::FUN_1004b610(MxLong p_time) } } - m_action->SetUnknown90(Timer()->GetTime()); + m_action->SetStartTime(Timer()->GetTime()); if (m_compositePresenter != NULL) { m_compositePresenter->VTable0x60(this); diff --git a/LEGO1/lego/legoomni/src/common/mxcompositemediapresenter.cpp b/LEGO1/lego/legoomni/src/common/mxcompositemediapresenter.cpp index dadd8de7..57fe91ec 100644 --- a/LEGO1/lego/legoomni/src/common/mxcompositemediapresenter.cpp +++ b/LEGO1/lego/legoomni/src/common/mxcompositemediapresenter.cpp @@ -84,7 +84,7 @@ MxResult MxCompositeMediaPresenter::StartAction(MxStreamController* p_controller if (!m_compositePresenter) { SetTickleState(e_ready); MxLong time = Timer()->GetTime(); - m_action->SetUnknown90(time); + m_action->SetStartTime(time); } result = SUCCESS; @@ -134,7 +134,7 @@ void MxCompositeMediaPresenter::StartingTickle() if (!m_unk0x4c) { ProgressTickleState(e_streaming); MxLong time = Timer()->GetTime(); - m_action->SetUnknown90(time); + m_action->SetStartTime(time); } } } diff --git a/LEGO1/lego/legoomni/src/common/mxcontrolpresenter.cpp b/LEGO1/lego/legoomni/src/common/mxcontrolpresenter.cpp index 17beb3c1..bccca8b8 100644 --- a/LEGO1/lego/legoomni/src/common/mxcontrolpresenter.cpp +++ b/LEGO1/lego/legoomni/src/common/mxcontrolpresenter.cpp @@ -189,7 +189,7 @@ void MxControlPresenter::VTable0x6c(MxS16 p_unk0x4e) m_unk0x4e = p_unk0x4e; } - m_action->SetUnknown90(Timer()->GetTime()); + m_action->SetStartTime(Timer()->GetTime()); MxS16 i = 0; for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) { diff --git a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp index e20ca985..9c259ea5 100644 --- a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp @@ -815,7 +815,7 @@ void LegoAnimPresenter::StartingTickle() m_compositePresenter->VTable0x60(this); } else { - m_action->SetUnknown90(Timer()->GetTime()); + m_action->SetStartTime(Timer()->GetTime()); } ProgressTickleState(e_streaming); diff --git a/LEGO1/omni/include/mxdsaction.h b/LEGO1/omni/include/mxdsaction.h index 1597038e..05b358e3 100644 --- a/LEGO1/omni/include/mxdsaction.h +++ b/LEGO1/omni/include/mxdsaction.h @@ -55,8 +55,8 @@ class MxDSAction : public MxDSObject { virtual MxDSAction* Clone(); // vtable+0x2c virtual void MergeFrom(MxDSAction& p_dsAction); // vtable+0x30 virtual MxBool HasId(MxU32 p_objectId); // vtable+0x34 - virtual void SetUnknown90(MxLong p_unk0x90); // vtable+0x38 - virtual MxLong GetUnknown90(); // vtable+0x3c + virtual void SetStartTime(MxLong p_unk0x90); // vtable+0x38 + virtual MxLong GetStartTIme(); // vtable+0x3c virtual MxLong GetElapsedTime(); // vtable+0x40 void AppendExtra(MxU16 p_extraLength, const char* p_extraData); @@ -130,7 +130,7 @@ class MxDSAction : public MxDSObject { MxCore* m_unk0x84; // 0x84 undefined4 m_unk0x88; // 0x88 MxCore* m_origin; // 0x8c - MxLong m_unk0x90; // 0x90 + MxLong m_startTime; // 0x90 }; #endif // MXDSACTION_H diff --git a/LEGO1/omni/include/mxdsmultiaction.h b/LEGO1/omni/include/mxdsmultiaction.h index 90cc5192..80951673 100644 --- a/LEGO1/omni/include/mxdsmultiaction.h +++ b/LEGO1/omni/include/mxdsmultiaction.h @@ -38,7 +38,7 @@ class MxDSMultiAction : public MxDSAction { MxDSAction* Clone() override; // vtable+0x2c void MergeFrom(MxDSAction& p_dsAction) override; // vtable+0x30 MxBool HasId(MxU32 p_objectId) override; // vtable+0x34 - void SetUnknown90(MxLong p_unk0x90) override; // vtable+0x38 + void SetStartTime(MxLong p_unk0x90) override; // vtable+0x38 // FUNCTION: BETA10 0x1004e180 MxDSActionList* GetActionList() const { return m_actionList; } diff --git a/LEGO1/omni/src/action/mxdsaction.cpp b/LEGO1/omni/src/action/mxdsaction.cpp index eeb3dc68..b5fa8ee2 100644 --- a/LEGO1/omni/src/action/mxdsaction.cpp +++ b/LEGO1/omni/src/action/mxdsaction.cpp @@ -31,7 +31,7 @@ MxDSAction::MxDSAction() m_unk0x84 = NULL; m_unk0x88 = 0; m_origin = NULL; - m_unk0x90 = INT_MIN; + m_startTime = INT_MIN; } // FUNCTION: LEGO1 0x100ad940 @@ -57,16 +57,16 @@ MxBool MxDSAction::HasId(MxU32 p_objectId) // FUNCTION: LEGO1 0x100ada40 // FUNCTION: BETA10 0x1012bdf0 -void MxDSAction::SetUnknown90(MxLong p_unk0x90) +void MxDSAction::SetStartTime(MxLong p_startTime) { - m_unk0x90 = p_unk0x90; + m_startTime = p_startTime; } // FUNCTION: LEGO1 0x100ada50 // FUNCTION: BETA10 0x1012be20 -MxLong MxDSAction::GetUnknown90() +MxLong MxDSAction::GetStartTIme() { - return m_unk0x90; + return m_startTime; } // FUNCTION: LEGO1 0x100ada80 @@ -92,7 +92,7 @@ void MxDSAction::CopyFrom(MxDSAction& p_dsAction) m_unk0x84 = p_dsAction.m_unk0x84; m_unk0x88 = p_dsAction.m_unk0x88; m_origin = p_dsAction.m_origin; - m_unk0x90 = p_dsAction.m_unk0x90; + m_startTime = p_dsAction.m_startTime; } // FUNCTION: BETA10 0x1012b2b3 @@ -158,7 +158,7 @@ MxDSAction* MxDSAction::Clone() // FUNCTION: BETA10 0x1012b4ca MxLong MxDSAction::GetElapsedTime() { - return Timer()->GetTime() - m_unk0x90; + return Timer()->GetTime() - m_startTime; } // FUNCTION: LEGO1 0x100add00 diff --git a/LEGO1/omni/src/action/mxdsmultiaction.cpp b/LEGO1/omni/src/action/mxdsmultiaction.cpp index 579b7937..9585b587 100644 --- a/LEGO1/omni/src/action/mxdsmultiaction.cpp +++ b/LEGO1/omni/src/action/mxdsmultiaction.cpp @@ -57,14 +57,14 @@ MxDSMultiAction& MxDSMultiAction::operator=(MxDSMultiAction& p_dsMultiAction) // FUNCTION: LEGO1 0x100ca290 // FUNCTION: BETA10 0x10159728 -void MxDSMultiAction::SetUnknown90(MxLong p_unk0x90) +void MxDSMultiAction::SetStartTime(MxLong p_unk0x90) { - m_unk0x90 = p_unk0x90; + m_startTime = p_unk0x90; MxDSActionListCursor cursor(m_actionList); MxDSAction* action; while (cursor.Next(action)) { - action->SetUnknown90(p_unk0x90); + action->SetStartTime(p_unk0x90); } } diff --git a/LEGO1/omni/src/common/mxmediapresenter.cpp b/LEGO1/omni/src/common/mxmediapresenter.cpp index 3c81c0e7..bbd39901 100644 --- a/LEGO1/omni/src/common/mxmediapresenter.cpp +++ b/LEGO1/omni/src/common/mxmediapresenter.cpp @@ -252,7 +252,7 @@ void MxMediaPresenter::Enable(MxBool p_enable) if (p_enable) { MxLong time = Timer()->GetTime(); - m_action->SetUnknown90(time); + m_action->SetStartTime(time); SetTickleState(e_repeating); } else { diff --git a/LEGO1/omni/src/stream/mxdsbuffer.cpp b/LEGO1/omni/src/stream/mxdsbuffer.cpp index 734df8d8..f2211ef9 100644 --- a/LEGO1/omni/src/stream/mxdsbuffer.cpp +++ b/LEGO1/omni/src/stream/mxdsbuffer.cpp @@ -209,7 +209,7 @@ MxResult MxDSBuffer::StartPresenterFromAction( p_objectheader->SetUnknown28(p_action1->GetUnknown28()); p_objectheader->SetUnknown84(p_action1->GetUnknown84()); p_objectheader->SetOrigin(p_action1->GetOrigin()); - p_objectheader->SetUnknown90(p_action1->GetUnknown90()); + p_objectheader->SetStartTime(p_action1->GetStartTIme()); p_objectheader->MergeFrom(*p_action1); m_unk0x30->SetInternalAction(p_objectheader->Clone()); diff --git a/LEGO1/omni/src/stream/mxstreamcontroller.cpp b/LEGO1/omni/src/stream/mxstreamcontroller.cpp index 83ea6951..41258578 100644 --- a/LEGO1/omni/src/stream/mxstreamcontroller.cpp +++ b/LEGO1/omni/src/stream/mxstreamcontroller.cpp @@ -202,7 +202,7 @@ MxResult MxStreamController::FUN_100c1a00(MxDSAction* p_action, MxU32 p_offset) streamingAction->SetObjectId(p_action->GetObjectId()); MxLong time = Timer()->GetTime(); - streamingAction->SetUnknown90(time); + streamingAction->SetStartTime(time); m_unk0x3c.PushBack(streamingAction); return SUCCESS;