From e3d7188ec99307054aa5ac5ffcaac96d8cc4cc11 Mon Sep 17 00:00:00 2001 From: MS Date: Tue, 12 Mar 2024 10:23:50 -0400 Subject: [PATCH] Use AUTOLOCK macro (#660) * Use AUTOLOCK macro * MxAutoLock * Remove semicolon Co-authored-by: Anonymous Maarten --------- Co-authored-by: Anonymous Maarten --- CMakeLists.txt | 2 +- .../legoomni/src/audio/legosoundmanager.cpp | 4 +-- .../src/common/mxcompositemediapresenter.cpp | 10 +++--- .../src/entity/legoworldpresenter.cpp | 4 +-- .../legoomni/src/input/legoinputmanager.cpp | 8 ++--- LEGO1/lego/legoomni/src/main/legoomni.cpp | 6 ++-- .../legoomni/src/paths/legopathpresenter.cpp | 4 +-- LEGO1/omni/include/mxautolock.h | 17 ++++++++++ LEGO1/omni/include/mxautolocker.h | 15 -------- LEGO1/omni/include/mxomni.h | 2 +- LEGO1/omni/src/audio/mxmidipresenter.cpp | 4 +-- LEGO1/omni/src/audio/mxsoundmanager.cpp | 8 ++--- LEGO1/omni/src/audio/mxwavepresenter.cpp | 6 ++-- .../omni/src/common/mxcompositepresenter.cpp | 8 ++--- LEGO1/omni/src/common/mxmediamanager.cpp | 14 ++++---- LEGO1/omni/src/common/mxmediapresenter.cpp | 10 +++--- LEGO1/omni/src/common/mxpresenter.cpp | 12 +++---- LEGO1/omni/src/event/mxeventpresenter.cpp | 4 +-- LEGO1/omni/src/main/mxomni.cpp | 4 +-- .../omni/src/notify/mxnotificationmanager.cpp | 14 ++++---- .../src/stream/mxdiskstreamcontroller.cpp | 34 +++++++++---------- .../omni/src/stream/mxdiskstreamprovider.cpp | 14 ++++---- .../omni/src/stream/mxramstreamcontroller.cpp | 8 ++--- LEGO1/omni/src/stream/mxstreamcontroller.cpp | 20 +++++------ .../{mxautolocker.cpp => mxautolock.cpp} | 6 ++-- .../omni/src/video/mxloopingsmkpresenter.cpp | 4 +-- LEGO1/omni/src/video/mxvideomanager.cpp | 4 +-- LEGO1/omni/src/video/mxvideopresenter.cpp | 6 ++-- 28 files changed, 127 insertions(+), 125 deletions(-) create mode 100644 LEGO1/omni/include/mxautolock.h delete mode 100644 LEGO1/omni/include/mxautolocker.h rename LEGO1/omni/src/system/{mxautolocker.cpp => mxautolock.cpp} (68%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 806e56ce..c1b52a8d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -249,7 +249,7 @@ add_library(omni STATIC LEGO1/omni/src/stream/mxstreamer.cpp LEGO1/omni/src/stream/mxstreamlist.cpp LEGO1/omni/src/stream/mxstreamprovider.cpp - LEGO1/omni/src/system/mxautolocker.cpp + LEGO1/omni/src/system/mxautolock.cpp LEGO1/omni/src/system/mxcriticalsection.cpp LEGO1/omni/src/system/mxscheduler.cpp LEGO1/omni/src/system/mxsemaphore.cpp diff --git a/LEGO1/lego/legoomni/src/audio/legosoundmanager.cpp b/LEGO1/lego/legoomni/src/audio/legosoundmanager.cpp index e4fee977..f3476e8e 100644 --- a/LEGO1/lego/legoomni/src/audio/legosoundmanager.cpp +++ b/LEGO1/lego/legoomni/src/audio/legosoundmanager.cpp @@ -1,6 +1,6 @@ #include "legosoundmanager.h" -#include "mxautolocker.h" +#include "mxautolock.h" #include "mxomni.h" // FUNCTION: LEGO1 0x100298a0 @@ -90,6 +90,6 @@ MxResult LegoSoundManager::Tickle() { MxSoundManager::Tickle(); - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); return m_unk0x40->Tickle(); } diff --git a/LEGO1/lego/legoomni/src/common/mxcompositemediapresenter.cpp b/LEGO1/lego/legoomni/src/common/mxcompositemediapresenter.cpp index 3f92a8ce..8f074ffa 100644 --- a/LEGO1/lego/legoomni/src/common/mxcompositemediapresenter.cpp +++ b/LEGO1/lego/legoomni/src/common/mxcompositemediapresenter.cpp @@ -3,7 +3,7 @@ #include "legosoundmanager.h" #include "legovideomanager.h" #include "misc.h" -#include "mxautolocker.h" +#include "mxautolock.h" #include "mxdsmultiaction.h" #include "mxmediapresenter.h" #include "mxmisc.h" @@ -29,7 +29,7 @@ MxCompositeMediaPresenter::~MxCompositeMediaPresenter() // FUNCTION: LEGO1 0x10074090 MxResult MxCompositeMediaPresenter::StartAction(MxStreamController* p_controller, MxDSAction* p_action) { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); MxResult result = FAILURE; MxDSActionList* actions = ((MxDSMultiAction*) p_action)->GetActionList(); @@ -96,7 +96,7 @@ MxResult MxCompositeMediaPresenter::StartAction(MxStreamController* p_controller // FUNCTION: LEGO1 0x100742e0 void MxCompositeMediaPresenter::StartingTickle() { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); if (!m_unk0x4e) { for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) { @@ -142,7 +142,7 @@ void MxCompositeMediaPresenter::StartingTickle() // FUNCTION: LEGO1 0x10074470 MxResult MxCompositeMediaPresenter::Tickle() { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); switch (m_currentTickleState) { case e_ready: @@ -169,7 +169,7 @@ MxResult MxCompositeMediaPresenter::Tickle() // FUNCTION: LEGO1 0x10074540 MxResult MxCompositeMediaPresenter::PutData() { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); if (m_currentTickleState >= e_streaming && m_currentTickleState <= e_done) { for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) { diff --git a/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp b/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp index 756e32f9..76253d89 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp @@ -15,7 +15,7 @@ #include "misc.h" #include "modeldb/modeldb.h" #include "mxactionnotificationparam.h" -#include "mxautolocker.h" +#include "mxautolock.h" #include "mxdsactionlist.h" #include "mxdschunk.h" #include "mxdsmediaaction.h" @@ -78,7 +78,7 @@ LegoWorldPresenter::~LegoWorldPresenter() // FUNCTION: LEGO1 0x10066870 MxResult LegoWorldPresenter::StartAction(MxStreamController* p_controller, MxDSAction* p_action) { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); MxResult result = FAILURE; MxDSActionList* actions = ((MxDSMultiAction*) p_action)->GetActionList(); diff --git a/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp b/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp index 950a19f9..61f6c815 100644 --- a/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp +++ b/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp @@ -4,7 +4,7 @@ #include "legoomni.h" #include "legovideomanager.h" #include "misc.h" -#include "mxautolocker.h" +#include "mxautolock.h" #include "roi/legoroi.h" DECOMP_SIZE_ASSERT(LegoInputManager, 0x338) @@ -224,7 +224,7 @@ MxResult LegoInputManager::GetJoystickState( // FUNCTION: LEGO1 0x1005c470 void LegoInputManager::Register(MxCore* p_notify) { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); LegoNotifyListCursor cursor(m_keyboardNotifyList); if (!cursor.Find(p_notify)) { @@ -235,7 +235,7 @@ void LegoInputManager::Register(MxCore* p_notify) // FUNCTION: LEGO1 0x1005c5c0 void LegoInputManager::UnRegister(MxCore* p_notify) { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); LegoNotifyListCursor cursor(m_keyboardNotifyList); if (cursor.Find(p_notify)) { @@ -281,7 +281,7 @@ void LegoInputManager::QueueEvent(NotificationId p_id, MxU8 p_modifier, MxLong p // FUNCTION: LEGO1 0x1005c820 void LegoInputManager::ProcessEvents() { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); LegoEventNotificationParam event; while (m_eventQueue->Dequeue(event)) { diff --git a/LEGO1/lego/legoomni/src/main/legoomni.cpp b/LEGO1/lego/legoomni/src/main/legoomni.cpp index cb1f5b05..32b40120 100644 --- a/LEGO1/lego/legoomni/src/main/legoomni.cpp +++ b/LEGO1/lego/legoomni/src/main/legoomni.cpp @@ -16,7 +16,7 @@ #include "misc.h" #include "misc/legocontainer.h" #include "mxactionnotificationparam.h" -#include "mxautolocker.h" +#include "mxautolock.h" #include "mxbackgroundaudiomanager.h" #include "mxdsfile.h" #include "mxmisc.h" @@ -309,7 +309,7 @@ void LegoOmni::Init() // FUNCTION: LEGO1 0x10058c30 void LegoOmni::Destroy() { - MxAutoLocker lock(&this->m_criticalsection); + AUTOLOCK(m_criticalSection); m_notificationManager->Unregister(this); @@ -389,7 +389,7 @@ void LegoOmni::Destroy() MxResult LegoOmni::Create(MxOmniCreateParam& p_param) { MxResult result = FAILURE; - MxAutoLocker lock(&this->m_criticalsection); + AUTOLOCK(m_criticalSection); p_param.CreateFlags().CreateObjectFactory(FALSE); p_param.CreateFlags().CreateVideoManager(FALSE); diff --git a/LEGO1/lego/legoomni/src/paths/legopathpresenter.cpp b/LEGO1/lego/legoomni/src/paths/legopathpresenter.cpp index 25390c48..db02e525 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathpresenter.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathpresenter.cpp @@ -2,7 +2,7 @@ #include "legovideomanager.h" #include "misc.h" -#include "mxautolocker.h" +#include "mxautolock.h" DECOMP_SIZE_ASSERT(LegoPathPresenter, 0x54); @@ -44,7 +44,7 @@ void LegoPathPresenter::Destroy(MxBool p_fromDestructor) } { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); Init(); } diff --git a/LEGO1/omni/include/mxautolock.h b/LEGO1/omni/include/mxautolock.h new file mode 100644 index 00000000..1488cd4e --- /dev/null +++ b/LEGO1/omni/include/mxautolock.h @@ -0,0 +1,17 @@ +#ifndef MXAUTOLOCK_H +#define MXAUTOLOCK_H + +#include "mxcriticalsection.h" + +#define AUTOLOCK(CS) MxAutoLock lock(&CS) + +class MxAutoLock { +public: + MxAutoLock(MxCriticalSection* p_criticalSection); + ~MxAutoLock(); + +private: + MxCriticalSection* m_criticalSection; +}; + +#endif // MXAUTOLOCK_H diff --git a/LEGO1/omni/include/mxautolocker.h b/LEGO1/omni/include/mxautolocker.h deleted file mode 100644 index e5838486..00000000 --- a/LEGO1/omni/include/mxautolocker.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef MXAUTOLOCKER_H -#define MXAUTOLOCKER_H - -#include "mxcriticalsection.h" - -class MxAutoLocker { -public: - MxAutoLocker(MxCriticalSection* p_criticalSection); - ~MxAutoLocker(); - -private: - MxCriticalSection* m_criticalSection; -}; - -#endif // MXAUTOLOCKER_H diff --git a/LEGO1/omni/include/mxomni.h b/LEGO1/omni/include/mxomni.h index 8cefb099..26bb4dfc 100644 --- a/LEGO1/omni/include/mxomni.h +++ b/LEGO1/omni/include/mxomni.h @@ -91,7 +91,7 @@ class MxOmni : public MxCore { MxTimer* m_timer; // 0x3c MxStreamer* m_streamer; // 0x40 MxAtomIdCounterSet* m_atomIdCounterSet; // 0x44 - MxCriticalSection m_criticalsection; // 0x48 + MxCriticalSection m_criticalSection; // 0x48 MxBool m_timerRunning; // 0x64 }; diff --git a/LEGO1/omni/src/audio/mxmidipresenter.cpp b/LEGO1/omni/src/audio/mxmidipresenter.cpp index 361481fc..205b760d 100644 --- a/LEGO1/omni/src/audio/mxmidipresenter.cpp +++ b/LEGO1/omni/src/audio/mxmidipresenter.cpp @@ -1,7 +1,7 @@ #include "mxmidipresenter.h" #include "decomp.h" -#include "mxautolocker.h" +#include "mxautolock.h" #include "mxdssound.h" #include "mxmisc.h" #include "mxmusicmanager.h" @@ -115,7 +115,7 @@ MxResult MxMIDIPresenter::PutData() void MxMIDIPresenter::EndAction() { if (m_action) { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); MxMediaPresenter::EndAction(); MusicManager()->DeinitializeMIDI(); diff --git a/LEGO1/omni/src/audio/mxsoundmanager.cpp b/LEGO1/omni/src/audio/mxsoundmanager.cpp index 05514898..0d9359e6 100644 --- a/LEGO1/omni/src/audio/mxsoundmanager.cpp +++ b/LEGO1/omni/src/audio/mxsoundmanager.cpp @@ -1,7 +1,7 @@ #include "mxsoundmanager.h" #include "define.h" -#include "mxautolocker.h" +#include "mxautolock.h" #include "mxmisc.h" #include "mxomni.h" #include "mxpresenter.h" @@ -168,7 +168,7 @@ void MxSoundManager::SetVolume(MxS32 p_volume) // FUNCTION: LEGO1 0x100aebd0 MxPresenter* MxSoundManager::FUN_100aebd0(const MxAtomId& p_atomId, MxU32 p_objectId) { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); MxPresenter* presenter; MxPresenterListCursor cursor(m_presenters); @@ -195,7 +195,7 @@ MxS32 MxSoundManager::FUN_100aecf0(MxU32 p_undefined) // FUNCTION: LEGO1 0x100aed10 void MxSoundManager::Pause() { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); MxPresenter* presenter; MxPresenterListCursor cursor(m_presenters); @@ -210,7 +210,7 @@ void MxSoundManager::Pause() // FUNCTION: LEGO1 0x100aee10 void MxSoundManager::Resume() { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); MxPresenter* presenter; MxPresenterListCursor cursor(m_presenters); diff --git a/LEGO1/omni/src/audio/mxwavepresenter.cpp b/LEGO1/omni/src/audio/mxwavepresenter.cpp index af32e4dd..bd02bf8d 100644 --- a/LEGO1/omni/src/audio/mxwavepresenter.cpp +++ b/LEGO1/omni/src/audio/mxwavepresenter.cpp @@ -2,7 +2,7 @@ #include "decomp.h" #include "define.h" -#include "mxautolocker.h" +#include "mxautolock.h" #include "mxdssound.h" #include "mxmisc.h" #include "mxomni.h" @@ -241,7 +241,7 @@ void MxWavePresenter::LoopChunk(MxStreamChunk* p_chunk) // FUNCTION: LEGO1 0x100b2160 MxResult MxWavePresenter::PutData() { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); if (IsEnabled()) { switch (m_currentTickleState) { @@ -280,7 +280,7 @@ MxResult MxWavePresenter::PutData() void MxWavePresenter::EndAction() { if (m_action) { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); MxMediaPresenter::EndAction(); if (m_dsBuffer) { diff --git a/LEGO1/omni/src/common/mxcompositepresenter.cpp b/LEGO1/omni/src/common/mxcompositepresenter.cpp index 043af4ea..5d5d8c6f 100644 --- a/LEGO1/omni/src/common/mxcompositepresenter.cpp +++ b/LEGO1/omni/src/common/mxcompositepresenter.cpp @@ -1,7 +1,7 @@ #include "mxcompositepresenter.h" #include "decomp.h" -#include "mxautolocker.h" +#include "mxautolock.h" #include "mxdsmultiaction.h" #include "mxmisc.h" #include "mxnotificationmanager.h" @@ -24,7 +24,7 @@ MxCompositePresenter::~MxCompositePresenter() // FUNCTION: LEGO1 0x100b6410 MxResult MxCompositePresenter::StartAction(MxStreamController* p_controller, MxDSAction* p_action) { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); MxResult result = FAILURE; MxDSActionList* actions = ((MxDSMultiAction*) p_action)->GetActionList(); @@ -77,7 +77,7 @@ MxResult MxCompositePresenter::StartAction(MxStreamController* p_controller, MxD // FUNCTION: LEGO1 0x100b65e0 void MxCompositePresenter::EndAction() { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); if (!m_action) { return; @@ -113,7 +113,7 @@ void MxCompositePresenter::EndAction() // FUNCTION: LEGO1 0x100b6760 MxLong MxCompositePresenter::Notify(MxParam& p_param) { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); switch (((MxNotificationParam&) p_param).GetNotification()) { case c_notificationEndAction: diff --git a/LEGO1/omni/src/common/mxmediamanager.cpp b/LEGO1/omni/src/common/mxmediamanager.cpp index 6a9d99c5..bd32c70b 100644 --- a/LEGO1/omni/src/common/mxmediamanager.cpp +++ b/LEGO1/omni/src/common/mxmediamanager.cpp @@ -1,7 +1,7 @@ #include "mxmediamanager.h" #include "decomp.h" -#include "mxautolocker.h" +#include "mxautolock.h" #include "mxomni.h" #include "mxpresenter.h" #include "mxticklemanager.h" @@ -33,7 +33,7 @@ MxResult MxMediaManager::Init() // FUNCTION: LEGO1 0x100b85e0 MxResult MxMediaManager::InitPresenters() { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); this->m_presenters = new MxPresenterList; @@ -48,7 +48,7 @@ MxResult MxMediaManager::InitPresenters() // FUNCTION: LEGO1 0x100b8710 void MxMediaManager::Destroy() { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); if (this->m_presenters) { delete this->m_presenters; @@ -60,7 +60,7 @@ void MxMediaManager::Destroy() // FUNCTION: LEGO1 0x100b8790 MxResult MxMediaManager::Tickle() { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); MxPresenter* presenter; MxPresenterListCursor cursor(this->m_presenters); @@ -80,7 +80,7 @@ MxResult MxMediaManager::Tickle() // FUNCTION: LEGO1 0x100b88c0 void MxMediaManager::RegisterPresenter(MxPresenter& p_presenter) { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); this->m_presenters->Append(&p_presenter); } @@ -88,7 +88,7 @@ void MxMediaManager::RegisterPresenter(MxPresenter& p_presenter) // FUNCTION: LEGO1 0x100b8980 void MxMediaManager::UnregisterPresenter(MxPresenter& p_presenter) { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); MxPresenterListCursor cursor(this->m_presenters); if (cursor.Find(&p_presenter)) { @@ -99,7 +99,7 @@ void MxMediaManager::UnregisterPresenter(MxPresenter& p_presenter) // FUNCTION: LEGO1 0x100b8ac0 void MxMediaManager::StopPresenters() { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); MxPresenter* presenter; MxPresenterListCursor cursor(this->m_presenters); diff --git a/LEGO1/omni/src/common/mxmediapresenter.cpp b/LEGO1/omni/src/common/mxmediapresenter.cpp index 5f162c71..fe43cca7 100644 --- a/LEGO1/omni/src/common/mxmediapresenter.cpp +++ b/LEGO1/omni/src/common/mxmediapresenter.cpp @@ -1,7 +1,7 @@ #include "mxmediapresenter.h" #include "mxactionnotificationparam.h" -#include "mxautolocker.h" +#include "mxautolock.h" #include "mxcompositepresenter.h" #include "mxmisc.h" #include "mxnotificationmanager.h" @@ -25,7 +25,7 @@ void MxMediaPresenter::Init() void MxMediaPresenter::Destroy(MxBool p_fromDestructor) { { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); if (m_currentChunk && m_subscriber) { m_subscriber->FreeDataChunk(m_currentChunk); @@ -101,7 +101,7 @@ MxStreamChunk* MxMediaPresenter::NextChunk() MxResult MxMediaPresenter::StartAction(MxStreamController* p_controller, MxDSAction* p_action) { MxResult result = FAILURE; - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); if (MxPresenter::StartAction(p_controller, p_action) == SUCCESS) { if (m_action->GetFlags() & MxDSAction::c_looping) { @@ -132,7 +132,7 @@ MxResult MxMediaPresenter::StartAction(MxStreamController* p_controller, MxDSAct // FUNCTION: LEGO1 0x100b5bc0 void MxMediaPresenter::EndAction() { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); if (!m_action) { return; @@ -172,7 +172,7 @@ void MxMediaPresenter::EndAction() // FUNCTION: LEGO1 0x100b5d10 MxResult MxMediaPresenter::Tickle() { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); CurrentChunk(); diff --git a/LEGO1/omni/src/common/mxpresenter.cpp b/LEGO1/omni/src/common/mxpresenter.cpp index 1c81764e..76cbd880 100644 --- a/LEGO1/omni/src/common/mxpresenter.cpp +++ b/LEGO1/omni/src/common/mxpresenter.cpp @@ -3,7 +3,7 @@ #include "decomp.h" #include "define.h" #include "mxactionnotificationparam.h" -#include "mxautolocker.h" +#include "mxautolock.h" #include "mxcompositepresenter.h" #include "mxdsanim.h" #include "mxdssound.h" @@ -34,7 +34,7 @@ void MxPresenter::Init() // FUNCTION: LEGO1 0x100b4d80 MxResult MxPresenter::StartAction(MxStreamController*, MxDSAction* p_action) { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); this->m_action = p_action; @@ -55,7 +55,7 @@ void MxPresenter::EndAction() return; } - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); if (!this->m_compositePresenter) { #ifdef COMPAT_MODE @@ -79,7 +79,7 @@ void MxPresenter::EndAction() // FUNCTION: LEGO1 0x100b4fc0 void MxPresenter::ParseExtra() { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); MxU16 extraLength; char* extraData; @@ -113,7 +113,7 @@ void MxPresenter::ParseExtra() void MxPresenter::SendToCompositePresenter(MxOmni* p_omni) { if (m_compositePresenter) { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); #ifdef COMPAT_MODE { @@ -132,7 +132,7 @@ void MxPresenter::SendToCompositePresenter(MxOmni* p_omni) // FUNCTION: LEGO1 0x100b5200 MxResult MxPresenter::Tickle() { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); switch (this->m_currentTickleState) { case e_ready: diff --git a/LEGO1/omni/src/event/mxeventpresenter.cpp b/LEGO1/omni/src/event/mxeventpresenter.cpp index 90d5ceee..70a3c6af 100644 --- a/LEGO1/omni/src/event/mxeventpresenter.cpp +++ b/LEGO1/omni/src/event/mxeventpresenter.cpp @@ -1,7 +1,7 @@ #include "mxeventpresenter.h" #include "decomp.h" -#include "mxautolocker.h" +#include "mxautolock.h" #include "mxeventmanager.h" #include "mxmisc.h" #include "mxvariabletable.h" @@ -90,7 +90,7 @@ void MxEventPresenter::StartingTickle() // FUNCTION: LEGO1 0x100c2ef0 MxResult MxEventPresenter::PutData() { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); if (IsEnabled()) { if (m_currentTickleState >= e_streaming && diff --git a/LEGO1/omni/src/main/mxomni.cpp b/LEGO1/omni/src/main/mxomni.cpp index b85efed6..70bb751c 100644 --- a/LEGO1/omni/src/main/mxomni.cpp +++ b/LEGO1/omni/src/main/mxomni.cpp @@ -2,7 +2,7 @@ #include "mxactionnotificationparam.h" #include "mxatom.h" -#include "mxautolocker.h" +#include "mxautolock.h" #include "mxdsmultiaction.h" #include "mxeventmanager.h" #include "mxmisc.h" @@ -338,7 +338,7 @@ MxBool MxOmni::ActionSourceEquals(MxDSAction* p_action, const char* p_name) // FUNCTION: LEGO1 0x100b07f0 MxLong MxOmni::Notify(MxParam& p_param) { - MxAutoLocker lock(&this->m_criticalsection); + AUTOLOCK(m_criticalSection); if (((MxNotificationParam&) p_param).GetNotification() != c_notificationEndAction) { return 0; diff --git a/LEGO1/omni/src/notify/mxnotificationmanager.cpp b/LEGO1/omni/src/notify/mxnotificationmanager.cpp index 48429dfc..21907d2c 100644 --- a/LEGO1/omni/src/notify/mxnotificationmanager.cpp +++ b/LEGO1/omni/src/notify/mxnotificationmanager.cpp @@ -2,7 +2,7 @@ #include "compat.h" #include "decomp.h" -#include "mxautolocker.h" +#include "mxautolock.h" #include "mxmisc.h" #include "mxparam.h" #include "mxticklemanager.h" @@ -36,7 +36,7 @@ MxNotificationManager::MxNotificationManager() : MxCore(), m_lock(), m_listenerI // FUNCTION: LEGO1 0x100ac450 MxNotificationManager::~MxNotificationManager() { - MxAutoLocker lock(&m_lock); + AUTOLOCK(m_lock); Tickle(); delete m_queue; m_queue = NULL; @@ -63,7 +63,7 @@ MxResult MxNotificationManager::Create(MxU32 p_frequencyMS, MxBool p_createThrea // FUNCTION: LEGO1 0x100ac6c0 MxResult MxNotificationManager::Send(MxCore* p_listener, MxNotificationParam* p_param) { - MxAutoLocker lock(&m_lock); + AUTOLOCK(m_lock); if (m_active == FALSE) { return FAILURE; @@ -94,7 +94,7 @@ MxResult MxNotificationManager::Tickle() } else { { - MxAutoLocker lock(&m_lock); + AUTOLOCK(m_lock); MxNotificationPtrList* temp1 = m_queue; MxNotificationPtrList* temp2 = m_sendList; m_queue = temp2; @@ -121,7 +121,7 @@ void MxNotificationManager::FlushPending(MxCore* p_listener) MxNotification* notif; { - MxAutoLocker lock(&m_lock); + AUTOLOCK(m_lock); // Find all notifications from, and addressed to, p_listener. if (m_sendList != NULL) { @@ -166,7 +166,7 @@ void MxNotificationManager::FlushPending(MxCore* p_listener) // FUNCTION: LEGO1 0x100acd20 void MxNotificationManager::Register(MxCore* p_listener) { - MxAutoLocker lock(&m_lock); + AUTOLOCK(m_lock); MxIdList::iterator it = find(m_listenerIds.begin(), m_listenerIds.end(), p_listener->GetId()); if (it != m_listenerIds.end()) { @@ -179,7 +179,7 @@ void MxNotificationManager::Register(MxCore* p_listener) // FUNCTION: LEGO1 0x100acdf0 void MxNotificationManager::Unregister(MxCore* p_listener) { - MxAutoLocker lock(&m_lock); + AUTOLOCK(m_lock); MxIdList::iterator it = find(m_listenerIds.begin(), m_listenerIds.end(), p_listener->GetId()); diff --git a/LEGO1/omni/src/stream/mxdiskstreamcontroller.cpp b/LEGO1/omni/src/stream/mxdiskstreamcontroller.cpp index 1ce82edc..69b11054 100644 --- a/LEGO1/omni/src/stream/mxdiskstreamcontroller.cpp +++ b/LEGO1/omni/src/stream/mxdiskstreamcontroller.cpp @@ -1,7 +1,7 @@ #include "mxdiskstreamcontroller.h" #include "mxactionnotificationparam.h" -#include "mxautolocker.h" +#include "mxautolock.h" #include "mxdiskstreamprovider.h" #include "mxdsstreamingaction.h" #include "mxmisc.h" @@ -19,7 +19,7 @@ MxDiskStreamController::MxDiskStreamController() // FUNCTION: LEGO1 0x100c7530 MxDiskStreamController::~MxDiskStreamController() { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); m_unk0xc4 = FALSE; m_unk0x70 = FALSE; @@ -67,7 +67,7 @@ MxDiskStreamController::~MxDiskStreamController() // FUNCTION: LEGO1 0x100c7790 MxResult MxDiskStreamController::Open(const char* p_filename) { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); MxResult result = MxStreamController::Open(p_filename); if (result == SUCCESS) { @@ -99,7 +99,7 @@ MxResult MxDiskStreamController::VTable0x18(undefined4, undefined4) // FUNCTION: LEGO1 0x100c7890 MxResult MxDiskStreamController::FUN_100c7890(MxDSStreamingAction* p_action) { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); if (p_action == NULL) { return FAILURE; } @@ -128,7 +128,7 @@ void MxDiskStreamController::FUN_100c7980() MxDSStreamingAction* action = NULL; { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); if (m_unk0x3c.size() && m_unk0x8c < m_provider->GetStreamBuffersNum()) { buffer = new MxDSBuffer(); @@ -161,7 +161,7 @@ void MxDiskStreamController::FUN_100c7980() // FUNCTION: LEGO1 0x100c7ac0 MxDSStreamingAction* MxDiskStreamController::VTable0x28() { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); MxDSAction* oldAction; MxDSStreamingAction* result = NULL; MxU32 filesize = m_provider->GetFileSize(); @@ -182,7 +182,7 @@ MxDSStreamingAction* MxDiskStreamController::VTable0x28() // FUNCTION: LEGO1 0x100c7c00 MxResult MxDiskStreamController::VTable0x30(MxDSAction* p_action) { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); MxResult result = MxStreamController::VTable0x30(p_action); MxDSStreamingAction* item; @@ -231,7 +231,7 @@ void MxDiskStreamController::FUN_100c7ce0(MxDSBuffer* p_buffer) // FUNCTION: LEGO1 0x100c7d10 MxResult MxDiskStreamController::FUN_100c7d10() { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); MxDSStreamingAction* action = FUN_100c7db0(); if (!action) { @@ -250,7 +250,7 @@ MxResult MxDiskStreamController::FUN_100c7d10() // FUNCTION: LEGO1 0x100c7db0 MxDSStreamingAction* MxDiskStreamController::FUN_100c7db0() { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); for (MxStreamListMxNextActionDataStart::iterator it = m_nextActionList.begin(); it != m_nextActionList.end(); it++) { @@ -276,7 +276,7 @@ MxDSStreamingAction* MxDiskStreamController::FUN_100c7db0() // FUNCTION: LEGO1 0x100c7f40 void MxDiskStreamController::FUN_100c7f40(MxDSStreamingAction* p_streamingaction) { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); if (p_streamingaction) { m_list0x64.push_back(p_streamingaction); } @@ -285,7 +285,7 @@ void MxDiskStreamController::FUN_100c7f40(MxDSStreamingAction* p_streamingaction // FUNCTION: LEGO1 0x100c7ff0 MxResult MxDiskStreamController::VTable0x20(MxDSAction* p_action) { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); MxDSStreamingAction* entry = (MxDSStreamingAction*) m_list0x80.Find(p_action, FALSE); // TODO: is this a seperate class? if (entry) { @@ -331,7 +331,7 @@ void MxDiskStreamController::FUN_100c8120(MxDSAction* p_action) // FUNCTION: LEGO1 0x100c8160 MxResult MxDiskStreamController::VTable0x24(MxDSAction* p_action) { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); if (m_unk0x54.Find(p_action, FALSE) == NULL) { if (VTable0x30(p_action) == SUCCESS) { #ifdef COMPAT_MODE @@ -373,7 +373,7 @@ MxResult MxDiskStreamController::VTable0x24(MxDSAction* p_action) // FUNCTION: LEGO1 0x100c8360 MxResult MxDiskStreamController::FUN_100c8360(MxDSStreamingAction* p_action) { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); MxDSBuffer* buffer = p_action->GetUnknowna0(); MxDSStreamingAction* action2 = (MxDSStreamingAction*) m_list0x90.Find(p_action, TRUE); buffer->FUN_100c6f80(p_action->GetUnknown94() - p_action->GetBufferOffset()); @@ -404,14 +404,14 @@ MxResult MxDiskStreamController::FUN_100c8360(MxDSStreamingAction* p_action) // FUNCTION: LEGO1 0x100c84a0 void MxDiskStreamController::InsertToList74(MxDSBuffer* p_buffer) { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); m_list0x74.push_back(p_buffer); } // FUNCTION: LEGO1 0x100c8540 void MxDiskStreamController::FUN_100c8540() { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); for (list::iterator it = m_list0x74.begin(); it != m_list0x74.end();) { MxDSBuffer* buf = *it; if (buf->GetRefCount() == 0) { @@ -452,14 +452,14 @@ MxResult MxDiskStreamController::Tickle() // FUNCTION: LEGO1 0x100c8670 void MxDiskStreamController::FUN_100c8670(MxDSStreamingAction* p_streamingAction) { - MxAutoLocker lock(&this->m_critical9c); + AUTOLOCK(m_critical9c); m_list0xb8.push_back(p_streamingAction); } // FUNCTION: LEGO1 0x100c8720 void MxDiskStreamController::FUN_100c8720() { - MxAutoLocker lock(&this->m_critical9c); + AUTOLOCK(m_critical9c); MxDSStreamingAction* action; while (!m_list0xb8.empty()) { diff --git a/LEGO1/omni/src/stream/mxdiskstreamprovider.cpp b/LEGO1/omni/src/stream/mxdiskstreamprovider.cpp index 88f70c7d..d316912d 100644 --- a/LEGO1/omni/src/stream/mxdiskstreamprovider.cpp +++ b/LEGO1/omni/src/stream/mxdiskstreamprovider.cpp @@ -1,6 +1,6 @@ #include "mxdiskstreamprovider.h" -#include "mxautolocker.h" +#include "mxautolock.h" #include "mxdiskstreamcontroller.h" #include "mxdsbuffer.h" #include "mxdsstreamingaction.h" @@ -52,7 +52,7 @@ MxDiskStreamProvider::~MxDiskStreamProvider() action = NULL; { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); m_list.PopFrontStreamingAction(action); } @@ -124,7 +124,7 @@ void MxDiskStreamProvider::VTable0x20(MxDSAction* p_action) action = NULL; { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); m_list.PopFrontStreamingAction(action); } @@ -142,7 +142,7 @@ void MxDiskStreamProvider::VTable0x20(MxDSAction* p_action) else { do { { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); action = (MxDSStreamingAction*) m_list.Find(p_action, TRUE); } @@ -199,7 +199,7 @@ MxResult MxDiskStreamProvider::FUN_100d1780(MxDSStreamingAction* p_action) } { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); m_list.push_back(p_action); } @@ -215,7 +215,7 @@ void MxDiskStreamProvider::PerformWork() MxDSStreamingAction* streamingAction = NULL; { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); if (!m_list.empty()) { streamingAction = (MxDSStreamingAction*) m_list.front(); @@ -230,7 +230,7 @@ void MxDiskStreamProvider::PerformWork() MxDSBuffer* buffer; { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); if (!m_list.PopFrontStreamingAction(streamingAction)) { goto done; diff --git a/LEGO1/omni/src/stream/mxramstreamcontroller.cpp b/LEGO1/omni/src/stream/mxramstreamcontroller.cpp index b480255c..dea72610 100644 --- a/LEGO1/omni/src/stream/mxramstreamcontroller.cpp +++ b/LEGO1/omni/src/stream/mxramstreamcontroller.cpp @@ -1,6 +1,6 @@ #include "mxramstreamcontroller.h" -#include "mxautolocker.h" +#include "mxautolock.h" #include "mxdsstreamingaction.h" #include "mxramstreamprovider.h" @@ -9,7 +9,7 @@ DECOMP_SIZE_ASSERT(MxRAMStreamController, 0x98); // FUNCTION: LEGO1 0x100c6110 MxResult MxRAMStreamController::Open(const char* p_filename) { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); if (MxStreamController::Open(p_filename) != SUCCESS) { return FAILURE; } @@ -37,7 +37,7 @@ MxResult MxRAMStreamController::Open(const char* p_filename) // FUNCTION: LEGO1 0x100c6210 MxResult MxRAMStreamController::VTable0x20(MxDSAction* p_action) { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); MxS32 unk0x24 = 0; MxResult result = FAILURE; @@ -81,7 +81,7 @@ MxResult MxRAMStreamController::VTable0x24(MxDSAction* p_action) // FUNCTION: LEGO1 0x100c63c0 MxResult MxRAMStreamController::DeserializeObject(MxDSStreamingAction& p_action) { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); MxResult result; MxDSStreamingAction* value = NULL; diff --git a/LEGO1/omni/src/stream/mxstreamcontroller.cpp b/LEGO1/omni/src/stream/mxstreamcontroller.cpp index bcad399d..a94cd974 100644 --- a/LEGO1/omni/src/stream/mxstreamcontroller.cpp +++ b/LEGO1/omni/src/stream/mxstreamcontroller.cpp @@ -1,6 +1,6 @@ #include "mxstreamcontroller.h" -#include "mxautolocker.h" +#include "mxautolock.h" #include "mxdsmultiaction.h" #include "mxdsstreamingaction.h" #include "mxmisc.h" @@ -42,7 +42,7 @@ MxStreamController::MxStreamController() // FUNCTION: LEGO1 0x100c1290 MxStreamController::~MxStreamController() { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); MxDSSubscriber* subscriber; while (m_subscriberList.PopFront(subscriber)) { @@ -82,7 +82,7 @@ MxStreamController::~MxStreamController() MxResult MxStreamController::Open(const char* p_filename) { char sourceName[256]; - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); MakeSourceName(sourceName, p_filename); this->m_atom = MxAtomId(sourceName, e_lowerCase2); @@ -104,7 +104,7 @@ void MxStreamController::RemoveSubscriber(MxDSSubscriber* p_subscriber) // FUNCTION: LEGO1 0x100c1690 MxResult MxStreamController::VTable0x20(MxDSAction* p_action) { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); MxResult result; MxU32 offset = 0; @@ -129,7 +129,7 @@ MxResult MxStreamController::VTable0x20(MxDSAction* p_action) // FUNCTION: LEGO1 0x100c1740 MxResult MxStreamController::VTable0x24(MxDSAction* p_action) { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); VTable0x30(p_action); m_action0x60 = m_unk0x54.Find(p_action, TRUE); if (m_action0x60 == NULL) { @@ -219,7 +219,7 @@ MxResult MxStreamController::FUN_100c1a00(MxDSAction* p_action, MxU32 p_offset) // FUNCTION: LEGO1 0x100c1c10 MxResult MxStreamController::VTable0x2c(MxDSAction* p_action, MxU32 p_bufferval) { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); if (FUN_100c1a00(p_action, p_bufferval) != SUCCESS) { return FAILURE; } @@ -229,7 +229,7 @@ MxResult MxStreamController::VTable0x2c(MxDSAction* p_action, MxU32 p_bufferval) // FUNCTION: LEGO1 0x100c1ce0 MxResult MxStreamController::VTable0x30(MxDSAction* p_action) { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); MxResult result = FAILURE; MxDSAction* action = m_unk0x3c.Find(p_action, TRUE); if (action != NULL) { @@ -244,7 +244,7 @@ MxResult MxStreamController::VTable0x30(MxDSAction* p_action) // FUNCTION: LEGO1 0x100c1da0 MxResult MxStreamController::InsertActionToList54(MxDSAction* p_action) { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); MxDSAction* action = p_action->Clone(); if (action == NULL) { @@ -259,7 +259,7 @@ MxResult MxStreamController::InsertActionToList54(MxDSAction* p_action) // FUNCTION: LEGO1 0x100c1e70 MxPresenter* MxStreamController::FUN_100c1e70(MxDSAction& p_action) { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); MxPresenter* result = NULL; if (p_action.GetObjectId() != -1) { MxDSAction* action = m_unk0x3c.Find(&p_action, FALSE); @@ -274,7 +274,7 @@ MxPresenter* MxStreamController::FUN_100c1e70(MxDSAction& p_action) // FUNCTION: LEGO1 0x100c1f00 MxResult MxStreamController::FUN_100c1f00(MxDSAction* p_action) { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); MxU32 objectId = p_action->GetObjectId(); MxStreamChunk* chunk = new MxStreamChunk; diff --git a/LEGO1/omni/src/system/mxautolocker.cpp b/LEGO1/omni/src/system/mxautolock.cpp similarity index 68% rename from LEGO1/omni/src/system/mxautolocker.cpp rename to LEGO1/omni/src/system/mxautolock.cpp index 3c5a2afb..56a5a977 100644 --- a/LEGO1/omni/src/system/mxautolocker.cpp +++ b/LEGO1/omni/src/system/mxautolock.cpp @@ -1,7 +1,7 @@ -#include "mxautolocker.h" +#include "mxautolock.h" // FUNCTION: LEGO1 0x100b8ed0 -MxAutoLocker::MxAutoLocker(MxCriticalSection* p_criticalSection) +MxAutoLock::MxAutoLock(MxCriticalSection* p_criticalSection) { this->m_criticalSection = p_criticalSection; if (this->m_criticalSection != 0) { @@ -10,7 +10,7 @@ MxAutoLocker::MxAutoLocker(MxCriticalSection* p_criticalSection) } // FUNCTION: LEGO1 0x100b8ef0 -MxAutoLocker::~MxAutoLocker() +MxAutoLock::~MxAutoLock() { if (this->m_criticalSection != 0) { this->m_criticalSection->Leave(); diff --git a/LEGO1/omni/src/video/mxloopingsmkpresenter.cpp b/LEGO1/omni/src/video/mxloopingsmkpresenter.cpp index 9229afee..af73b59a 100644 --- a/LEGO1/omni/src/video/mxloopingsmkpresenter.cpp +++ b/LEGO1/omni/src/video/mxloopingsmkpresenter.cpp @@ -1,6 +1,6 @@ #include "mxloopingsmkpresenter.h" -#include "mxautolocker.h" +#include "mxautolock.h" #include "mxdsmediaaction.h" DECOMP_SIZE_ASSERT(MxLoopingSmkPresenter, 0x724); @@ -122,7 +122,7 @@ void MxLoopingSmkPresenter::RepeatingTickle() // FUNCTION: LEGO1 0x100b4cd0 MxResult MxLoopingSmkPresenter::AddToManager() { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); return MxSmkPresenter::AddToManager(); } diff --git a/LEGO1/omni/src/video/mxvideomanager.cpp b/LEGO1/omni/src/video/mxvideomanager.cpp index 8e414480..14b99a7e 100644 --- a/LEGO1/omni/src/video/mxvideomanager.cpp +++ b/LEGO1/omni/src/video/mxvideomanager.cpp @@ -1,6 +1,6 @@ #include "mxvideomanager.h" -#include "mxautolocker.h" +#include "mxautolock.h" #include "mxmisc.h" #include "mxomni.h" #include "mxpresenter.h" @@ -306,7 +306,7 @@ void MxVideoManager::InvalidateRect(MxRect32& p_rect) // FUNCTION: LEGO1 0x100bea90 MxResult MxVideoManager::Tickle() { - MxAutoLocker lock(&this->m_criticalSection); + AUTOLOCK(m_criticalSection); SortPresenterList(); diff --git a/LEGO1/omni/src/video/mxvideopresenter.cpp b/LEGO1/omni/src/video/mxvideopresenter.cpp index e1ab5837..41871b33 100644 --- a/LEGO1/omni/src/video/mxvideopresenter.cpp +++ b/LEGO1/omni/src/video/mxvideopresenter.cpp @@ -1,6 +1,6 @@ #include "mxvideopresenter.h" -#include "mxautolocker.h" +#include "mxautolock.h" #include "mxdsmediaaction.h" #include "mxmisc.h" #include "mxregioncursor.h" @@ -544,7 +544,7 @@ void MxVideoPresenter::EndAction() { if (m_action) { MxMediaPresenter::EndAction(); - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); if (m_bitmap) { MxLong height = m_bitmap->GetBmiHeightAbs(); @@ -562,7 +562,7 @@ void MxVideoPresenter::EndAction() // FUNCTION: LEGO1 0x100b3280 MxResult MxVideoPresenter::PutData() { - MxAutoLocker lock(&m_criticalSection); + AUTOLOCK(m_criticalSection); if (IsEnabled() && m_currentTickleState >= e_streaming && m_currentTickleState <= e_unk5) { PutFrame();