diff --git a/CMakeLists.txt b/CMakeLists.txt index c78d6312ab..6415d39d24 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -258,8 +258,6 @@ function(add_lego_libraries NAME) LEGO1/omni/src/stream/mxstreamchunk.cpp LEGO1/omni/src/stream/mxstreamcontroller.cpp LEGO1/omni/src/stream/mxstreamer.cpp - LEGO1/omni/src/stream/mxstreamlist.cpp - LEGO1/omni/src/stream/mxstreamprovider.cpp LEGO1/omni/src/system/mxautolock.cpp LEGO1/omni/src/system/mxcriticalsection.cpp LEGO1/omni/src/system/mxscheduler.cpp diff --git a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp index c827043fcd..05fbb6ec9f 100644 --- a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp @@ -404,13 +404,13 @@ LegoROI* LegoAnimPresenter::FUN_100699e0(const LegoChar* p_und) // FUNCTION: LEGO1 0x10069b10 void LegoAnimPresenter::FUN_10069b10() { - LegoAnimStructMap map; + LegoAnimStructMap anims; if (m_unk0x8c != NULL) { memset(m_unk0x8c, 0, m_unk0x94 * sizeof(*m_unk0x8c)); } - FUN_1006a3c0(map, m_anim->GetRoot(), NULL); + FUN_1006a3c0(anims, m_anim->GetRoot(), NULL); if (m_roiMap != NULL) { delete[] m_roiMap; @@ -418,10 +418,10 @@ void LegoAnimPresenter::FUN_10069b10() } m_roiMapSize = 0; - m_roiMap = new LegoROI*[map.size() + 1]; - memset(m_roiMap, 0, (map.size() + 1) * sizeof(*m_roiMap)); + m_roiMap = new LegoROI*[anims.size() + 1]; + memset(m_roiMap, 0, (anims.size() + 1) * sizeof(*m_roiMap)); - for (LegoAnimStructMap::iterator it = map.begin(); it != map.end();) { + for (LegoAnimStructMap::iterator it = anims.begin(); it != anims.end();) { MxU32 index = (*it).second.m_index; m_roiMap[index] = (*it).second.m_roi; diff --git a/LEGO1/lego/legoomni/src/video/legohideanimpresenter.cpp b/LEGO1/lego/legoomni/src/video/legohideanimpresenter.cpp index 51e6244854..67d499413d 100644 --- a/LEGO1/lego/legoomni/src/video/legohideanimpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legohideanimpresenter.cpp @@ -143,18 +143,18 @@ void LegoHideAnimPresenter::FUN_1006db60(LegoTreeNode* p_node, LegoTime p_time) // FUNCTION: BETA10 0x100532fd void LegoHideAnimPresenter::FUN_1006dc10() { - LegoHideAnimStructMap map; + LegoHideAnimStructMap anims; - FUN_1006e3f0(map, m_anim->GetRoot()); + FUN_1006e3f0(anims, m_anim->GetRoot()); if (m_boundaryMap != NULL) { delete[] m_boundaryMap; } - m_boundaryMap = new LegoPathBoundary*[map.size() + 1]; + m_boundaryMap = new LegoPathBoundary*[anims.size() + 1]; m_boundaryMap[0] = NULL; - for (LegoHideAnimStructMap::iterator it = map.begin(); !(it == map.end()); it++) { + for (LegoHideAnimStructMap::iterator it = anims.begin(); !(it == anims.end()); it++) { m_boundaryMap[(*it).second.m_index] = (*it).second.m_boundary; delete[] const_cast((*it).first); } diff --git a/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp b/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp index 950e0b2e93..5ade0b3ae7 100644 --- a/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp +++ b/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp @@ -576,12 +576,12 @@ MxLong RegistrationBook::HandlePathStruct(LegoPathStructNotificationParam& p_par // FUNCTION: LEGO1 0x10078350 MxBool RegistrationBook::CreateSurface() { - MxCompositePresenterList* list = m_checkmark[0]->GetList(); + MxCompositePresenterList* presenters = m_checkmark[0]->GetList(); MxStillPresenter *presenter, *uninitialized; - if (list) { - if (list->begin() != list->end()) { - presenter = (MxStillPresenter*) list->front(); + if (presenters) { + if (presenters->begin() != presenters->end()) { + presenter = (MxStillPresenter*) presenters->front(); } else { presenter = uninitialized; // intentionally uninitialized variable diff --git a/LEGO1/omni/include/mxdiskstreamcontroller.h b/LEGO1/omni/include/mxdiskstreamcontroller.h index 9a1ad22c56..d74ad211f2 100644 --- a/LEGO1/omni/include/mxdiskstreamcontroller.h +++ b/LEGO1/omni/include/mxdiskstreamcontroller.h @@ -53,15 +53,15 @@ class MxDiskStreamController : public MxStreamController { void FUN_100c8670(MxDSStreamingAction* p_streamingAction); private: - MxStreamListMxDSAction m_list0x64; // 0x64 - MxBool m_unk0x70; // 0x70 - list m_list0x74; // 0x74 - MxStreamListMxDSAction m_list0x80; // 0x80 - undefined2 m_unk0x8c; // 0x8c - MxStreamListMxDSAction m_list0x90; // 0x90 - MxCriticalSection m_critical9c; // 0x9c - MxStreamListMxDSAction m_list0xb8; // 0xb8 - MxBool m_unk0xc4; // 0xc4 + MxDSObjectList m_list0x64; // 0x64 + MxBool m_unk0x70; // 0x70 + list m_list0x74; // 0x74 + MxDSObjectList m_list0x80; // 0x80 + undefined2 m_unk0x8c; // 0x8c + MxDSObjectList m_list0x90; // 0x90 + MxCriticalSection m_critical9c; // 0x9c + MxDSObjectList m_list0xb8; // 0xb8 + MxBool m_unk0xc4; // 0xc4 void FUN_100c7970(); void FUN_100c7ce0(MxDSBuffer* p_buffer); @@ -74,10 +74,10 @@ class MxDiskStreamController : public MxStreamController { }; // TEMPLATE: LEGO1 0x100c14d0 -// list >::erase +// list >::erase // TEMPLATE: LEGO1 0x100c7330 -// list >::_Buynode +// list >::_Buynode // TEMPLATE: LEGO1 0x100c7420 // list >::~list > diff --git a/LEGO1/omni/include/mxdiskstreamprovider.h b/LEGO1/omni/include/mxdiskstreamprovider.h index aa5a9ada5d..f379ea0071 100644 --- a/LEGO1/omni/include/mxdiskstreamprovider.h +++ b/LEGO1/omni/include/mxdiskstreamprovider.h @@ -5,7 +5,6 @@ #include "decomp.h" #include "mxcriticalsection.h" #include "mxdsaction.h" -#include "mxstreamlist.h" #include "mxstreamprovider.h" #include "mxthread.h" @@ -63,7 +62,7 @@ class MxDiskStreamProvider : public MxStreamProvider { MxBool m_remainingWork; // 0x34 MxBool m_unk0x35; // 0x35 MxCriticalSection m_criticalSection; // 0x38 - MxStreamListMxDSAction m_list; // 0x54 + MxDSObjectList m_list; // 0x54 }; // SYNTHETIC: LEGO1 0x100d10a0 diff --git a/LEGO1/omni/include/mxdsobject.h b/LEGO1/omni/include/mxdsobject.h index 6e3d2fc3d8..a0a5cb16a1 100644 --- a/LEGO1/omni/include/mxdsobject.h +++ b/LEGO1/omni/include/mxdsobject.h @@ -4,10 +4,25 @@ #include "decomp.h" #include "mxatom.h" #include "mxcore.h" +#include "mxutilitylist.h" class MxDSFile; +class MxDSObject; class MxPresenter; +// SIZE 0x0c +class MxDSObjectList : public MxUtilityList { +public: + // FUNCTION: BETA10 0x10150e30 + MxDSObject* FindAndErase(MxDSObject* p_action) { return FindInternal(p_action, TRUE); } + + // FUNCTION: BETA10 0x10150fc0 + MxDSObject* Find(MxDSObject* p_action) { return FindInternal(p_action, FALSE); } + +private: + MxDSObject* FindInternal(MxDSObject* p_action, MxBool p_delete); +}; + // VTABLE: LEGO1 0x100dc868 // VTABLE: BETA10 0x101c23f0 // SIZE 0x2c @@ -107,4 +122,7 @@ class MxDSObject : public MxCore { MxDSObject* DeserializeDSObjectDispatch(MxU8*&, MxS16); MxDSObject* CreateStreamObject(MxDSFile*, MxS16); +// TEMPLATE: BETA10 0x10150950 +// MxUtilityList::PopFront + #endif // MXDSOBJECT_H diff --git a/LEGO1/omni/include/mxdssubscriber.h b/LEGO1/omni/include/mxdssubscriber.h index e0334b5681..072a88bb8a 100644 --- a/LEGO1/omni/include/mxdssubscriber.h +++ b/LEGO1/omni/include/mxdssubscriber.h @@ -4,9 +4,18 @@ #include "decomp.h" #include "mxcore.h" #include "mxstreamchunklist.h" +#include "mxutilitylist.h" +class MxDSObject; +class MxDSSubscriber; class MxStreamController; +// SIZE 0x0c +class MxDSSubscriberList : public MxUtilityList { +public: + MxDSSubscriber* Find(MxDSObject* p_object); +}; + // VTABLE: LEGO1 0x100dc698 // VTABLE: BETA10 0x101c1d38 // SIZE 0x4c @@ -58,4 +67,7 @@ class MxDSSubscriber : public MxCore { // TEMPLATE: LEGO1 0x100b7d00 // MxStreamChunkList::~MxStreamChunkList +// TEMPLATE: BETA10 0x10150a70 +// MxUtilityList::PopFront + #endif // MXDSSUBSCRIBER_H diff --git a/LEGO1/omni/include/mxstreamchunk.h b/LEGO1/omni/include/mxstreamchunk.h index 72858cfe63..e68566ab66 100644 --- a/LEGO1/omni/include/mxstreamchunk.h +++ b/LEGO1/omni/include/mxstreamchunk.h @@ -4,7 +4,7 @@ #include "mxdschunk.h" class MxDSBuffer; -class MxStreamListMxDSSubscriber; +class MxDSSubscriberList; // VTABLE: LEGO1 0x100dc2a8 // VTABLE: BETA10 0x101c1d20 @@ -34,7 +34,7 @@ class MxStreamChunk : public MxDSChunk { MxResult ReadChunk(MxDSBuffer* p_buffer, MxU8* p_chunkData); MxU32 ReadChunkHeader(MxU8* p_chunkData); - MxResult SendChunk(MxStreamListMxDSSubscriber& p_subscriberList, MxBool p_append, MxS16 p_obj24val); + MxResult SendChunk(MxDSSubscriberList& p_subscriberList, MxBool p_append, MxS16 p_obj24val); void SetBuffer(MxDSBuffer* p_buffer); static MxU16* IntoFlags(MxU8* p_buffer); diff --git a/LEGO1/omni/include/mxstreamcontroller.h b/LEGO1/omni/include/mxstreamcontroller.h index e77cd39216..d0328908ee 100644 --- a/LEGO1/omni/include/mxstreamcontroller.h +++ b/LEGO1/omni/include/mxstreamcontroller.h @@ -5,13 +5,22 @@ #include "mxatom.h" #include "mxcore.h" #include "mxcriticalsection.h" +#include "mxdsobject.h" #include "mxdssubscriber.h" +#include "mxnextactiondatastart.h" #include "mxstl/stlcompat.h" -#include "mxstreamlist.h" +class MxDSAction; class MxDSStreamingAction; class MxStreamProvider; +// SIZE 0x0c +class MxNextActionDataStartList : public MxUtilityList { +public: + MxNextActionDataStart* Find(MxU32 p_id, MxS16 p_value); + MxNextActionDataStart* FindAndErase(MxU32 p_id, MxS16 p_value); +}; + // VTABLE: LEGO1 0x100dc968 // VTABLE: BETA10 0x101c26c0 // SIZE 0x64 @@ -34,12 +43,20 @@ class MxStreamController : public MxCore { return !strcmp(p_name, MxStreamController::ClassName()) || MxCore::IsA(p_name); } - virtual MxResult Open(const char* p_filename); // vtable+0x14 - virtual MxResult VTable0x18(undefined4, undefined4); // vtable+0x18 - virtual MxResult VTable0x1c(undefined4, undefined4); // vtable+0x1c - virtual MxResult VTable0x20(MxDSAction* p_action); // vtable+0x20 - virtual MxResult VTable0x24(MxDSAction* p_action); // vtable+0x24 - virtual MxDSStreamingAction* VTable0x28(); // vtable+0x28 + virtual MxResult Open(const char* p_filename); // vtable+0x14 + + // FUNCTION: LEGO1 0x100b9400 + virtual MxResult VTable0x18(undefined4, undefined4) { return FAILURE; } // vtable+0x18 + + // FUNCTION: LEGO1 0x100b9410 + virtual MxResult VTable0x1c(undefined4, undefined4) { return FAILURE; } // vtable+0x1c + + virtual MxResult VTable0x20(MxDSAction* p_action); // vtable+0x20 + virtual MxResult VTable0x24(MxDSAction* p_action); // vtable+0x24 + + // FUNCTION: LEGO1 0x100b9420 + virtual MxDSStreamingAction* VTable0x28() { return NULL; } // vtable+0x28 + virtual MxResult VTable0x2c(MxDSAction* p_action, MxU32 p_bufferval); // vtable+0x2c virtual MxResult VTable0x30(MxDSAction* p_action); // vtable+0x30 @@ -55,24 +72,24 @@ class MxStreamController : public MxCore { MxAtomId& GetAtom() { return m_atom; } MxStreamProvider* GetProvider() { return m_provider; } - MxStreamListMxDSAction& GetUnk0x3c() { return m_unk0x3c; } - MxStreamListMxDSAction& GetUnk0x54() { return m_unk0x54; } - MxStreamListMxDSSubscriber& GetSubscriberList() { return m_subscriberList; } + MxDSObjectList& GetUnk0x3c() { return m_unk0x3c; } + MxDSObjectList& GetUnk0x54() { return m_unk0x54; } + MxDSSubscriberList& GetSubscriberList() { return m_subscriberList; } protected: - MxCriticalSection m_criticalSection; // 0x08 - MxAtomId m_atom; // 0x24 - MxStreamProvider* m_provider; // 0x28 - undefined4* m_unk0x2c; // 0x2c - MxStreamListMxDSSubscriber m_subscriberList; // 0x30 - MxStreamListMxDSAction m_unk0x3c; // 0x3c - MxStreamListMxNextActionDataStart m_nextActionList; // 0x48 - MxStreamListMxDSAction m_unk0x54; // 0x54 - MxDSAction* m_action0x60; // 0x60 + MxCriticalSection m_criticalSection; // 0x08 + MxAtomId m_atom; // 0x24 + MxStreamProvider* m_provider; // 0x28 + undefined4* m_unk0x2c; // 0x2c + MxDSSubscriberList m_subscriberList; // 0x30 + MxDSObjectList m_unk0x3c; // 0x3c + MxNextActionDataStartList m_nextActionList; // 0x48 + MxDSObjectList m_unk0x54; // 0x54 + MxDSAction* m_action0x60; // 0x60 }; // TEMPLATE: LEGO1 0x100c0d60 -// list >::~list > +// list >::~list > // TEMPLATE: LEGO1 0x100c0dd0 // list >::~list > @@ -92,33 +109,33 @@ class MxStreamController : public MxCore { // MxStreamController::`scalar deleting destructor' // FUNCTION: LEGO1 0x100c0fc0 -// MxStreamListMxDSSubscriber::~MxStreamListMxDSSubscriber +// MxDSSubscriberList::~MxDSSubscriberList // FUNCTION: LEGO1 0x100c1010 -// MxStreamListMxDSAction::~MxStreamListMxDSAction +// MxDSObjectList::~MxDSObjectList // FUNCTION: LEGO1 0x100c1060 -// MxStreamListMxNextActionDataStart::~MxStreamListMxNextActionDataStart +// MxNextActionDataStartList::~MxNextActionDataStartList // TEMPLATE: LEGO1 0x100c10b0 -// MxStreamList::~MxStreamList +// MxUtilityList::~MxUtilityList // TEMPLATE: LEGO1 0x100c1100 -// MxStreamList::~MxStreamList +// MxUtilityList::~MxUtilityList // TEMPLATE: LEGO1 0x100c1150 -// MxStreamList::~MxStreamList +// MxUtilityList::~MxUtilityList // TEMPLATE: LEGO1 0x100c11a0 // List::~List // TEMPLATE: LEGO1 0x100c11f0 -// List::~List +// List::~List // TEMPLATE: LEGO1 0x100c1240 // List::~List // TEMPLATE: LEGO1 0x100c1bc0 -// list >::insert +// list >::insert #endif // MXSTREAMCONTROLLER_H diff --git a/LEGO1/omni/include/mxstreamlist.h b/LEGO1/omni/include/mxstreamlist.h deleted file mode 100644 index 36a9350a3d..0000000000 --- a/LEGO1/omni/include/mxstreamlist.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef MXSTREAMLIST_H -#define MXSTREAMLIST_H - -#include "mxdsstreamingaction.h" -#include "mxdssubscriber.h" -#include "mxnextactiondatastart.h" -#include "mxstl/stlcompat.h" - -template -class MxStreamList : public list { -public: - MxBool PopFront(T& p_obj) - { - if (this->empty()) { - return FALSE; - } - - p_obj = this->front(); - this->pop_front(); - return TRUE; - } -}; - -// SIZE 0x0c -class MxStreamListMxDSAction : public MxStreamList { -public: - // FUNCTION: BETA10 0x10150e30 - MxDSAction* FindAndErase(MxDSAction* p_action) { return FindInternal(p_action, TRUE); } - - // FUNCTION: BETA10 0x10150fc0 - MxDSAction* Find(MxDSAction* p_action) { return FindInternal(p_action, FALSE); } - - // There chance this list actually holds MxDSStreamingListAction - // instead of MxDSAction. Until then, we use this helper. - MxBool PopFrontStreamingAction(MxDSStreamingAction*& p_obj) - { - if (empty()) { - return FALSE; - } - - p_obj = (MxDSStreamingAction*) front(); - pop_front(); - return TRUE; - } - -private: - MxDSAction* FindInternal(MxDSAction* p_action, MxBool p_delete); -}; - -// SIZE 0x0c -class MxStreamListMxNextActionDataStart : public MxStreamList { -public: - MxNextActionDataStart* Find(MxU32 p_id, MxS16 p_value); - MxNextActionDataStart* FindAndErase(MxU32 p_id, MxS16 p_value); -}; - -// SIZE 0x0c -class MxStreamListMxDSSubscriber : public MxStreamList { -public: - MxDSSubscriber* Find(MxDSObject* p_object); -}; - -// TEMPLATE: BETA10 0x10150950 -// MxStreamList::PopFront - -// TEMPLATE: BETA10 0x10150a70 -// MxStreamList::PopFront - -#endif // MXSTREAMLIST_H diff --git a/LEGO1/omni/include/mxstreamprovider.h b/LEGO1/omni/include/mxstreamprovider.h index 33cda8a176..f7ea181984 100644 --- a/LEGO1/omni/include/mxstreamprovider.h +++ b/LEGO1/omni/include/mxstreamprovider.h @@ -28,12 +28,21 @@ class MxStreamProvider : public MxCore { return !strcmp(p_name, MxStreamProvider::ClassName()) || MxCore::IsA(p_name); } - virtual MxResult SetResourceToGet(MxStreamController* p_resource); // vtable+0x14 - virtual MxU32 GetFileSize() = 0; // vtable+0x18 - virtual MxS32 GetStreamBuffersNum() = 0; // vtable+0x1c - virtual void VTable0x20(MxDSAction* p_action); // vtable+0x20 - virtual MxU32 GetLengthInDWords() = 0; // vtable+0x24 - virtual MxU32* GetBufferForDWords() = 0; // vtable+0x28 + // FUNCTION: LEGO1 0x100d07c0 + virtual MxResult SetResourceToGet(MxStreamController* p_pLookup) + { + m_pLookup = p_pLookup; + return SUCCESS; + } // vtable+0x14 + + virtual MxU32 GetFileSize() = 0; // vtable+0x18 + virtual MxS32 GetStreamBuffersNum() = 0; // vtable+0x1c + + // FUNCTION: LEGO1 0x100d07d0 + virtual void VTable0x20(MxDSAction* p_action) {} // vtable+0x20 + + virtual MxU32 GetLengthInDWords() = 0; // vtable+0x24 + virtual MxU32* GetBufferForDWords() = 0; // vtable+0x28 protected: MxStreamController* m_pLookup; // 0x08 diff --git a/LEGO1/omni/include/mxutilitylist.h b/LEGO1/omni/include/mxutilitylist.h new file mode 100644 index 0000000000..92b7eba5d9 --- /dev/null +++ b/LEGO1/omni/include/mxutilitylist.h @@ -0,0 +1,23 @@ +#ifndef MXUTILITYLIST_H +#define MXUTILITYLIST_H + +#include "mxstl/stlcompat.h" + +// Probably should be defined somewhere else + +template +class MxUtilityList : public list { +public: + MxBool PopFront(T& p_obj) + { + if (this->empty()) { + return FALSE; + } + + p_obj = this->front(); + this->pop_front(); + return TRUE; + } +}; + +#endif // MXUTILITYLIST_H diff --git a/LEGO1/omni/src/action/mxdsobject.cpp b/LEGO1/omni/src/action/mxdsobject.cpp index 3bb189c712..6cea1ea0cb 100644 --- a/LEGO1/omni/src/action/mxdsobject.cpp +++ b/LEGO1/omni/src/action/mxdsobject.cpp @@ -17,7 +17,8 @@ #include #include -DECOMP_SIZE_ASSERT(MxDSObject, 0x2c); +DECOMP_SIZE_ASSERT(MxDSObject, 0x2c) +DECOMP_SIZE_ASSERT(MxDSObjectList, 0x0c) // FUNCTION: LEGO1 0x100bf6a0 // FUNCTION: BETA10 0x101478c0 @@ -172,6 +173,38 @@ void MxDSObject::Deserialize(MxU8*& p_source, MxS16 p_unk0x24) m_unk0x24 = p_unk0x24; } +// FUNCTION: LEGO1 0x100bfa80 +// FUNCTION: BETA10 0x10147e02 +MxDSObject* MxDSObjectList::FindInternal(MxDSObject* p_action, MxBool p_delete) +{ + // DECOMP ALPHA 0x1008b99d ? + + MxDSObject* found = NULL; + +#ifdef COMPAT_MODE + iterator it; + for (it = begin(); it != end(); it++) { +#else + for (iterator it = begin(); it != end(); it++) { +#endif + if (p_action->GetObjectId() == -1 || p_action->GetObjectId() == (*it)->GetObjectId()) { + if (p_action->GetUnknown24() == -2 || p_action->GetUnknown24() == -3 || + p_action->GetUnknown24() == (*it)->GetUnknown24()) { + found = *it; + if (p_action->GetUnknown24() != -3) { + break; + } + } + } + } + + if (p_delete && found != NULL) { + erase(it); + } + + return found; +} + // FUNCTION: LEGO1 0x100bfb30 // FUNCTION: BETA10 0x10147f35 MxDSObject* DeserializeDSObjectDispatch(MxU8*& p_source, MxS16 p_flags) diff --git a/LEGO1/omni/src/main/mxomni.cpp b/LEGO1/omni/src/main/mxomni.cpp index 883aa008a4..d7e79bb04b 100644 --- a/LEGO1/omni/src/main/mxomni.cpp +++ b/LEGO1/omni/src/main/mxomni.cpp @@ -340,7 +340,7 @@ MxLong MxOmni::HandleEndAction(MxParam& p_param) MxStreamController* controller = Streamer()->GetOpenStream(action->GetAtomId().GetInternal()); if (controller != NULL) { - action = controller->GetUnk0x54().Find(action); + action = (MxDSAction*) controller->GetUnk0x54().Find(action); if (action) { if (ActionSourceEquals(action, "LegoLoopingAnimPresenter") == FALSE) { delete controller->GetUnk0x54().FindAndErase(action); @@ -399,9 +399,9 @@ void MxOmni::SetSound3D(MxBool p_use3dSound) MxBool MxOmni::DoesEntityExist(MxDSAction& p_dsAction) { if (m_streamer->FUN_100b9b30(p_dsAction)) { - MxNotificationPtrList* queue = m_notificationManager->GetQueue(); + MxNotificationPtrList* notifications = m_notificationManager->GetQueue(); - if (!queue || queue->size() == 0) { + if (!notifications || notifications->size() == 0) { return TRUE; } } diff --git a/LEGO1/omni/src/stream/mxdiskstreamcontroller.cpp b/LEGO1/omni/src/stream/mxdiskstreamcontroller.cpp index 2e7407647e..c1341877a3 100644 --- a/LEGO1/omni/src/stream/mxdiskstreamcontroller.cpp +++ b/LEGO1/omni/src/stream/mxdiskstreamcontroller.cpp @@ -35,9 +35,9 @@ MxDiskStreamController::~MxDiskStreamController() #endif } - MxDSAction* action; - while (m_unk0x3c.PopFront(action)) { - delete action; + MxDSObject* object; + while (m_unk0x3c.PopFront(object)) { + delete object; } if (m_provider) { @@ -47,12 +47,12 @@ MxDiskStreamController::~MxDiskStreamController() FUN_100c8720(); - while (m_list0x80.PopFront(action)) { - FUN_100c7cb0((MxDSStreamingAction*) action); + while (m_list0x80.PopFront(object)) { + FUN_100c7cb0((MxDSStreamingAction*) object); } - while (m_list0x64.PopFront(action)) { - FUN_100c7cb0((MxDSStreamingAction*) action); + while (m_list0x64.PopFront(object)) { + FUN_100c7cb0((MxDSStreamingAction*) object); } while (!m_list0x74.empty()) { @@ -162,7 +162,7 @@ void MxDiskStreamController::FUN_100c7980() MxDSStreamingAction* MxDiskStreamController::VTable0x28() { AUTOLOCK(m_criticalSection); - MxDSAction* oldAction; + MxDSObject* oldAction; MxDSStreamingAction* result = NULL; MxU32 filesize = m_provider->GetFileSize(); @@ -252,10 +252,9 @@ MxDSStreamingAction* MxDiskStreamController::FUN_100c7db0() { AUTOLOCK(m_criticalSection); - for (MxStreamListMxNextActionDataStart::iterator it = m_nextActionList.begin(); it != m_nextActionList.end(); - it++) { + for (MxNextActionDataStartList::iterator it = m_nextActionList.begin(); it != m_nextActionList.end(); it++) { MxNextActionDataStart* data = *it; - for (MxStreamListMxDSAction::iterator it2 = m_list0x64.begin(); it2 != m_list0x64.end(); it2++) { + for (MxDSObjectList::iterator it2 = m_list0x64.begin(); it2 != m_list0x64.end(); it2++) { MxDSStreamingAction* streamingAction = (MxDSStreamingAction*) *it2; if (streamingAction->GetObjectId() == data->GetObjectId() && streamingAction->GetUnknown24() == data->GetUnknown24() && @@ -320,7 +319,7 @@ void MxDiskStreamController::FUN_100c8120(MxDSAction* p_action) } while (TRUE) { - MxDSAction* found = m_unk0x54.FindAndErase(p_action); + MxDSObject* found = m_unk0x54.FindAndErase(p_action); if (!found) { break; } diff --git a/LEGO1/omni/src/stream/mxdiskstreamprovider.cpp b/LEGO1/omni/src/stream/mxdiskstreamprovider.cpp index 1f7dba15db..eb6cbc546c 100644 --- a/LEGO1/omni/src/stream/mxdiskstreamprovider.cpp +++ b/LEGO1/omni/src/stream/mxdiskstreamprovider.cpp @@ -38,15 +38,15 @@ MxResult MxDiskStreamProviderThread::StartWithTarget(MxDiskStreamProvider* p_tar // FUNCTION: LEGO1 0x100d0f70 MxDiskStreamProvider::MxDiskStreamProvider() { - this->m_pFile = NULL; - this->m_remainingWork = FALSE; - this->m_unk0x35 = FALSE; + m_pFile = NULL; + m_remainingWork = FALSE; + m_unk0x35 = FALSE; } // FUNCTION: LEGO1 0x100d1240 MxDiskStreamProvider::~MxDiskStreamProvider() { - MxDSStreamingAction* action; + MxDSObject* action; m_unk0x35 = FALSE; do { @@ -54,18 +54,18 @@ MxDiskStreamProvider::~MxDiskStreamProvider() { AUTOLOCK(m_criticalSection); - m_list.PopFrontStreamingAction(action); + m_list.PopFront(action); } if (!action) { break; } - if (action->GetUnknowna0()->GetWriteOffset() < 0x20000) { + if (((MxDSStreamingAction*) action)->GetUnknowna0()->GetWriteOffset() < 0x20000) { g_unk0x10102878--; } - ((MxDiskStreamController*) m_pLookup)->FUN_100c8670(action); + ((MxDiskStreamController*) m_pLookup)->FUN_100c8670((MxDSStreamingAction*) action); } while (action); if (m_remainingWork) { @@ -116,7 +116,7 @@ MxResult MxDiskStreamProvider::SetResourceToGet(MxStreamController* p_resource) // FUNCTION: LEGO1 0x100d15e0 void MxDiskStreamProvider::VTable0x20(MxDSAction* p_action) { - MxDSStreamingAction* action; + MxDSObject* action; if (p_action->GetObjectId() == -1) { m_unk0x35 = FALSE; @@ -126,18 +126,18 @@ void MxDiskStreamProvider::VTable0x20(MxDSAction* p_action) { AUTOLOCK(m_criticalSection); - m_list.PopFrontStreamingAction(action); + m_list.PopFront(action); } if (!action) { return; } - if (action->GetUnknowna0()->GetWriteOffset() < 0x20000) { + if (((MxDSStreamingAction*) action)->GetUnknowna0()->GetWriteOffset() < 0x20000) { g_unk0x10102878--; } - ((MxDiskStreamController*) m_pLookup)->FUN_100c8670(action); + ((MxDiskStreamController*) m_pLookup)->FUN_100c8670((MxDSStreamingAction*) action); } while (action); } else { @@ -151,11 +151,11 @@ void MxDiskStreamProvider::VTable0x20(MxDSAction* p_action) return; } - if (action->GetUnknowna0()->GetWriteOffset() < 0x20000) { + if (((MxDSStreamingAction*) action)->GetUnknowna0()->GetWriteOffset() < 0x20000) { g_unk0x10102878--; } - ((MxDiskStreamController*) m_pLookup)->FUN_100c8670(action); + ((MxDiskStreamController*) m_pLookup)->FUN_100c8670((MxDSStreamingAction*) action); } while (action); } } @@ -213,14 +213,14 @@ MxResult MxDiskStreamProvider::FUN_100d1780(MxDSStreamingAction* p_action) void MxDiskStreamProvider::PerformWork() { MxDiskStreamController* controller = (MxDiskStreamController*) m_pLookup; - MxDSStreamingAction* streamingAction = NULL; + MxDSObject* streamingAction = NULL; { AUTOLOCK(m_criticalSection); if (!m_list.empty()) { - streamingAction = (MxDSStreamingAction*) m_list.front(); + streamingAction = m_list.front(); - if (streamingAction && !FUN_100d1af0(streamingAction)) { + if (streamingAction && !FUN_100d1af0((MxDSStreamingAction*) streamingAction)) { m_thread.Sleep(500); m_busySemaphore.Release(1); return; @@ -233,33 +233,33 @@ void MxDiskStreamProvider::PerformWork() { AUTOLOCK(m_criticalSection); - if (!m_list.PopFrontStreamingAction(streamingAction)) { + if (!m_list.PopFront(streamingAction)) { goto done; } } - if (streamingAction->GetUnknowna0()->GetWriteOffset() < 0x20000) { + if (((MxDSStreamingAction*) streamingAction)->GetUnknowna0()->GetWriteOffset() < 0x20000) { g_unk0x10102878--; } - buffer = streamingAction->GetUnknowna0(); + buffer = ((MxDSStreamingAction*) streamingAction)->GetUnknowna0(); - if (m_pFile->GetPosition() == streamingAction->GetBufferOffset() || - m_pFile->Seek(streamingAction->GetBufferOffset(), SEEK_SET) == 0) { + if (m_pFile->GetPosition() == ((MxDSStreamingAction*) streamingAction)->GetBufferOffset() || + m_pFile->Seek(((MxDSStreamingAction*) streamingAction)->GetBufferOffset(), SEEK_SET) == 0) { buffer->SetUnknown14(m_pFile->GetPosition()); if (m_pFile->ReadToBuffer(buffer) == SUCCESS) { buffer->SetUnknown1c(m_pFile->GetPosition()); - if (streamingAction->GetUnknown9c() > 0) { - FUN_100d1b20(streamingAction); + if (((MxDSStreamingAction*) streamingAction)->GetUnknown9c() > 0) { + FUN_100d1b20(((MxDSStreamingAction*) streamingAction)); } else { if (m_pLookup == NULL || !((MxDiskStreamController*) m_pLookup)->GetUnk0xc4()) { - controller->FUN_100c8670(streamingAction); + controller->FUN_100c8670(((MxDSStreamingAction*) streamingAction)); } else { - controller->FUN_100c7f40(streamingAction); + controller->FUN_100c7f40(((MxDSStreamingAction*) streamingAction)); } } @@ -269,7 +269,7 @@ void MxDiskStreamProvider::PerformWork() done: if (streamingAction) { - controller->FUN_100c8670(streamingAction); + controller->FUN_100c8670(((MxDSStreamingAction*) streamingAction)); } m_thread.Sleep(0); diff --git a/LEGO1/omni/src/stream/mxdssubscriber.cpp b/LEGO1/omni/src/stream/mxdssubscriber.cpp index 8900ff6945..36051667ac 100644 --- a/LEGO1/omni/src/stream/mxdssubscriber.cpp +++ b/LEGO1/omni/src/stream/mxdssubscriber.cpp @@ -2,7 +2,8 @@ #include "mxstreamcontroller.h" -DECOMP_SIZE_ASSERT(MxDSSubscriber, 0x4c); +DECOMP_SIZE_ASSERT(MxDSSubscriber, 0x4c) +DECOMP_SIZE_ASSERT(MxDSSubscriberList, 0x0c) // FUNCTION: LEGO1 0x100b7bb0 MxDSSubscriber::MxDSSubscriber() @@ -135,3 +136,18 @@ void MxDSSubscriber::FreeDataChunk(MxStreamChunk* p_chunk) } } } + +// FUNCTION: LEGO1 0x100b8450 +// FUNCTION: BETA10 0x10134c1d +MxDSSubscriber* MxDSSubscriberList::Find(MxDSObject* p_object) +{ + for (iterator it = begin(); it != end(); it++) { + if (p_object->GetObjectId() == -1 || p_object->GetObjectId() == (*it)->GetObjectId()) { + if (p_object->GetUnknown24() == -2 || p_object->GetUnknown24() == (*it)->GetUnknown48()) { + return *it; + } + } + } + + return NULL; +} diff --git a/LEGO1/omni/src/stream/mxramstreamcontroller.cpp b/LEGO1/omni/src/stream/mxramstreamcontroller.cpp index 46d11196c3..c856d69532 100644 --- a/LEGO1/omni/src/stream/mxramstreamcontroller.cpp +++ b/LEGO1/omni/src/stream/mxramstreamcontroller.cpp @@ -43,7 +43,7 @@ MxResult MxRAMStreamController::VTable0x20(MxDSAction* p_action) if (p_action->GetUnknown24() == -1) { p_action->SetUnknown24(-3); - MxDSAction* action = m_unk0x54.Find(p_action); + MxDSObject* action = m_unk0x54.Find(p_action); if (action != NULL) { unk0x24 = action->GetUnknown24() + 1; } diff --git a/LEGO1/omni/src/stream/mxramstreamprovider.cpp b/LEGO1/omni/src/stream/mxramstreamprovider.cpp index d655c16f30..2b0625045a 100644 --- a/LEGO1/omni/src/stream/mxramstreamprovider.cpp +++ b/LEGO1/omni/src/stream/mxramstreamprovider.cpp @@ -6,7 +6,8 @@ #include "mxomni.h" #include "mxstreamcontroller.h" -DECOMP_SIZE_ASSERT(MxRAMStreamProvider, 0x24); +DECOMP_SIZE_ASSERT(MxStreamProvider, 0x10) +DECOMP_SIZE_ASSERT(MxRAMStreamProvider, 0x24) // FUNCTION: LEGO1 0x100d0730 MxRAMStreamProvider::MxRAMStreamProvider() diff --git a/LEGO1/omni/src/stream/mxstreamchunk.cpp b/LEGO1/omni/src/stream/mxstreamchunk.cpp index 4cf4fe4bb6..24c134452b 100644 --- a/LEGO1/omni/src/stream/mxstreamchunk.cpp +++ b/LEGO1/omni/src/stream/mxstreamchunk.cpp @@ -1,7 +1,7 @@ #include "mxstreamchunk.h" #include "mxdsbuffer.h" -#include "mxstreamlist.h" +#include "mxdssubscriber.h" #include "mxutilities.h" // FUNCTION: LEGO1 0x100c2fe0 @@ -58,9 +58,9 @@ MxU32 MxStreamChunk::ReadChunkHeader(MxU8* p_chunkData) // FUNCTION: LEGO1 0x100c30e0 // FUNCTION: BETA10 0x10151517 -MxResult MxStreamChunk::SendChunk(MxStreamListMxDSSubscriber& p_subscriberList, MxBool p_append, MxS16 p_obj24val) +MxResult MxStreamChunk::SendChunk(MxDSSubscriberList& p_subscriberList, MxBool p_append, MxS16 p_obj24val) { - for (MxStreamListMxDSSubscriber::iterator it = p_subscriberList.begin(); it != p_subscriberList.end(); it++) { + for (MxDSSubscriberList::iterator it = p_subscriberList.begin(); it != p_subscriberList.end(); it++) { if ((*it)->GetObjectId() == m_objectId && (*it)->GetUnknown48() == p_obj24val) { if (m_flags & DS_CHUNK_END_OF_STREAM && m_buffer) { m_buffer->ReleaseRef(this); diff --git a/LEGO1/omni/src/stream/mxstreamcontroller.cpp b/LEGO1/omni/src/stream/mxstreamcontroller.cpp index 35b1315cb9..af0dd84b91 100644 --- a/LEGO1/omni/src/stream/mxstreamcontroller.cpp +++ b/LEGO1/omni/src/stream/mxstreamcontroller.cpp @@ -14,24 +14,7 @@ DECOMP_SIZE_ASSERT(MxStreamController, 0x64) DECOMP_SIZE_ASSERT(MxNextActionDataStart, 0x14) - -// FUNCTION: LEGO1 0x100b9400 -MxResult MxStreamController::VTable0x18(undefined4, undefined4) -{ - return FAILURE; -} - -// FUNCTION: LEGO1 0x100b9410 -MxResult MxStreamController::VTable0x1c(undefined4, undefined4) -{ - return FAILURE; -} - -// FUNCTION: LEGO1 0x100b9420 -MxDSStreamingAction* MxStreamController::VTable0x28() -{ - return NULL; -} +DECOMP_SIZE_ASSERT(MxNextActionDataStartList, 0x0c) // FUNCTION: LEGO1 0x100c0b90 MxStreamController::MxStreamController() @@ -53,7 +36,7 @@ MxStreamController::~MxStreamController() delete subscriber; } - MxDSAction* action; + MxDSObject* action; while (m_unk0x3c.PopFront(action)) { delete action; } @@ -135,7 +118,7 @@ MxResult MxStreamController::VTable0x24(MxDSAction* p_action) { AUTOLOCK(m_criticalSection); VTable0x30(p_action); - m_action0x60 = m_unk0x54.FindAndErase(p_action); + m_action0x60 = (MxDSAction*) m_unk0x54.FindAndErase(p_action); if (m_action0x60 == NULL) { return FAILURE; } @@ -166,8 +149,8 @@ MxResult MxStreamController::FUN_100c1a00(MxDSAction* p_action, MxU32 p_offset) MxS16 newUnknown24 = -1; // These loops might be a template function in the list classes - for (MxStreamListMxDSAction::iterator it = m_unk0x54.begin(); it != m_unk0x54.end(); it++) { - MxDSAction* action = *it; + for (MxDSObjectList::iterator it = m_unk0x54.begin(); it != m_unk0x54.end(); it++) { + MxDSObject* action = *it; if (action->GetObjectId() == p_action->GetObjectId()) { newUnknown24 = Max(newUnknown24, action->GetUnknown24()); @@ -175,8 +158,8 @@ MxResult MxStreamController::FUN_100c1a00(MxDSAction* p_action, MxU32 p_offset) } if (newUnknown24 == -1) { - for (MxStreamListMxDSAction::iterator it = m_unk0x3c.begin(); it != m_unk0x3c.end(); it++) { - MxDSAction* action = *it; + for (MxDSObjectList::iterator it = m_unk0x3c.begin(); it != m_unk0x3c.end(); it++) { + MxDSObject* action = *it; if (action->GetObjectId() == p_action->GetObjectId()) { newUnknown24 = Max(newUnknown24, action->GetUnknown24()); @@ -184,8 +167,7 @@ MxResult MxStreamController::FUN_100c1a00(MxDSAction* p_action, MxU32 p_offset) } if (newUnknown24 == -1) { - for (MxStreamListMxDSSubscriber::iterator it = m_subscriberList.begin(); it != m_subscriberList.end(); - it++) { + for (MxDSSubscriberList::iterator it = m_subscriberList.begin(); it != m_subscriberList.end(); it++) { MxDSSubscriber* subscriber = *it; if (subscriber->GetObjectId() == p_action->GetObjectId()) { @@ -235,7 +217,7 @@ MxResult MxStreamController::VTable0x30(MxDSAction* p_action) { AUTOLOCK(m_criticalSection); MxResult result = FAILURE; - MxDSAction* action = m_unk0x3c.FindAndErase(p_action); + MxDSObject* action = m_unk0x3c.FindAndErase(p_action); if (action != NULL) { MxNextActionDataStart* data = m_nextActionList.FindAndErase(action->GetObjectId(), action->GetUnknown24()); delete action; @@ -266,7 +248,7 @@ MxPresenter* MxStreamController::FUN_100c1e70(MxDSAction& p_action) AUTOLOCK(m_criticalSection); MxPresenter* result = NULL; if (p_action.GetObjectId() != -1) { - MxDSAction* action = m_unk0x3c.Find(&p_action); + MxDSObject* action = m_unk0x3c.Find(&p_action); if (action != NULL) { result = action->GetUnknown28(); } @@ -344,3 +326,33 @@ MxBool MxStreamController::IsStoped(MxDSObject* p_obj) return TRUE; } + +// FUNCTION: LEGO1 0x100c21e0 +// FUNCTION: BETA10 0x1014f4e6 +MxNextActionDataStart* MxNextActionDataStartList::Find(MxU32 p_id, MxS16 p_value) +{ + for (iterator it = begin(); it != end(); it++) { + if (p_id == (*it)->GetObjectId() && p_value == (*it)->GetUnknown24()) { + return *it; + } + } + + return NULL; +} + +// FUNCTION: LEGO1 0x100c2240 +// FUNCTION: BETA10 0x1014f58c +MxNextActionDataStart* MxNextActionDataStartList::FindAndErase(MxU32 p_id, MxS16 p_value) +{ + MxNextActionDataStart* match = NULL; + + for (iterator it = begin(); it != end(); it++) { + if (p_id == (*it)->GetObjectId() && (p_value == -2 || p_value == (*it)->GetUnknown24())) { + match = *it; + erase(it); + break; + } + } + + return match; +} diff --git a/LEGO1/omni/src/stream/mxstreamer.cpp b/LEGO1/omni/src/stream/mxstreamer.cpp index c3a64cf9c6..bb5f1cb530 100644 --- a/LEGO1/omni/src/stream/mxstreamer.cpp +++ b/LEGO1/omni/src/stream/mxstreamer.cpp @@ -2,6 +2,7 @@ #include "mxdebug.h" #include "mxdiskstreamcontroller.h" +#include "mxdsaction.h" #include "mxmisc.h" #include "mxnotificationmanager.h" #include "mxramstreamcontroller.h" diff --git a/LEGO1/omni/src/stream/mxstreamlist.cpp b/LEGO1/omni/src/stream/mxstreamlist.cpp deleted file mode 100644 index 37e594634b..0000000000 --- a/LEGO1/omni/src/stream/mxstreamlist.cpp +++ /dev/null @@ -1,83 +0,0 @@ -#include "mxstreamlist.h" - -// Wrappers around STL list that are used by the MxStream* classes. -DECOMP_SIZE_ASSERT(MxStreamListMxDSAction, 0x0c); -DECOMP_SIZE_ASSERT(MxStreamListMxNextActionDataStart, 0x0c); -DECOMP_SIZE_ASSERT(MxStreamListMxDSSubscriber, 0x0c); - -// FUNCTION: LEGO1 0x100b8450 -// FUNCTION: BETA10 0x10134c1d -MxDSSubscriber* MxStreamListMxDSSubscriber::Find(MxDSObject* p_object) -{ - for (iterator it = begin(); it != end(); it++) { - if (p_object->GetObjectId() == -1 || p_object->GetObjectId() == (*it)->GetObjectId()) { - if (p_object->GetUnknown24() == -2 || p_object->GetUnknown24() == (*it)->GetUnknown48()) { - return *it; - } - } - } - - return NULL; -} - -// FUNCTION: LEGO1 0x100bfa80 -// FUNCTION: BETA10 0x10147e02 -MxDSAction* MxStreamListMxDSAction::FindInternal(MxDSAction* p_action, MxBool p_delete) -{ - // DECOMP ALPHA 0x1008b99d ? - - MxDSAction* found = NULL; - -#ifdef COMPAT_MODE - iterator it; - for (it = begin(); it != end(); it++) { -#else - for (iterator it = begin(); it != end(); it++) { -#endif - if (p_action->GetObjectId() == -1 || p_action->GetObjectId() == (*it)->GetObjectId()) { - if (p_action->GetUnknown24() == -2 || p_action->GetUnknown24() == -3 || - p_action->GetUnknown24() == (*it)->GetUnknown24()) { - found = *it; - if (p_action->GetUnknown24() != -3) { - break; - } - } - } - } - - if (p_delete && found != NULL) { - erase(it); - } - - return found; -} - -// FUNCTION: LEGO1 0x100c21e0 -// FUNCTION: BETA10 0x1014f4e6 -MxNextActionDataStart* MxStreamListMxNextActionDataStart::Find(MxU32 p_id, MxS16 p_value) -{ - for (iterator it = begin(); it != end(); it++) { - if (p_id == (*it)->GetObjectId() && p_value == (*it)->GetUnknown24()) { - return *it; - } - } - - return NULL; -} - -// FUNCTION: LEGO1 0x100c2240 -// FUNCTION: BETA10 0x1014f58c -MxNextActionDataStart* MxStreamListMxNextActionDataStart::FindAndErase(MxU32 p_id, MxS16 p_value) -{ - MxNextActionDataStart* match = NULL; - - for (iterator it = begin(); it != end(); it++) { - if (p_id == (*it)->GetObjectId() && (p_value == -2 || p_value == (*it)->GetUnknown24())) { - match = *it; - erase(it); - break; - } - } - - return match; -} diff --git a/LEGO1/omni/src/stream/mxstreamprovider.cpp b/LEGO1/omni/src/stream/mxstreamprovider.cpp deleted file mode 100644 index 740b2c6576..0000000000 --- a/LEGO1/omni/src/stream/mxstreamprovider.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "mxstreamprovider.h" - -#include "decomp.h" - -DECOMP_SIZE_ASSERT(MxStreamProvider, 0x10); - -// FUNCTION: LEGO1 0x100d07c0 -MxResult MxStreamProvider::SetResourceToGet(MxStreamController* p_resource) -{ - m_pLookup = p_resource; - return SUCCESS; -} - -// FUNCTION: LEGO1 0x100d07d0 -void MxStreamProvider::VTable0x20(MxDSAction* p_action) -{ -} diff --git a/LEGO1/omni/src/video/mxsmkpresenter.cpp b/LEGO1/omni/src/video/mxsmkpresenter.cpp index 1ac6bd1ee8..6e38c43d65 100644 --- a/LEGO1/omni/src/video/mxsmkpresenter.cpp +++ b/LEGO1/omni/src/video/mxsmkpresenter.cpp @@ -72,15 +72,15 @@ void MxSmkPresenter::LoadFrame(MxStreamChunk* p_chunk) m_currentFrame++; VTable0x88(); - MxRectList list(TRUE); - MxSmack::LoadFrame(bitmapInfo, bitmapData, &m_mxSmack, chunkData, paletteChanged, &list); + MxRectList rects(TRUE); + MxSmack::LoadFrame(bitmapInfo, bitmapData, &m_mxSmack, chunkData, paletteChanged, &rects); if (((MxDSMediaAction*) m_action)->GetPaletteManagement() && paletteChanged) { RealizePalette(); } MxRect32 invalidateRect; - MxRectListCursor cursor(&list); + MxRectListCursor cursor(&rects); MxRect32* rect; while (cursor.Next(rect)) {