mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-24 08:54:15 +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
@@ -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
|
||||
Reference in New Issue
Block a user