From 1d189b013d86c198670ab8c15693b6202bcfb6c6 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Sat, 17 Feb 2024 10:35:10 -0500 Subject: [PATCH] Rename MxDSSubscriber functions (#573) --- .../src/audio/legoloadcachesoundpresenter.cpp | 2 +- .../src/common/legoactioncontrolpresenter.cpp | 2 +- .../legoomni/src/paths/legopathpresenter.cpp | 4 ++-- .../legoomni/src/video/legoanimpresenter.cpp | 12 ++++++------ .../legoomni/src/video/legomodelpresenter.cpp | 8 ++++---- .../legoomni/src/video/legopalettepresenter.cpp | 6 +++--- LEGO1/omni/include/mxdssubscriber.h | 10 +++++----- LEGO1/omni/src/audio/mxmidipresenter.cpp | 4 ++-- LEGO1/omni/src/audio/mxwavepresenter.cpp | 6 +++--- LEGO1/omni/src/common/mxmediapresenter.cpp | 16 ++++++++-------- LEGO1/omni/src/event/mxeventpresenter.cpp | 4 ++-- LEGO1/omni/src/stream/mxdssubscriber.cpp | 12 ++++++------ LEGO1/omni/src/stream/mxstreamchunk.cpp | 2 +- LEGO1/omni/src/video/mxloopingflcpresenter.cpp | 2 +- LEGO1/omni/src/video/mxloopingsmkpresenter.cpp | 2 +- LEGO1/omni/src/video/mxstillpresenter.cpp | 2 +- LEGO1/omni/src/video/mxvideopresenter.cpp | 8 ++++---- 17 files changed, 51 insertions(+), 51 deletions(-) diff --git a/LEGO1/lego/legoomni/src/audio/legoloadcachesoundpresenter.cpp b/LEGO1/lego/legoomni/src/audio/legoloadcachesoundpresenter.cpp index e9dec128..edcd6b34 100644 --- a/LEGO1/lego/legoomni/src/audio/legoloadcachesoundpresenter.cpp +++ b/LEGO1/lego/legoomni/src/audio/legoloadcachesoundpresenter.cpp @@ -49,7 +49,7 @@ void LegoLoadCacheSoundPresenter::ReadyTickle() m_cacheSound = new LegoCacheSound; memcpy(&m_pcmWaveFormat, &header->m_pcmWaveFormat, sizeof(m_pcmWaveFormat)); - m_subscriber->DestroyChunk(chunk); + m_subscriber->FreeDataChunk(chunk); ProgressTickleState(e_streaming); } } diff --git a/LEGO1/lego/legoomni/src/common/legoactioncontrolpresenter.cpp b/LEGO1/lego/legoomni/src/common/legoactioncontrolpresenter.cpp index 370b54c7..d4bf7cda 100644 --- a/LEGO1/lego/legoomni/src/common/legoactioncontrolpresenter.cpp +++ b/LEGO1/lego/legoomni/src/common/legoactioncontrolpresenter.cpp @@ -21,7 +21,7 @@ void LegoActionControlPresenter::ReadyTickle() ParseExtra(); ProgressTickleState(e_starting); - m_subscriber->DestroyChunk(chunk); + m_subscriber->FreeDataChunk(chunk); if (m_compositePresenter) { if (m_action->GetDuration() == -1 || m_action->GetFlags() & 1) { m_compositePresenter->VTable0x60(this); diff --git a/LEGO1/lego/legoomni/src/paths/legopathpresenter.cpp b/LEGO1/lego/legoomni/src/paths/legopathpresenter.cpp index f0ff859f..0b94b4eb 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathpresenter.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathpresenter.cpp @@ -69,14 +69,14 @@ void LegoPathPresenter::ReadyTickle() // FUNCTION: LEGO1 0x10044d00 void LegoPathPresenter::StreamingTickle() { - MxStreamChunk* chunk = m_subscriber->NextChunk(); + MxStreamChunk* chunk = m_subscriber->PopData(); if (chunk) { if (chunk->GetFlags() & MxStreamChunk::c_end) { ProgressTickleState(e_repeating); } - m_subscriber->DestroyChunk(chunk); + m_subscriber->FreeDataChunk(chunk); } } diff --git a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp index 68c664de..e8c7344c 100644 --- a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp @@ -105,12 +105,12 @@ void LegoAnimPresenter::ReadyTickle() m_currentWorld = CurrentWorld(); if (m_currentWorld) { - MxStreamChunk* chunk = m_subscriber->CurrentChunk(); + MxStreamChunk* chunk = m_subscriber->PeekData(); if (chunk && chunk->GetTime() + m_action->GetStartTime() <= m_action->GetElapsedTime()) { - chunk = m_subscriber->NextChunk(); + chunk = m_subscriber->PopData(); MxResult result = VTable0x88(chunk); - m_subscriber->DestroyChunk(chunk); + m_subscriber->FreeDataChunk(chunk); if (result == SUCCESS) { ProgressTickleState(e_starting); @@ -134,9 +134,9 @@ void LegoAnimPresenter::StartingTickle() // FUNCTION: LEGO1 0x1006b840 void LegoAnimPresenter::StreamingTickle() { - if (m_subscriber->CurrentChunk()) { - MxStreamChunk* chunk = m_subscriber->NextChunk(); - m_subscriber->DestroyChunk(chunk); + if (m_subscriber->PeekData()) { + MxStreamChunk* chunk = m_subscriber->PopData(); + m_subscriber->FreeDataChunk(chunk); } if (m_unk0x95) { diff --git a/LEGO1/lego/legoomni/src/video/legomodelpresenter.cpp b/LEGO1/lego/legoomni/src/video/legomodelpresenter.cpp index b0a9543a..ca2f1ead 100644 --- a/LEGO1/lego/legoomni/src/video/legomodelpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legomodelpresenter.cpp @@ -80,12 +80,12 @@ void LegoModelPresenter::ReadyTickle() EndAction(); } else { - MxStreamChunk* chunk = m_subscriber->CurrentChunk(); + MxStreamChunk* chunk = m_subscriber->PeekData(); if (chunk != NULL && chunk->GetTime() <= m_action->GetElapsedTime()) { - chunk = m_subscriber->NextChunk(); + chunk = m_subscriber->PopData(); MxResult result = CreateROI(chunk); - m_subscriber->DestroyChunk(chunk); + m_subscriber->FreeDataChunk(chunk); if (result == SUCCESS) { VideoManager()->Get3DManager()->GetLego3DView()->Add(*m_roi); @@ -135,7 +135,7 @@ void LegoModelPresenter::ParseExtra() list& roiList = currentWorld->GetUnknownList0xe0(); for (list::iterator it = roiList.begin(); it != roiList.end(); it++) { - if (!strcmpi(((LegoROI*) (*it))->GetName(), output)) { + if (!strcmpi((*it)->GetName(), output)) { m_roi = *it; roiList.erase(it); diff --git a/LEGO1/lego/legoomni/src/video/legopalettepresenter.cpp b/LEGO1/lego/legoomni/src/video/legopalettepresenter.cpp index 7fff790f..e6469cc6 100644 --- a/LEGO1/lego/legoomni/src/video/legopalettepresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legopalettepresenter.cpp @@ -73,15 +73,15 @@ MxResult LegoPalettePresenter::ParsePalette(MxStreamChunk* p_chunk) // FUNCTION: LEGO1 0x1007a230 void LegoPalettePresenter::ReadyTickle() { - MxStreamChunk* chunk = m_subscriber->CurrentChunk(); + MxStreamChunk* chunk = m_subscriber->PeekData(); if (chunk) { if (chunk->GetTime() <= m_action->GetElapsedTime()) { ParseExtra(); ProgressTickleState(e_starting); - chunk = m_subscriber->NextChunk(); + chunk = m_subscriber->PopData(); MxResult result = ParsePalette(chunk); - m_subscriber->DestroyChunk(chunk); + m_subscriber->FreeDataChunk(chunk); if (result == SUCCESS) { VideoManager()->RealizePalette(m_palette); diff --git a/LEGO1/omni/include/mxdssubscriber.h b/LEGO1/omni/include/mxdssubscriber.h index 4f8d0843..54cd203d 100644 --- a/LEGO1/omni/include/mxdssubscriber.h +++ b/LEGO1/omni/include/mxdssubscriber.h @@ -30,11 +30,11 @@ class MxDSSubscriber : public MxCore { } MxResult Create(MxStreamController* p_controller, MxU32 p_objectId, MxS16 p_unk0x48); - void DeleteChunks(); - MxResult AddChunk(MxStreamChunk* p_chunk, MxBool p_append); - MxStreamChunk* NextChunk(); - MxStreamChunk* CurrentChunk(); - void DestroyChunk(MxStreamChunk* p_chunk); + void DestroyData(); + MxResult AddData(MxStreamChunk* p_chunk, MxBool p_append); + MxStreamChunk* PopData(); + MxStreamChunk* PeekData(); + void FreeDataChunk(MxStreamChunk* p_chunk); inline MxU32 GetObjectId() { return m_objectId; } inline MxS16 GetUnknown48() { return m_unk0x48; } diff --git a/LEGO1/omni/src/audio/mxmidipresenter.cpp b/LEGO1/omni/src/audio/mxmidipresenter.cpp index b281ac64..91e5ba60 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->DestroyChunk(m_chunk); + m_subscriber->FreeDataChunk(m_chunk); } Init(); @@ -52,7 +52,7 @@ void MxMIDIPresenter::ReadyTickle() MxStreamChunk* chunk = NextChunk(); if (chunk) { - m_subscriber->DestroyChunk(chunk); + m_subscriber->FreeDataChunk(chunk); ParseExtra(); ProgressTickleState(e_starting); } diff --git a/LEGO1/omni/src/audio/mxwavepresenter.cpp b/LEGO1/omni/src/audio/mxwavepresenter.cpp index 853441a7..1ecf6021 100644 --- a/LEGO1/omni/src/audio/mxwavepresenter.cpp +++ b/LEGO1/omni/src/audio/mxwavepresenter.cpp @@ -119,7 +119,7 @@ void MxWavePresenter::ReadyTickle() if (chunk) { m_waveFormat = (WaveFormat*) new MxU8[chunk->GetLength()]; memcpy(m_waveFormat, chunk->GetData(), chunk->GetLength()); - m_subscriber->DestroyChunk(chunk); + m_subscriber->FreeDataChunk(chunk); ParseExtra(); ProgressTickleState(e_starting); } @@ -232,7 +232,7 @@ void MxWavePresenter::LoopChunk(MxStreamChunk* p_chunk) { WriteToSoundBuffer(p_chunk->GetData(), p_chunk->GetLength()); if (IsEnabled()) { - m_subscriber->DestroyChunk(p_chunk); + m_subscriber->FreeDataChunk(p_chunk); } } @@ -246,7 +246,7 @@ MxResult MxWavePresenter::PutData() case e_streaming: if (m_currentChunk && FUN_100b1ba0()) { WriteToSoundBuffer(m_currentChunk->GetData(), m_currentChunk->GetLength()); - m_subscriber->DestroyChunk(m_currentChunk); + m_subscriber->FreeDataChunk(m_currentChunk); m_currentChunk = NULL; } diff --git a/LEGO1/omni/src/common/mxmediapresenter.cpp b/LEGO1/omni/src/common/mxmediapresenter.cpp index 48450b58..b0a11c1b 100644 --- a/LEGO1/omni/src/common/mxmediapresenter.cpp +++ b/LEGO1/omni/src/common/mxmediapresenter.cpp @@ -27,7 +27,7 @@ void MxMediaPresenter::Destroy(MxBool p_fromDestructor) MxAutoLocker lock(&m_criticalSection); if (m_currentChunk && m_subscriber) { - m_subscriber->DestroyChunk(m_currentChunk); + m_subscriber->FreeDataChunk(m_currentChunk); } if (m_subscriber) { @@ -63,12 +63,12 @@ MxStreamChunk* MxMediaPresenter::CurrentChunk() MxStreamChunk* chunk = NULL; if (m_subscriber) { - chunk = m_subscriber->CurrentChunk(); + chunk = m_subscriber->PeekData(); if (chunk && chunk->GetFlags() & MxDSChunk::c_bit3) { m_action->SetFlags(m_action->GetFlags() | MxDSAction::c_bit7); - m_subscriber->NextChunk(); - m_subscriber->DestroyChunk(chunk); + m_subscriber->PopData(); + m_subscriber->FreeDataChunk(chunk); chunk = NULL; ProgressTickleState(e_done); } @@ -83,11 +83,11 @@ MxStreamChunk* MxMediaPresenter::NextChunk() MxStreamChunk* chunk = NULL; if (m_subscriber) { - chunk = m_subscriber->NextChunk(); + chunk = m_subscriber->PopData(); if (chunk && chunk->GetFlags() & MxDSChunk::c_bit3) { m_action->SetFlags(m_action->GetFlags() | MxDSAction::c_bit7); - m_subscriber->DestroyChunk(chunk); + m_subscriber->FreeDataChunk(chunk); chunk = NULL; ProgressTickleState(e_done); } @@ -186,7 +186,7 @@ void MxMediaPresenter::StreamingTickle() if (m_currentChunk) { if (m_currentChunk->GetFlags() & MxDSChunk::c_end) { - m_subscriber->DestroyChunk(m_currentChunk); + m_subscriber->FreeDataChunk(m_currentChunk); m_currentChunk = NULL; ProgressTickleState(e_repeating); } @@ -194,7 +194,7 @@ void MxMediaPresenter::StreamingTickle() LoopChunk(m_currentChunk); if (!IsEnabled()) { - m_subscriber->DestroyChunk(m_currentChunk); + m_subscriber->FreeDataChunk(m_currentChunk); m_currentChunk = NULL; } } diff --git a/LEGO1/omni/src/event/mxeventpresenter.cpp b/LEGO1/omni/src/event/mxeventpresenter.cpp index 6072bdd5..9652ca9a 100644 --- a/LEGO1/omni/src/event/mxeventpresenter.cpp +++ b/LEGO1/omni/src/event/mxeventpresenter.cpp @@ -71,7 +71,7 @@ void MxEventPresenter::ReadyTickle() if (chunk) { CopyData(chunk); - m_subscriber->DestroyChunk(chunk); + m_subscriber->FreeDataChunk(chunk); ParseExtra(); ProgressTickleState(e_starting); } @@ -107,7 +107,7 @@ MxResult MxEventPresenter::PutData() } if (m_currentTickleState == e_streaming) { - m_subscriber->DestroyChunk(m_currentChunk); + m_subscriber->FreeDataChunk(m_currentChunk); } m_currentChunk = NULL; } diff --git a/LEGO1/omni/src/stream/mxdssubscriber.cpp b/LEGO1/omni/src/stream/mxdssubscriber.cpp index 488ff02c..18832493 100644 --- a/LEGO1/omni/src/stream/mxdssubscriber.cpp +++ b/LEGO1/omni/src/stream/mxdssubscriber.cpp @@ -20,7 +20,7 @@ MxDSSubscriber::~MxDSSubscriber() m_controller->RemoveSubscriber(this); } - DeleteChunks(); + DestroyData(); if (m_pendingChunkCursor) { delete m_pendingChunkCursor; @@ -59,7 +59,7 @@ MxResult MxDSSubscriber::Create(MxStreamController* p_controller, MxU32 p_object } // FUNCTION: LEGO1 0x100b8030 -void MxDSSubscriber::DeleteChunks() +void MxDSSubscriber::DestroyData() { if (m_controller) { MxStreamChunk* chunk = NULL; @@ -77,7 +77,7 @@ void MxDSSubscriber::DeleteChunks() } // FUNCTION: LEGO1 0x100b8150 -MxResult MxDSSubscriber::AddChunk(MxStreamChunk* p_chunk, MxBool p_append) +MxResult MxDSSubscriber::AddData(MxStreamChunk* p_chunk, MxBool p_append) { if (m_pendingChunkCursor) { if (p_append) { @@ -92,7 +92,7 @@ MxResult MxDSSubscriber::AddChunk(MxStreamChunk* p_chunk, MxBool p_append) } // FUNCTION: LEGO1 0x100b8250 -MxStreamChunk* MxDSSubscriber::NextChunk() +MxStreamChunk* MxDSSubscriber::PopData() { MxStreamChunk* chunk = NULL; @@ -109,7 +109,7 @@ MxStreamChunk* MxDSSubscriber::NextChunk() } // FUNCTION: LEGO1 0x100b8360 -MxStreamChunk* MxDSSubscriber::CurrentChunk() +MxStreamChunk* MxDSSubscriber::PeekData() { MxStreamChunk* chunk = NULL; @@ -121,7 +121,7 @@ MxStreamChunk* MxDSSubscriber::CurrentChunk() } // FUNCTION: LEGO1 0x100b8390 -void MxDSSubscriber::DestroyChunk(MxStreamChunk* p_chunk) +void MxDSSubscriber::FreeDataChunk(MxStreamChunk* p_chunk) { if (p_chunk) { if (m_consumedChunkCursor->Find(p_chunk)) { diff --git a/LEGO1/omni/src/stream/mxstreamchunk.cpp b/LEGO1/omni/src/stream/mxstreamchunk.cpp index ba833186..9d30e70d 100644 --- a/LEGO1/omni/src/stream/mxstreamchunk.cpp +++ b/LEGO1/omni/src/stream/mxstreamchunk.cpp @@ -59,7 +59,7 @@ MxResult MxStreamChunk::SendChunk(MxStreamListMxDSSubscriber& p_subscriberList, m_buffer = NULL; } - (*it)->AddChunk(this, p_append); + (*it)->AddData(this, p_append); return SUCCESS; } diff --git a/LEGO1/omni/src/video/mxloopingflcpresenter.cpp b/LEGO1/omni/src/video/mxloopingflcpresenter.cpp index 6d70842c..257e5a81 100644 --- a/LEGO1/omni/src/video/mxloopingflcpresenter.cpp +++ b/LEGO1/omni/src/video/mxloopingflcpresenter.cpp @@ -50,7 +50,7 @@ void MxLoopingFlcPresenter::NextFrame() m_elapsedDuration += m_flcHeader->speed; } - m_subscriber->DestroyChunk(chunk); + m_subscriber->FreeDataChunk(chunk); } // FUNCTION: LEGO1 0x100b44c0 diff --git a/LEGO1/omni/src/video/mxloopingsmkpresenter.cpp b/LEGO1/omni/src/video/mxloopingsmkpresenter.cpp index 2f4a5087..9229afee 100644 --- a/LEGO1/omni/src/video/mxloopingsmkpresenter.cpp +++ b/LEGO1/omni/src/video/mxloopingsmkpresenter.cpp @@ -61,7 +61,7 @@ void MxLoopingSmkPresenter::NextFrame() m_elapsedDuration += 1000 / ((MxDSMediaAction*) m_action)->GetFramesPerSecond(); } - m_subscriber->DestroyChunk(chunk); + m_subscriber->FreeDataChunk(chunk); } // FUNCTION: LEGO1 0x100b4a90 diff --git a/LEGO1/omni/src/video/mxstillpresenter.cpp b/LEGO1/omni/src/video/mxstillpresenter.cpp index ca749578..e36297c6 100644 --- a/LEGO1/omni/src/video/mxstillpresenter.cpp +++ b/LEGO1/omni/src/video/mxstillpresenter.cpp @@ -62,7 +62,7 @@ void MxStillPresenter::NextFrame() { MxStreamChunk* chunk = NextChunk(); LoadFrame(chunk); - m_subscriber->DestroyChunk(chunk); + m_subscriber->FreeDataChunk(chunk); } // FUNCTION: LEGO1 0x100b9dd0 diff --git a/LEGO1/omni/src/video/mxvideopresenter.cpp b/LEGO1/omni/src/video/mxvideopresenter.cpp index dcccf8f6..36fad6d0 100644 --- a/LEGO1/omni/src/video/mxvideopresenter.cpp +++ b/LEGO1/omni/src/video/mxvideopresenter.cpp @@ -178,12 +178,12 @@ void MxVideoPresenter::NextFrame() MxStreamChunk* chunk = NextChunk(); if (chunk->GetFlags() & MxDSChunk::c_end) { - m_subscriber->DestroyChunk(chunk); + m_subscriber->FreeDataChunk(chunk); ProgressTickleState(e_repeating); } else { LoadFrame(chunk); - m_subscriber->DestroyChunk(chunk); + m_subscriber->FreeDataChunk(chunk); } } @@ -408,7 +408,7 @@ void MxVideoPresenter::ReadyTickle() if (chunk) { LoadHeader(chunk); - m_subscriber->DestroyChunk(chunk); + m_subscriber->FreeDataChunk(chunk); ParseExtra(); ProgressTickleState(e_starting); } @@ -453,7 +453,7 @@ void MxVideoPresenter::StreamingTickle() } LoadFrame(m_currentChunk); - m_subscriber->DestroyChunk(m_currentChunk); + m_subscriber->FreeDataChunk(m_currentChunk); m_currentChunk = NULL; SetBit0(TRUE);