From 0032108022dd05ff033ba9c114df6b5858d2321d Mon Sep 17 00:00:00 2001 From: Misha <106913236+MishaProductions@users.noreply.github.com> Date: Mon, 25 Dec 2023 20:00:56 -0500 Subject: [PATCH] rename functions --- LEGO1/mxdssubscriber.cpp | 4 ++-- LEGO1/mxstreamcontroller.cpp | 13 ++++++++----- LEGO1/mxstreamcontroller.h | 4 ++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/LEGO1/mxdssubscriber.cpp b/LEGO1/mxdssubscriber.cpp index b4fa97a0..33ee11fc 100644 --- a/LEGO1/mxdssubscriber.cpp +++ b/LEGO1/mxdssubscriber.cpp @@ -17,7 +17,7 @@ MxDSSubscriber::MxDSSubscriber() MxDSSubscriber::~MxDSSubscriber() { if (m_controller) - m_controller->FUN_100c1620(this); + m_controller->RemoveSubscriber(this); DeleteChunks(); @@ -48,7 +48,7 @@ MxResult MxDSSubscriber::Create(MxStreamController* p_controller, MxU32 p_object if (!m_unk0x3c) return FAILURE; - m_controller->FUN_100c15d0(this); + m_controller->AddSubscriber(this); return SUCCESS; } diff --git a/LEGO1/mxstreamcontroller.cpp b/LEGO1/mxstreamcontroller.cpp index 09869db6..ecd410c7 100644 --- a/LEGO1/mxstreamcontroller.cpp +++ b/LEGO1/mxstreamcontroller.cpp @@ -79,16 +79,19 @@ MxResult MxStreamController::Open(const char* p_filename) } // FUNCTION: LEGO1 0x100c15d0 -void MxStreamController::FUN_100c15d0(MxDSSubscriber* p_subscriber) +void MxStreamController::AddSubscriber(MxDSSubscriber* p_subscriber) { m_subscriberList.push_back(p_subscriber); } -// STUB: LEGO1 0x100c1620 -void MxStreamController::FUN_100c1620(MxDSSubscriber* p_subscriber) +// FUNCTION: LEGO1 0x100c1620 +void MxStreamController::RemoveSubscriber(MxDSSubscriber* p_subscriber) { - // TODO - OutputDebugString("MxStreamController::FUN_100c1620 STUB\n"); + for (MxStreamListMxDSSubscriber::iterator it = m_subscriberList.begin(); it != m_subscriberList.end(); it++) { + if (*it == p_subscriber) { + m_subscriberList.erase(it); + } + } } // FUNCTION: LEGO1 0x100c1690 diff --git a/LEGO1/mxstreamcontroller.h b/LEGO1/mxstreamcontroller.h index 8953de92..4dabe0e0 100644 --- a/LEGO1/mxstreamcontroller.h +++ b/LEGO1/mxstreamcontroller.h @@ -43,8 +43,8 @@ class MxStreamController : public MxCore { virtual MxResult VTable0x2c(MxDSAction* p_action, MxU32 p_bufferval); // vtable+0x2c virtual MxResult VTable0x30(MxDSAction* p_action); // vtable+0x30 - void FUN_100c15d0(MxDSSubscriber* p_subscriber); - void FUN_100c1620(MxDSSubscriber* p_subscriber); + void AddSubscriber(MxDSSubscriber* p_subscriber); + void RemoveSubscriber(MxDSSubscriber* p_subscriber); MxResult FUN_100c1800(MxDSAction* p_action, MxU32 p_val); MxResult FUN_100c1a00(MxDSAction* p_action, MxU32 p_offset); MxPresenter* FUN_100c1e70(MxDSAction& p_action);