From 58ea45f4cc72e8f71b19b9817c0b40d83c4412ed Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Mon, 8 Jan 2024 13:07:13 -0500 Subject: [PATCH] Name various functions and other members (#418) * Name various functions and other members * Rename var --- .../legoomni/include/legopalettepresenter.h | 2 +- .../src/common/legoactioncontrolpresenter.cpp | 2 +- .../src/common/mxcompositemediapresenter.cpp | 2 +- .../src/video/legopalettepresenter.cpp | 10 +-- LEGO1/omni/include/mxdssubscriber.h | 20 +++--- LEGO1/omni/include/mxmediapresenter.h | 12 ++-- LEGO1/omni/include/mxwavepresenter.h | 30 ++++---- LEGO1/omni/src/audio/mxmidipresenter.cpp | 6 +- LEGO1/omni/src/audio/mxwavepresenter.cpp | 12 ++-- LEGO1/omni/src/common/mxmediapresenter.cpp | 72 +++++++++---------- LEGO1/omni/src/event/mxeventpresenter.cpp | 4 +- LEGO1/omni/src/stream/mxdssubscriber.cpp | 60 ++++++++-------- .../omni/src/video/mxloopingflcpresenter.cpp | 4 +- .../omni/src/video/mxloopingsmkpresenter.cpp | 16 ++--- LEGO1/omni/src/video/mxstillpresenter.cpp | 4 +- LEGO1/omni/src/video/mxvideopresenter.cpp | 10 +-- 16 files changed, 133 insertions(+), 133 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legopalettepresenter.h b/LEGO1/lego/legoomni/include/legopalettepresenter.h index f725149d..858e1097 100644 --- a/LEGO1/lego/legoomni/include/legopalettepresenter.h +++ b/LEGO1/lego/legoomni/include/legopalettepresenter.h @@ -28,7 +28,7 @@ public: virtual void ReadyTickle() override; // vtable+0x18 virtual void Destroy() override; // vtable+0x38 - MxResult ParsePallete(MxStreamChunk* p_chunk); + MxResult ParsePalette(MxStreamChunk* p_chunk); private: void Init(); diff --git a/LEGO1/lego/legoomni/src/common/legoactioncontrolpresenter.cpp b/LEGO1/lego/legoomni/src/common/legoactioncontrolpresenter.cpp index 5f4867ea..953aef36 100644 --- a/LEGO1/lego/legoomni/src/common/legoactioncontrolpresenter.cpp +++ b/LEGO1/lego/legoomni/src/common/legoactioncontrolpresenter.cpp @@ -22,7 +22,7 @@ void LegoActionControlPresenter::ReadyTickle() m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState; m_currentTickleState = TickleState_Starting; - m_subscriber->FUN_100b8390(chunk); + m_subscriber->DestroyChunk(chunk); if (m_compositePresenter) { if (m_action->GetDuration() == -1 || m_action->GetFlags() & 1) { m_compositePresenter->VTable0x60(this); diff --git a/LEGO1/lego/legoomni/src/common/mxcompositemediapresenter.cpp b/LEGO1/lego/legoomni/src/common/mxcompositemediapresenter.cpp index 0547c815..2a15d445 100644 --- a/LEGO1/lego/legoomni/src/common/mxcompositemediapresenter.cpp +++ b/LEGO1/lego/legoomni/src/common/mxcompositemediapresenter.cpp @@ -114,7 +114,7 @@ void MxCompositeMediaPresenter::StartingTickle() } else { for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) { - if (!(*it)->GetAction()->GetStartTime() && ((MxMediaPresenter*) *it)->FUN_100b5650() && + if (!(*it)->GetAction()->GetStartTime() && ((MxMediaPresenter*) *it)->CurrentChunk() && !((*it)->GetAction()->GetFlags() & MxDSAction::Flag_Bit9)) { (*it)->Tickle(); (*it)->GetAction()->SetFlags((*it)->GetAction()->GetFlags() | MxDSAction::Flag_Bit9); diff --git a/LEGO1/lego/legoomni/src/video/legopalettepresenter.cpp b/LEGO1/lego/legoomni/src/video/legopalettepresenter.cpp index f18a22c3..821942b9 100644 --- a/LEGO1/lego/legoomni/src/video/legopalettepresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legopalettepresenter.cpp @@ -46,7 +46,7 @@ void LegoPalettePresenter::Destroy() } // FUNCTION: LEGO1 0x1007a130 -MxResult LegoPalettePresenter::ParsePallete(MxStreamChunk* p_chunk) +MxResult LegoPalettePresenter::ParsePalette(MxStreamChunk* p_chunk) { MxU8 buffer[40]; RGBQUAD palleteData[256]; @@ -72,15 +72,15 @@ MxResult LegoPalettePresenter::ParsePallete(MxStreamChunk* p_chunk) // FUNCTION: LEGO1 0x1007a230 void LegoPalettePresenter::ReadyTickle() { - MxStreamChunk* chunk = m_subscriber->FUN_100b8360(); + MxStreamChunk* chunk = m_subscriber->CurrentChunk(); if (chunk) { if (chunk->GetTime() <= m_action->GetElapsedTime()) { ParseExtra(); m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState; m_currentTickleState = TickleState_Starting; - chunk = m_subscriber->FUN_100b8250(); - MxResult result = ParsePallete(chunk); - m_subscriber->FUN_100b8390(chunk); + chunk = m_subscriber->NextChunk(); + MxResult result = ParsePalette(chunk); + m_subscriber->DestroyChunk(chunk); if (result == SUCCESS) { VideoManager()->RealizePalette(m_palette); diff --git a/LEGO1/omni/include/mxdssubscriber.h b/LEGO1/omni/include/mxdssubscriber.h index 8187e354..1156be36 100644 --- a/LEGO1/omni/include/mxdssubscriber.h +++ b/LEGO1/omni/include/mxdssubscriber.h @@ -32,21 +32,21 @@ public: MxResult Create(MxStreamController* p_controller, MxU32 p_objectId, MxS16 p_unk0x48); void DeleteChunks(); MxResult AddChunk(MxStreamChunk* p_chunk, MxBool p_append); - MxStreamChunk* FUN_100b8250(); - MxStreamChunk* FUN_100b8360(); - void FUN_100b8390(MxStreamChunk* p_chunk); + MxStreamChunk* NextChunk(); + MxStreamChunk* CurrentChunk(); + void DestroyChunk(MxStreamChunk* p_chunk); inline MxU32 GetObjectId() { return m_objectId; } inline MxS16 GetUnknown48() { return m_unk0x48; } private: - MxStreamChunkList m_unk0x08; // 0x08 - MxStreamChunkListCursor* m_unk0x20; // 0x20 - MxStreamChunkList m_unk0x24; // 0x24 - MxStreamChunkListCursor* m_unk0x3c; // 0x3c - MxStreamController* m_controller; // 0x40 - MxU32 m_objectId; // 0x44 - MxS16 m_unk0x48; // 0x48 + MxStreamChunkList m_pendingChunks; // 0x08 + MxStreamChunkListCursor* m_pendingChunkCursor; // 0x20 + MxStreamChunkList m_consumedChunks; // 0x24 + MxStreamChunkListCursor* m_consumedChunkCursor; // 0x3c + MxStreamController* m_controller; // 0x40 + MxU32 m_objectId; // 0x44 + MxS16 m_unk0x48; // 0x48 }; // SYNTHETIC: LEGO1 0x100b7de0 diff --git a/LEGO1/omni/include/mxmediapresenter.h b/LEGO1/omni/include/mxmediapresenter.h index 32c7b6d0..64baa409 100644 --- a/LEGO1/omni/include/mxmediapresenter.h +++ b/LEGO1/omni/include/mxmediapresenter.h @@ -35,19 +35,19 @@ public: virtual MxResult StartAction(MxStreamController*, MxDSAction*) override; // vtable+0x3c virtual void EndAction() override; // vtable+0x40 virtual void Enable(MxBool p_enable) override; // vtable+0x54 - virtual void AppendChunk(MxStreamChunk* p_chunk); // vtable+0x58 + virtual void LoopChunk(MxStreamChunk* p_chunk); // vtable+0x58 protected: - MxDSSubscriber* m_subscriber; // 0x40 - MxStreamChunkList* m_chunks; // 0x44 - MxStreamChunkListCursor* m_cursor; // 0x48 - MxStreamChunk* m_currentChunk; // 0x4c + MxDSSubscriber* m_subscriber; // 0x40 + MxStreamChunkList* m_loopingChunks; // 0x44 + MxStreamChunkListCursor* m_loopingChunkCursor; // 0x48 + MxStreamChunk* m_currentChunk; // 0x4c void Init(); void Destroy(MxBool p_fromDestructor); public: - MxStreamChunk* FUN_100b5650(); + MxStreamChunk* CurrentChunk(); MxStreamChunk* NextChunk(); }; diff --git a/LEGO1/omni/include/mxwavepresenter.h b/LEGO1/omni/include/mxwavepresenter.h index cd09d486..383659ab 100644 --- a/LEGO1/omni/include/mxwavepresenter.h +++ b/LEGO1/omni/include/mxwavepresenter.h @@ -26,21 +26,21 @@ public: return !strcmp(p_name, MxWavePresenter::ClassName()) || MxSoundPresenter::IsA(p_name); } - virtual void ReadyTickle() override; // vtable+0x18 - virtual void StartingTickle() override; // vtable+0x1c - virtual void StreamingTickle() override; // vtable+0x20 - virtual void DoneTickle() override; // vtable+0x2c - virtual void ParseExtra() override; // vtable+0x30 - virtual MxResult AddToManager() override; // vtable+0x34 - virtual void Destroy() override; // vtable+0x38 - virtual void EndAction() override; // vtable+0x40 - virtual MxResult PutData() override; // vtable+0x4c - virtual void Enable(MxBool p_enable) override; // vtable+0x54 - virtual void AppendChunk(MxStreamChunk* p_chunk) override; // vtable+0x58 - virtual void SetVolume(MxS32 p_volume) override; // vtable+0x60 - virtual void Pause(); // vtable+0x64 - virtual void Resume(); // vtable+0x68 - virtual MxBool IsPaused(); // vtable+0x6c + virtual void ReadyTickle() override; // vtable+0x18 + virtual void StartingTickle() override; // vtable+0x1c + virtual void StreamingTickle() override; // vtable+0x20 + virtual void DoneTickle() override; // vtable+0x2c + virtual void ParseExtra() override; // vtable+0x30 + virtual MxResult AddToManager() override; // vtable+0x34 + virtual void Destroy() override; // vtable+0x38 + virtual void EndAction() override; // vtable+0x40 + virtual MxResult PutData() override; // vtable+0x4c + virtual void Enable(MxBool p_enable) override; // vtable+0x54 + virtual void LoopChunk(MxStreamChunk* p_chunk) override; // vtable+0x58 + virtual void SetVolume(MxS32 p_volume) override; // vtable+0x60 + virtual void Pause(); // vtable+0x64 + virtual void Resume(); // vtable+0x68 + virtual MxBool IsPaused(); // vtable+0x6c // Reference: https://github.com/itsmattkc/SIEdit/blob/master/lib/othertypes.h // SIZE 0x1c diff --git a/LEGO1/omni/src/audio/mxmidipresenter.cpp b/LEGO1/omni/src/audio/mxmidipresenter.cpp index ebf6ab68..95add150 100644 --- a/LEGO1/omni/src/audio/mxmidipresenter.cpp +++ b/LEGO1/omni/src/audio/mxmidipresenter.cpp @@ -35,7 +35,7 @@ void MxMIDIPresenter::Destroy(MxBool p_fromDestructor) m_criticalSection.Enter(); if (m_subscriber && m_chunk) - m_subscriber->FUN_100b8390(m_chunk); + m_subscriber->DestroyChunk(m_chunk); Init(); m_criticalSection.Leave(); @@ -50,7 +50,7 @@ void MxMIDIPresenter::ReadyTickle() MxStreamChunk* chunk = NextChunk(); if (chunk) { - m_subscriber->FUN_100b8390(chunk); + m_subscriber->DestroyChunk(chunk); ParseExtra(); m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState; m_currentTickleState = TickleState_Starting; @@ -60,7 +60,7 @@ void MxMIDIPresenter::ReadyTickle() // FUNCTION: LEGO1 0x100c28d0 void MxMIDIPresenter::StartingTickle() { - MxStreamChunk* chunk = FUN_100b5650(); + MxStreamChunk* chunk = CurrentChunk(); if (chunk && m_action->GetElapsedTime() >= chunk->GetTime()) { m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState; diff --git a/LEGO1/omni/src/audio/mxwavepresenter.cpp b/LEGO1/omni/src/audio/mxwavepresenter.cpp index a2102ae8..d77ccac2 100644 --- a/LEGO1/omni/src/audio/mxwavepresenter.cpp +++ b/LEGO1/omni/src/audio/mxwavepresenter.cpp @@ -134,7 +134,7 @@ void MxWavePresenter::ReadyTickle() if (chunk) { m_waveFormat = (WaveFormat*) new MxU8[chunk->GetLength()]; memcpy(m_waveFormat, chunk->GetData(), chunk->GetLength()); - m_subscriber->FUN_100b8390(chunk); + m_subscriber->DestroyChunk(chunk); ParseExtra(); m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState; m_currentTickleState = TickleState_Starting; @@ -144,7 +144,7 @@ void MxWavePresenter::ReadyTickle() // FUNCTION: LEGO1 0x100b1d50 void MxWavePresenter::StartingTickle() { - MxStreamChunk* chunk = FUN_100b5650(); + MxStreamChunk* chunk = CurrentChunk(); if (chunk && m_action->GetElapsedTime() >= chunk->GetTime()) { MxU32 length = chunk->GetLength(); @@ -199,7 +199,7 @@ void MxWavePresenter::StreamingTickle() { if (!m_currentChunk) { if (!(m_action->GetFlags() & MxDSAction::Flag_Looping)) { - MxStreamChunk* chunk = FUN_100b5650(); + MxStreamChunk* chunk = CurrentChunk(); if (chunk && chunk->GetFlags() & MxDSChunk::Flag_End && !(chunk->GetFlags() & MxDSChunk::Flag_Bit16)) { chunk->SetFlags(chunk->GetFlags() | MxDSChunk::Flag_Bit16); @@ -237,11 +237,11 @@ void MxWavePresenter::DoneTickle() } // FUNCTION: LEGO1 0x100b2130 -void MxWavePresenter::AppendChunk(MxStreamChunk* p_chunk) +void MxWavePresenter::LoopChunk(MxStreamChunk* p_chunk) { WriteToSoundBuffer(p_chunk->GetData(), p_chunk->GetLength()); if (IsEnabled()) - m_subscriber->FUN_100b8390(p_chunk); + m_subscriber->DestroyChunk(p_chunk); } // FUNCTION: LEGO1 0x100b2160 @@ -254,7 +254,7 @@ MxResult MxWavePresenter::PutData() case TickleState_Streaming: if (m_currentChunk && FUN_100b1ba0()) { WriteToSoundBuffer(m_currentChunk->GetData(), m_currentChunk->GetLength()); - m_subscriber->FUN_100b8390(m_currentChunk); + m_subscriber->DestroyChunk(m_currentChunk); m_currentChunk = NULL; } diff --git a/LEGO1/omni/src/common/mxmediapresenter.cpp b/LEGO1/omni/src/common/mxmediapresenter.cpp index 66b98f5c..a9383e4d 100644 --- a/LEGO1/omni/src/common/mxmediapresenter.cpp +++ b/LEGO1/omni/src/common/mxmediapresenter.cpp @@ -27,8 +27,8 @@ void MxMediaPresenter::Destroy() void MxMediaPresenter::Init() { this->m_subscriber = NULL; - this->m_chunks = NULL; - this->m_cursor = NULL; + this->m_loopingChunks = NULL; + this->m_loopingChunkCursor = NULL; this->m_currentChunk = NULL; } @@ -39,22 +39,22 @@ void MxMediaPresenter::Destroy(MxBool p_fromDestructor) MxAutoLocker lock(&m_criticalSection); if (m_currentChunk && m_subscriber) - m_subscriber->FUN_100b8390(m_currentChunk); + m_subscriber->DestroyChunk(m_currentChunk); if (m_subscriber) delete m_subscriber; - if (m_cursor) - delete m_cursor; + if (m_loopingChunkCursor) + delete m_loopingChunkCursor; - if (m_chunks) { - MxStreamChunkListCursor cursor(m_chunks); + if (m_loopingChunks) { + MxStreamChunkListCursor cursor(m_loopingChunks); MxStreamChunk* chunk; while (cursor.Next(chunk)) chunk->Release(); - delete m_chunks; + delete m_loopingChunks; } Init(); @@ -65,44 +65,44 @@ void MxMediaPresenter::Destroy(MxBool p_fromDestructor) } // FUNCTION: LEGO1 0x100b5650 -MxStreamChunk* MxMediaPresenter::FUN_100b5650() +MxStreamChunk* MxMediaPresenter::CurrentChunk() { - MxStreamChunk* result = NULL; + MxStreamChunk* chunk = NULL; if (m_subscriber) { - result = m_subscriber->FUN_100b8360(); + chunk = m_subscriber->CurrentChunk(); - if (result && result->GetFlags() & MxDSChunk::Flag_Bit3) { + if (chunk && chunk->GetFlags() & MxDSChunk::Flag_Bit3) { m_action->SetFlags(m_action->GetFlags() | MxDSAction::Flag_Bit7); - m_subscriber->FUN_100b8250(); - m_subscriber->FUN_100b8390(result); - result = NULL; + m_subscriber->NextChunk(); + m_subscriber->DestroyChunk(chunk); + chunk = NULL; m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState; m_currentTickleState = TickleState_Done; } } - return result; + return chunk; } // FUNCTION: LEGO1 0x100b56b0 MxStreamChunk* MxMediaPresenter::NextChunk() { - MxStreamChunk* result = NULL; + MxStreamChunk* chunk = NULL; if (m_subscriber) { - result = m_subscriber->FUN_100b8250(); + chunk = m_subscriber->NextChunk(); - if (result && result->GetFlags() & MxDSChunk::Flag_Bit3) { + if (chunk && chunk->GetFlags() & MxDSChunk::Flag_Bit3) { m_action->SetFlags(m_action->GetFlags() | MxDSAction::Flag_Bit7); - m_subscriber->FUN_100b8390(result); - result = NULL; + m_subscriber->DestroyChunk(chunk); + chunk = NULL; m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState; m_currentTickleState = TickleState_Done; } } - return result; + return chunk; } // FUNCTION: LEGO1 0x100b5700 @@ -113,10 +113,10 @@ MxResult MxMediaPresenter::StartAction(MxStreamController* p_controller, MxDSAct if (MxPresenter::StartAction(p_controller, p_action) == SUCCESS) { if (m_action->GetFlags() & MxDSAction::Flag_Looping) { - m_chunks = new MxStreamChunkList; - m_cursor = new MxStreamChunkListCursor(m_chunks); + m_loopingChunks = new MxStreamChunkList; + m_loopingChunkCursor = new MxStreamChunkListCursor(m_loopingChunks); - if (!m_chunks && !m_cursor) + if (!m_loopingChunks && !m_loopingChunkCursor) goto done; } @@ -180,7 +180,7 @@ MxResult MxMediaPresenter::Tickle() { MxAutoLocker lock(&m_criticalSection); - FUN_100b5650(); + CurrentChunk(); return MxPresenter::Tickle(); } @@ -193,16 +193,16 @@ void MxMediaPresenter::StreamingTickle() if (m_currentChunk) { if (m_currentChunk->GetFlags() & MxDSChunk::Flag_End) { - m_subscriber->FUN_100b8390(m_currentChunk); + m_subscriber->DestroyChunk(m_currentChunk); m_currentChunk = NULL; m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState; m_currentTickleState = TickleState_Repeating; } else if (m_action->GetFlags() & MxDSAction::Flag_Looping) { - AppendChunk(m_currentChunk); + LoopChunk(m_currentChunk); if (!IsEnabled()) { - m_subscriber->FUN_100b8390(m_currentChunk); + m_subscriber->DestroyChunk(m_currentChunk); m_currentChunk = NULL; } } @@ -214,9 +214,9 @@ void MxMediaPresenter::StreamingTickle() void MxMediaPresenter::RepeatingTickle() { if (IsEnabled() && !m_currentChunk) { - if (m_cursor) - if (!m_cursor->Next(m_currentChunk)) - m_cursor->Next(m_currentChunk); + if (m_loopingChunkCursor) + if (!m_loopingChunkCursor->Next(m_currentChunk)) + m_loopingChunkCursor->Next(m_currentChunk); if (m_currentChunk) { MxLong time = m_currentChunk->GetTime(); @@ -243,7 +243,7 @@ void MxMediaPresenter::DoneTickle() } // FUNCTION: LEGO1 0x100b5f10 -void MxMediaPresenter::AppendChunk(MxStreamChunk* p_chunk) +void MxMediaPresenter::LoopChunk(MxStreamChunk* p_chunk) { MxStreamChunk* chunk = new MxStreamChunk; @@ -253,7 +253,7 @@ void MxMediaPresenter::AppendChunk(MxStreamChunk* p_chunk) chunk->SetTime(p_chunk->GetTime()); memcpy(chunk->GetData(), p_chunk->GetData(), chunk->GetLength()); - m_chunks->Append(chunk); + m_loopingChunks->Append(chunk); } // FUNCTION: LEGO1 0x100b6030 @@ -268,8 +268,8 @@ void MxMediaPresenter::Enable(MxBool p_enable) SetTickleState(TickleState_Repeating); } else { - if (m_cursor) - m_cursor->Reset(); + if (m_loopingChunkCursor) + m_loopingChunkCursor->Reset(); m_currentChunk = NULL; SetTickleState(TickleState_Done); } diff --git a/LEGO1/omni/src/event/mxeventpresenter.cpp b/LEGO1/omni/src/event/mxeventpresenter.cpp index ce3fdbdf..6a0a0cbd 100644 --- a/LEGO1/omni/src/event/mxeventpresenter.cpp +++ b/LEGO1/omni/src/event/mxeventpresenter.cpp @@ -69,7 +69,7 @@ void MxEventPresenter::ReadyTickle() if (chunk) { CopyData(chunk); - m_subscriber->FUN_100b8390(chunk); + m_subscriber->DestroyChunk(chunk); ParseExtra(); m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState; m_currentTickleState = TickleState_Starting; @@ -107,7 +107,7 @@ MxResult MxEventPresenter::PutData() } if (m_currentTickleState == TickleState_Streaming) - m_subscriber->FUN_100b8390(m_currentChunk); + m_subscriber->DestroyChunk(m_currentChunk); m_currentChunk = NULL; } } diff --git a/LEGO1/omni/src/stream/mxdssubscriber.cpp b/LEGO1/omni/src/stream/mxdssubscriber.cpp index f50d34a1..f93969e1 100644 --- a/LEGO1/omni/src/stream/mxdssubscriber.cpp +++ b/LEGO1/omni/src/stream/mxdssubscriber.cpp @@ -9,8 +9,8 @@ MxDSSubscriber::MxDSSubscriber() { m_unk0x48 = -1; m_objectId = -1; - m_unk0x20 = NULL; - m_unk0x3c = NULL; + m_pendingChunkCursor = NULL; + m_consumedChunkCursor = NULL; } // FUNCTION: LEGO1 0x100b7e00 @@ -21,13 +21,13 @@ MxDSSubscriber::~MxDSSubscriber() DeleteChunks(); - if (m_unk0x20) - delete m_unk0x20; - m_unk0x20 = NULL; + if (m_pendingChunkCursor) + delete m_pendingChunkCursor; + m_pendingChunkCursor = NULL; - if (m_unk0x3c) - delete m_unk0x3c; - m_unk0x3c = NULL; + if (m_consumedChunkCursor) + delete m_consumedChunkCursor; + m_consumedChunkCursor = NULL; } // FUNCTION: LEGO1 0x100b7ed0 @@ -40,12 +40,12 @@ MxResult MxDSSubscriber::Create(MxStreamController* p_controller, MxU32 p_object return FAILURE; m_controller = p_controller; - m_unk0x20 = new MxStreamChunkListCursor(&m_unk0x08); - if (!m_unk0x20) + m_pendingChunkCursor = new MxStreamChunkListCursor(&m_pendingChunks); + if (!m_pendingChunkCursor) return FAILURE; - m_unk0x3c = new MxStreamChunkListCursor(&m_unk0x24); - if (!m_unk0x3c) + m_consumedChunkCursor = new MxStreamChunkListCursor(&m_consumedChunks); + if (!m_consumedChunkCursor) return FAILURE; m_controller->AddSubscriber(this); @@ -58,13 +58,13 @@ void MxDSSubscriber::DeleteChunks() if (m_controller) { MxStreamChunk* chunk = NULL; - while (m_unk0x20->First(chunk)) { - m_unk0x20->Detach(); + while (m_pendingChunkCursor->First(chunk)) { + m_pendingChunkCursor->Detach(); delete chunk; } - while (m_unk0x3c->First(chunk)) { - m_unk0x3c->Detach(); + while (m_consumedChunkCursor->First(chunk)) { + m_consumedChunkCursor->Detach(); delete chunk; } } @@ -73,49 +73,49 @@ void MxDSSubscriber::DeleteChunks() // FUNCTION: LEGO1 0x100b8150 MxResult MxDSSubscriber::AddChunk(MxStreamChunk* p_chunk, MxBool p_append) { - if (m_unk0x20) { + if (m_pendingChunkCursor) { if (p_append) - m_unk0x08.Append(p_chunk); + m_pendingChunks.Append(p_chunk); else - m_unk0x08.Prepend(p_chunk); + m_pendingChunks.Prepend(p_chunk); } return SUCCESS; } // FUNCTION: LEGO1 0x100b8250 -MxStreamChunk* MxDSSubscriber::FUN_100b8250() +MxStreamChunk* MxDSSubscriber::NextChunk() { MxStreamChunk* chunk = NULL; - if (m_unk0x20) - m_unk0x20->First(chunk); + if (m_pendingChunkCursor) + m_pendingChunkCursor->First(chunk); if (chunk) { - m_unk0x20->Detach(); - m_unk0x24.Append(chunk); + m_pendingChunkCursor->Detach(); + m_consumedChunks.Append(chunk); } return chunk; } // FUNCTION: LEGO1 0x100b8360 -MxStreamChunk* MxDSSubscriber::FUN_100b8360() +MxStreamChunk* MxDSSubscriber::CurrentChunk() { MxStreamChunk* chunk = NULL; - if (m_unk0x20) - m_unk0x20->First(chunk); + if (m_pendingChunkCursor) + m_pendingChunkCursor->First(chunk); return chunk; } // FUNCTION: LEGO1 0x100b8390 -void MxDSSubscriber::FUN_100b8390(MxStreamChunk* p_chunk) +void MxDSSubscriber::DestroyChunk(MxStreamChunk* p_chunk) { if (p_chunk) { - if (m_unk0x3c->Find(p_chunk)) { - m_unk0x3c->Detach(); + if (m_consumedChunkCursor->Find(p_chunk)) { + m_consumedChunkCursor->Detach(); if (p_chunk) delete p_chunk; } diff --git a/LEGO1/omni/src/video/mxloopingflcpresenter.cpp b/LEGO1/omni/src/video/mxloopingflcpresenter.cpp index 152bd385..fdd991a9 100644 --- a/LEGO1/omni/src/video/mxloopingflcpresenter.cpp +++ b/LEGO1/omni/src/video/mxloopingflcpresenter.cpp @@ -46,9 +46,9 @@ void MxLoopingFlcPresenter::NextFrame() } else { LoadFrame(chunk); - AppendChunk(chunk); + LoopChunk(chunk); m_unk0x68 += m_flicHeader->speed; } - m_subscriber->FUN_100b8390(chunk); + m_subscriber->DestroyChunk(chunk); } diff --git a/LEGO1/omni/src/video/mxloopingsmkpresenter.cpp b/LEGO1/omni/src/video/mxloopingsmkpresenter.cpp index 8d0f4d00..efa758cd 100644 --- a/LEGO1/omni/src/video/mxloopingsmkpresenter.cpp +++ b/LEGO1/omni/src/video/mxloopingsmkpresenter.cpp @@ -57,11 +57,11 @@ void MxLoopingSmkPresenter::NextFrame() } else { LoadFrame(chunk); - AppendChunk(chunk); + LoopChunk(chunk); m_elapsedDuration += 1000 / ((MxDSMediaAction*) m_action)->GetFramesPerSecond(); } - m_subscriber->FUN_100b8390(chunk); + m_subscriber->DestroyChunk(chunk); } // FUNCTION: LEGO1 0x100b4a90 @@ -73,7 +73,7 @@ void MxLoopingSmkPresenter::VTable0x8c() } else { MxStreamChunk* chunk; - m_cursor->Current(chunk); + m_loopingChunkCursor->Current(chunk); LoadFrame(chunk); m_elapsedDuration += 1000 / ((MxDSMediaAction*) m_action)->GetFramesPerSecond(); } @@ -83,9 +83,9 @@ void MxLoopingSmkPresenter::VTable0x8c() void MxLoopingSmkPresenter::RepeatingTickle() { for (MxS16 i = 0; i < m_unk0x5c; i++) { - if (!m_cursor->HasMatch()) { + if (!m_loopingChunkCursor->HasMatch()) { MxStreamChunk* chunk; - MxStreamChunkListCursor cursor(m_chunks); + MxStreamChunkListCursor cursor(m_loopingChunks); cursor.Last(chunk); MxLong time = chunk->GetTime(); @@ -99,18 +99,18 @@ void MxLoopingSmkPresenter::RepeatingTickle() while (cursor.Next(chunk)) chunk->SetTime(chunk->GetTime() + time); - m_cursor->Next(); + m_loopingChunkCursor->Next(); } MxStreamChunk* chunk; - m_cursor->Current(chunk); + m_loopingChunkCursor->Current(chunk); if (m_action->GetElapsedTime() < chunk->GetTime()) break; VTable0x8c(); - m_cursor->Next(chunk); + m_loopingChunkCursor->Next(chunk); if (m_currentTickleState != TickleState_Repeating) break; diff --git a/LEGO1/omni/src/video/mxstillpresenter.cpp b/LEGO1/omni/src/video/mxstillpresenter.cpp index 8e81f498..20e6b3a2 100644 --- a/LEGO1/omni/src/video/mxstillpresenter.cpp +++ b/LEGO1/omni/src/video/mxstillpresenter.cpp @@ -63,7 +63,7 @@ void MxStillPresenter::NextFrame() { MxStreamChunk* chunk = NextChunk(); LoadFrame(chunk); - m_subscriber->FUN_100b8390(chunk); + m_subscriber->DestroyChunk(chunk); } // FUNCTION: LEGO1 0x100b9dd0 @@ -122,7 +122,7 @@ void MxStillPresenter::StartingTickle() // FUNCTION: LEGO1 0x100b9f90 void MxStillPresenter::StreamingTickle() { - MxStreamChunk* chunk = FUN_100b5650(); + MxStreamChunk* chunk = CurrentChunk(); if (chunk && m_action->GetElapsedTime() >= chunk->GetTime()) { m_chunkTime = chunk->GetTime(); diff --git a/LEGO1/omni/src/video/mxvideopresenter.cpp b/LEGO1/omni/src/video/mxvideopresenter.cpp index 5d507409..23c12cfb 100644 --- a/LEGO1/omni/src/video/mxvideopresenter.cpp +++ b/LEGO1/omni/src/video/mxvideopresenter.cpp @@ -241,13 +241,13 @@ void MxVideoPresenter::NextFrame() MxStreamChunk* chunk = NextChunk(); if (chunk->GetFlags() & MxDSChunk::Flag_End) { - m_subscriber->FUN_100b8390(chunk); + m_subscriber->DestroyChunk(chunk); m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState; m_currentTickleState = TickleState_Repeating; } else { LoadFrame(chunk); - m_subscriber->FUN_100b8390(chunk); + m_subscriber->DestroyChunk(chunk); } } @@ -458,7 +458,7 @@ void MxVideoPresenter::ReadyTickle() if (chunk) { LoadHeader(chunk); - m_subscriber->FUN_100b8390(chunk); + m_subscriber->DestroyChunk(chunk); ParseExtra(); m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState; m_currentTickleState = TickleState_Starting; @@ -468,7 +468,7 @@ void MxVideoPresenter::ReadyTickle() // FUNCTION: LEGO1 0x100b2fa0 void MxVideoPresenter::StartingTickle() { - MxStreamChunk* chunk = FUN_100b5650(); + MxStreamChunk* chunk = CurrentChunk(); if (chunk && m_action->GetElapsedTime() >= chunk->GetTime()) { CreateBitmap(); @@ -502,7 +502,7 @@ void MxVideoPresenter::StreamingTickle() break; LoadFrame(m_currentChunk); - m_subscriber->FUN_100b8390(m_currentChunk); + m_subscriber->DestroyChunk(m_currentChunk); m_currentChunk = NULL; m_flags |= Flag_Bit1;