mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-22 16:04:17 +00:00
Refactor MxStreamList
based lists (#1260)
* Refactor stream lists * Fix naming * Fix header inclusion * Fix annotations * Move function definitions to header * Remove mxstreamprovider.cpp * Naming
This commit is contained in:

committed by
GitHub

parent
48c327ca5a
commit
5b19d7953a
@@ -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
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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<char*>((*it).first);
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -53,15 +53,15 @@ public:
|
||||
void FUN_100c8670(MxDSStreamingAction* p_streamingAction);
|
||||
|
||||
private:
|
||||
MxStreamListMxDSAction m_list0x64; // 0x64
|
||||
MxBool m_unk0x70; // 0x70
|
||||
list<MxDSBuffer*> 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<MxDSBuffer*> 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 @@ private:
|
||||
};
|
||||
|
||||
// TEMPLATE: LEGO1 0x100c14d0
|
||||
// list<MxDSAction *,allocator<MxDSAction *> >::erase
|
||||
// list<MxDSObject *,allocator<MxDSObject *> >::erase
|
||||
|
||||
// TEMPLATE: LEGO1 0x100c7330
|
||||
// list<MxDSAction *,allocator<MxDSAction *> >::_Buynode
|
||||
// list<MxDSObject *,allocator<MxDSObject *> >::_Buynode
|
||||
|
||||
// TEMPLATE: LEGO1 0x100c7420
|
||||
// list<MxDSBuffer *,allocator<MxDSBuffer *> >::~list<MxDSBuffer *,allocator<MxDSBuffer *> >
|
||||
|
@@ -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 @@ private:
|
||||
MxBool m_remainingWork; // 0x34
|
||||
MxBool m_unk0x35; // 0x35
|
||||
MxCriticalSection m_criticalSection; // 0x38
|
||||
MxStreamListMxDSAction m_list; // 0x54
|
||||
MxDSObjectList m_list; // 0x54
|
||||
};
|
||||
|
||||
// SYNTHETIC: LEGO1 0x100d10a0
|
||||
|
@@ -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<MxDSObject*> {
|
||||
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 @@ protected:
|
||||
MxDSObject* DeserializeDSObjectDispatch(MxU8*&, MxS16);
|
||||
MxDSObject* CreateStreamObject(MxDSFile*, MxS16);
|
||||
|
||||
// TEMPLATE: BETA10 0x10150950
|
||||
// MxUtilityList<MxDSObject *>::PopFront
|
||||
|
||||
#endif // MXDSOBJECT_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<MxDSSubscriber*> {
|
||||
public:
|
||||
MxDSSubscriber* Find(MxDSObject* p_object);
|
||||
};
|
||||
|
||||
// VTABLE: LEGO1 0x100dc698
|
||||
// VTABLE: BETA10 0x101c1d38
|
||||
// SIZE 0x4c
|
||||
@@ -58,4 +67,7 @@ private:
|
||||
// TEMPLATE: LEGO1 0x100b7d00
|
||||
// MxStreamChunkList::~MxStreamChunkList
|
||||
|
||||
// TEMPLATE: BETA10 0x10150a70
|
||||
// MxUtilityList<MxDSSubscriber *>::PopFront
|
||||
|
||||
#endif // MXDSSUBSCRIBER_H
|
||||
|
@@ -4,7 +4,7 @@
|
||||
#include "mxdschunk.h"
|
||||
|
||||
class MxDSBuffer;
|
||||
class MxStreamListMxDSSubscriber;
|
||||
class MxDSSubscriberList;
|
||||
|
||||
// VTABLE: LEGO1 0x100dc2a8
|
||||
// VTABLE: BETA10 0x101c1d20
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
|
||||
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);
|
||||
|
@@ -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<MxNextActionDataStart*> {
|
||||
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 @@ public:
|
||||
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 @@ public:
|
||||
|
||||
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<MxDSAction *,allocator<MxDSAction *> >::~list<MxDSAction *,allocator<MxDSAction *> >
|
||||
// list<MxDSObject *,allocator<MxDSObject *> >::~list<MxDSObject *,allocator<MxDSObject *> >
|
||||
|
||||
// TEMPLATE: LEGO1 0x100c0dd0
|
||||
// list<MxDSSubscriber *,allocator<MxDSSubscriber *> >::~list<MxDSSubscriber *,allocator<MxDSSubscriber *> >
|
||||
@@ -92,33 +109,33 @@ protected:
|
||||
// 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<MxDSSubscriber *>::~MxStreamList<MxDSSubscriber *>
|
||||
// MxUtilityList<MxDSSubscriber *>::~MxUtilityList<MxDSSubscriber *>
|
||||
|
||||
// TEMPLATE: LEGO1 0x100c1100
|
||||
// MxStreamList<MxDSAction *>::~MxStreamList<MxDSAction *>
|
||||
// MxUtilityList<MxDSObject *>::~MxUtilityList<MxDSObject *>
|
||||
|
||||
// TEMPLATE: LEGO1 0x100c1150
|
||||
// MxStreamList<MxNextActionDataStart *>::~MxStreamList<MxNextActionDataStart *>
|
||||
// MxUtilityList<MxNextActionDataStart *>::~MxUtilityList<MxNextActionDataStart *>
|
||||
|
||||
// TEMPLATE: LEGO1 0x100c11a0
|
||||
// List<MxDSSubscriber *>::~List<MxDSSubscriber *>
|
||||
|
||||
// TEMPLATE: LEGO1 0x100c11f0
|
||||
// List<MxDSAction *>::~List<MxDSAction *>
|
||||
// List<MxDSObject *>::~List<MxDSObject *>
|
||||
|
||||
// TEMPLATE: LEGO1 0x100c1240
|
||||
// List<MxNextActionDataStart *>::~List<MxNextActionDataStart *>
|
||||
|
||||
// TEMPLATE: LEGO1 0x100c1bc0
|
||||
// list<MxDSAction *,allocator<MxDSAction *> >::insert
|
||||
// list<MxDSObject *,allocator<MxDSObject *> >::insert
|
||||
|
||||
#endif // MXSTREAMCONTROLLER_H
|
||||
|
@@ -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 T>
|
||||
class MxStreamList : public list<T> {
|
||||
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<MxDSAction*> {
|
||||
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<MxNextActionDataStart*> {
|
||||
public:
|
||||
MxNextActionDataStart* Find(MxU32 p_id, MxS16 p_value);
|
||||
MxNextActionDataStart* FindAndErase(MxU32 p_id, MxS16 p_value);
|
||||
};
|
||||
|
||||
// SIZE 0x0c
|
||||
class MxStreamListMxDSSubscriber : public MxStreamList<MxDSSubscriber*> {
|
||||
public:
|
||||
MxDSSubscriber* Find(MxDSObject* p_object);
|
||||
};
|
||||
|
||||
// TEMPLATE: BETA10 0x10150950
|
||||
// MxStreamList<MxDSAction *>::PopFront
|
||||
|
||||
// TEMPLATE: BETA10 0x10150a70
|
||||
// MxStreamList<MxDSSubscriber *>::PopFront
|
||||
|
||||
#endif // MXSTREAMLIST_H
|
@@ -28,12 +28,21 @@ public:
|
||||
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
|
||||
|
23
LEGO1/omni/include/mxutilitylist.h
Normal file
23
LEGO1/omni/include/mxutilitylist.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef MXUTILITYLIST_H
|
||||
#define MXUTILITYLIST_H
|
||||
|
||||
#include "mxstl/stlcompat.h"
|
||||
|
||||
// Probably should be defined somewhere else
|
||||
|
||||
template <class T>
|
||||
class MxUtilityList : public list<T> {
|
||||
public:
|
||||
MxBool PopFront(T& p_obj)
|
||||
{
|
||||
if (this->empty()) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
p_obj = this->front();
|
||||
this->pop_front();
|
||||
return TRUE;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // MXUTILITYLIST_H
|
@@ -17,7 +17,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
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)
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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 @@ done:
|
||||
// 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);
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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()
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "mxdebug.h"
|
||||
#include "mxdiskstreamcontroller.h"
|
||||
#include "mxdsaction.h"
|
||||
#include "mxmisc.h"
|
||||
#include "mxnotificationmanager.h"
|
||||
#include "mxramstreamcontroller.h"
|
||||
|
@@ -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;
|
||||
}
|
@@ -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)
|
||||
{
|
||||
}
|
@@ -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)) {
|
||||
|
Reference in New Issue
Block a user