mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 16:34:06 +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/mxstreamchunk.cpp
|
||||||
LEGO1/omni/src/stream/mxstreamcontroller.cpp
|
LEGO1/omni/src/stream/mxstreamcontroller.cpp
|
||||||
LEGO1/omni/src/stream/mxstreamer.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/mxautolock.cpp
|
||||||
LEGO1/omni/src/system/mxcriticalsection.cpp
|
LEGO1/omni/src/system/mxcriticalsection.cpp
|
||||||
LEGO1/omni/src/system/mxscheduler.cpp
|
LEGO1/omni/src/system/mxscheduler.cpp
|
||||||
|
@@ -404,13 +404,13 @@ LegoROI* LegoAnimPresenter::FUN_100699e0(const LegoChar* p_und)
|
|||||||
// FUNCTION: LEGO1 0x10069b10
|
// FUNCTION: LEGO1 0x10069b10
|
||||||
void LegoAnimPresenter::FUN_10069b10()
|
void LegoAnimPresenter::FUN_10069b10()
|
||||||
{
|
{
|
||||||
LegoAnimStructMap map;
|
LegoAnimStructMap anims;
|
||||||
|
|
||||||
if (m_unk0x8c != NULL) {
|
if (m_unk0x8c != NULL) {
|
||||||
memset(m_unk0x8c, 0, m_unk0x94 * sizeof(*m_unk0x8c));
|
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) {
|
if (m_roiMap != NULL) {
|
||||||
delete[] m_roiMap;
|
delete[] m_roiMap;
|
||||||
@@ -418,10 +418,10 @@ void LegoAnimPresenter::FUN_10069b10()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_roiMapSize = 0;
|
m_roiMapSize = 0;
|
||||||
m_roiMap = new LegoROI*[map.size() + 1];
|
m_roiMap = new LegoROI*[anims.size() + 1];
|
||||||
memset(m_roiMap, 0, (map.size() + 1) * sizeof(*m_roiMap));
|
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;
|
MxU32 index = (*it).second.m_index;
|
||||||
m_roiMap[index] = (*it).second.m_roi;
|
m_roiMap[index] = (*it).second.m_roi;
|
||||||
|
|
||||||
|
@@ -143,18 +143,18 @@ void LegoHideAnimPresenter::FUN_1006db60(LegoTreeNode* p_node, LegoTime p_time)
|
|||||||
// FUNCTION: BETA10 0x100532fd
|
// FUNCTION: BETA10 0x100532fd
|
||||||
void LegoHideAnimPresenter::FUN_1006dc10()
|
void LegoHideAnimPresenter::FUN_1006dc10()
|
||||||
{
|
{
|
||||||
LegoHideAnimStructMap map;
|
LegoHideAnimStructMap anims;
|
||||||
|
|
||||||
FUN_1006e3f0(map, m_anim->GetRoot());
|
FUN_1006e3f0(anims, m_anim->GetRoot());
|
||||||
|
|
||||||
if (m_boundaryMap != NULL) {
|
if (m_boundaryMap != NULL) {
|
||||||
delete[] m_boundaryMap;
|
delete[] m_boundaryMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_boundaryMap = new LegoPathBoundary*[map.size() + 1];
|
m_boundaryMap = new LegoPathBoundary*[anims.size() + 1];
|
||||||
m_boundaryMap[0] = NULL;
|
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;
|
m_boundaryMap[(*it).second.m_index] = (*it).second.m_boundary;
|
||||||
delete[] const_cast<char*>((*it).first);
|
delete[] const_cast<char*>((*it).first);
|
||||||
}
|
}
|
||||||
|
@@ -576,12 +576,12 @@ MxLong RegistrationBook::HandlePathStruct(LegoPathStructNotificationParam& p_par
|
|||||||
// FUNCTION: LEGO1 0x10078350
|
// FUNCTION: LEGO1 0x10078350
|
||||||
MxBool RegistrationBook::CreateSurface()
|
MxBool RegistrationBook::CreateSurface()
|
||||||
{
|
{
|
||||||
MxCompositePresenterList* list = m_checkmark[0]->GetList();
|
MxCompositePresenterList* presenters = m_checkmark[0]->GetList();
|
||||||
MxStillPresenter *presenter, *uninitialized;
|
MxStillPresenter *presenter, *uninitialized;
|
||||||
|
|
||||||
if (list) {
|
if (presenters) {
|
||||||
if (list->begin() != list->end()) {
|
if (presenters->begin() != presenters->end()) {
|
||||||
presenter = (MxStillPresenter*) list->front();
|
presenter = (MxStillPresenter*) presenters->front();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
presenter = uninitialized; // intentionally uninitialized variable
|
presenter = uninitialized; // intentionally uninitialized variable
|
||||||
|
@@ -53,15 +53,15 @@ public:
|
|||||||
void FUN_100c8670(MxDSStreamingAction* p_streamingAction);
|
void FUN_100c8670(MxDSStreamingAction* p_streamingAction);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MxStreamListMxDSAction m_list0x64; // 0x64
|
MxDSObjectList m_list0x64; // 0x64
|
||||||
MxBool m_unk0x70; // 0x70
|
MxBool m_unk0x70; // 0x70
|
||||||
list<MxDSBuffer*> m_list0x74; // 0x74
|
list<MxDSBuffer*> m_list0x74; // 0x74
|
||||||
MxStreamListMxDSAction m_list0x80; // 0x80
|
MxDSObjectList m_list0x80; // 0x80
|
||||||
undefined2 m_unk0x8c; // 0x8c
|
undefined2 m_unk0x8c; // 0x8c
|
||||||
MxStreamListMxDSAction m_list0x90; // 0x90
|
MxDSObjectList m_list0x90; // 0x90
|
||||||
MxCriticalSection m_critical9c; // 0x9c
|
MxCriticalSection m_critical9c; // 0x9c
|
||||||
MxStreamListMxDSAction m_list0xb8; // 0xb8
|
MxDSObjectList m_list0xb8; // 0xb8
|
||||||
MxBool m_unk0xc4; // 0xc4
|
MxBool m_unk0xc4; // 0xc4
|
||||||
|
|
||||||
void FUN_100c7970();
|
void FUN_100c7970();
|
||||||
void FUN_100c7ce0(MxDSBuffer* p_buffer);
|
void FUN_100c7ce0(MxDSBuffer* p_buffer);
|
||||||
@@ -74,10 +74,10 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// TEMPLATE: LEGO1 0x100c14d0
|
// TEMPLATE: LEGO1 0x100c14d0
|
||||||
// list<MxDSAction *,allocator<MxDSAction *> >::erase
|
// list<MxDSObject *,allocator<MxDSObject *> >::erase
|
||||||
|
|
||||||
// TEMPLATE: LEGO1 0x100c7330
|
// TEMPLATE: LEGO1 0x100c7330
|
||||||
// list<MxDSAction *,allocator<MxDSAction *> >::_Buynode
|
// list<MxDSObject *,allocator<MxDSObject *> >::_Buynode
|
||||||
|
|
||||||
// TEMPLATE: LEGO1 0x100c7420
|
// TEMPLATE: LEGO1 0x100c7420
|
||||||
// list<MxDSBuffer *,allocator<MxDSBuffer *> >::~list<MxDSBuffer *,allocator<MxDSBuffer *> >
|
// list<MxDSBuffer *,allocator<MxDSBuffer *> >::~list<MxDSBuffer *,allocator<MxDSBuffer *> >
|
||||||
|
@@ -5,7 +5,6 @@
|
|||||||
#include "decomp.h"
|
#include "decomp.h"
|
||||||
#include "mxcriticalsection.h"
|
#include "mxcriticalsection.h"
|
||||||
#include "mxdsaction.h"
|
#include "mxdsaction.h"
|
||||||
#include "mxstreamlist.h"
|
|
||||||
#include "mxstreamprovider.h"
|
#include "mxstreamprovider.h"
|
||||||
#include "mxthread.h"
|
#include "mxthread.h"
|
||||||
|
|
||||||
@@ -63,7 +62,7 @@ private:
|
|||||||
MxBool m_remainingWork; // 0x34
|
MxBool m_remainingWork; // 0x34
|
||||||
MxBool m_unk0x35; // 0x35
|
MxBool m_unk0x35; // 0x35
|
||||||
MxCriticalSection m_criticalSection; // 0x38
|
MxCriticalSection m_criticalSection; // 0x38
|
||||||
MxStreamListMxDSAction m_list; // 0x54
|
MxDSObjectList m_list; // 0x54
|
||||||
};
|
};
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x100d10a0
|
// SYNTHETIC: LEGO1 0x100d10a0
|
||||||
|
@@ -4,10 +4,25 @@
|
|||||||
#include "decomp.h"
|
#include "decomp.h"
|
||||||
#include "mxatom.h"
|
#include "mxatom.h"
|
||||||
#include "mxcore.h"
|
#include "mxcore.h"
|
||||||
|
#include "mxutilitylist.h"
|
||||||
|
|
||||||
class MxDSFile;
|
class MxDSFile;
|
||||||
|
class MxDSObject;
|
||||||
class MxPresenter;
|
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: LEGO1 0x100dc868
|
||||||
// VTABLE: BETA10 0x101c23f0
|
// VTABLE: BETA10 0x101c23f0
|
||||||
// SIZE 0x2c
|
// SIZE 0x2c
|
||||||
@@ -107,4 +122,7 @@ protected:
|
|||||||
MxDSObject* DeserializeDSObjectDispatch(MxU8*&, MxS16);
|
MxDSObject* DeserializeDSObjectDispatch(MxU8*&, MxS16);
|
||||||
MxDSObject* CreateStreamObject(MxDSFile*, MxS16);
|
MxDSObject* CreateStreamObject(MxDSFile*, MxS16);
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10150950
|
||||||
|
// MxUtilityList<MxDSObject *>::PopFront
|
||||||
|
|
||||||
#endif // MXDSOBJECT_H
|
#endif // MXDSOBJECT_H
|
||||||
|
@@ -4,9 +4,18 @@
|
|||||||
#include "decomp.h"
|
#include "decomp.h"
|
||||||
#include "mxcore.h"
|
#include "mxcore.h"
|
||||||
#include "mxstreamchunklist.h"
|
#include "mxstreamchunklist.h"
|
||||||
|
#include "mxutilitylist.h"
|
||||||
|
|
||||||
|
class MxDSObject;
|
||||||
|
class MxDSSubscriber;
|
||||||
class MxStreamController;
|
class MxStreamController;
|
||||||
|
|
||||||
|
// SIZE 0x0c
|
||||||
|
class MxDSSubscriberList : public MxUtilityList<MxDSSubscriber*> {
|
||||||
|
public:
|
||||||
|
MxDSSubscriber* Find(MxDSObject* p_object);
|
||||||
|
};
|
||||||
|
|
||||||
// VTABLE: LEGO1 0x100dc698
|
// VTABLE: LEGO1 0x100dc698
|
||||||
// VTABLE: BETA10 0x101c1d38
|
// VTABLE: BETA10 0x101c1d38
|
||||||
// SIZE 0x4c
|
// SIZE 0x4c
|
||||||
@@ -58,4 +67,7 @@ private:
|
|||||||
// TEMPLATE: LEGO1 0x100b7d00
|
// TEMPLATE: LEGO1 0x100b7d00
|
||||||
// MxStreamChunkList::~MxStreamChunkList
|
// MxStreamChunkList::~MxStreamChunkList
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10150a70
|
||||||
|
// MxUtilityList<MxDSSubscriber *>::PopFront
|
||||||
|
|
||||||
#endif // MXDSSUBSCRIBER_H
|
#endif // MXDSSUBSCRIBER_H
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
#include "mxdschunk.h"
|
#include "mxdschunk.h"
|
||||||
|
|
||||||
class MxDSBuffer;
|
class MxDSBuffer;
|
||||||
class MxStreamListMxDSSubscriber;
|
class MxDSSubscriberList;
|
||||||
|
|
||||||
// VTABLE: LEGO1 0x100dc2a8
|
// VTABLE: LEGO1 0x100dc2a8
|
||||||
// VTABLE: BETA10 0x101c1d20
|
// VTABLE: BETA10 0x101c1d20
|
||||||
@@ -34,7 +34,7 @@ public:
|
|||||||
|
|
||||||
MxResult ReadChunk(MxDSBuffer* p_buffer, MxU8* p_chunkData);
|
MxResult ReadChunk(MxDSBuffer* p_buffer, MxU8* p_chunkData);
|
||||||
MxU32 ReadChunkHeader(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);
|
void SetBuffer(MxDSBuffer* p_buffer);
|
||||||
|
|
||||||
static MxU16* IntoFlags(MxU8* p_buffer);
|
static MxU16* IntoFlags(MxU8* p_buffer);
|
||||||
|
@@ -5,13 +5,22 @@
|
|||||||
#include "mxatom.h"
|
#include "mxatom.h"
|
||||||
#include "mxcore.h"
|
#include "mxcore.h"
|
||||||
#include "mxcriticalsection.h"
|
#include "mxcriticalsection.h"
|
||||||
|
#include "mxdsobject.h"
|
||||||
#include "mxdssubscriber.h"
|
#include "mxdssubscriber.h"
|
||||||
|
#include "mxnextactiondatastart.h"
|
||||||
#include "mxstl/stlcompat.h"
|
#include "mxstl/stlcompat.h"
|
||||||
#include "mxstreamlist.h"
|
|
||||||
|
|
||||||
|
class MxDSAction;
|
||||||
class MxDSStreamingAction;
|
class MxDSStreamingAction;
|
||||||
class MxStreamProvider;
|
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: LEGO1 0x100dc968
|
||||||
// VTABLE: BETA10 0x101c26c0
|
// VTABLE: BETA10 0x101c26c0
|
||||||
// SIZE 0x64
|
// SIZE 0x64
|
||||||
@@ -34,12 +43,20 @@ public:
|
|||||||
return !strcmp(p_name, MxStreamController::ClassName()) || MxCore::IsA(p_name);
|
return !strcmp(p_name, MxStreamController::ClassName()) || MxCore::IsA(p_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual MxResult Open(const char* p_filename); // vtable+0x14
|
virtual MxResult Open(const char* p_filename); // vtable+0x14
|
||||||
virtual MxResult VTable0x18(undefined4, undefined4); // vtable+0x18
|
|
||||||
virtual MxResult VTable0x1c(undefined4, undefined4); // vtable+0x1c
|
// FUNCTION: LEGO1 0x100b9400
|
||||||
virtual MxResult VTable0x20(MxDSAction* p_action); // vtable+0x20
|
virtual MxResult VTable0x18(undefined4, undefined4) { return FAILURE; } // vtable+0x18
|
||||||
virtual MxResult VTable0x24(MxDSAction* p_action); // vtable+0x24
|
|
||||||
virtual MxDSStreamingAction* VTable0x28(); // vtable+0x28
|
// 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 VTable0x2c(MxDSAction* p_action, MxU32 p_bufferval); // vtable+0x2c
|
||||||
virtual MxResult VTable0x30(MxDSAction* p_action); // vtable+0x30
|
virtual MxResult VTable0x30(MxDSAction* p_action); // vtable+0x30
|
||||||
|
|
||||||
@@ -55,24 +72,24 @@ public:
|
|||||||
|
|
||||||
MxAtomId& GetAtom() { return m_atom; }
|
MxAtomId& GetAtom() { return m_atom; }
|
||||||
MxStreamProvider* GetProvider() { return m_provider; }
|
MxStreamProvider* GetProvider() { return m_provider; }
|
||||||
MxStreamListMxDSAction& GetUnk0x3c() { return m_unk0x3c; }
|
MxDSObjectList& GetUnk0x3c() { return m_unk0x3c; }
|
||||||
MxStreamListMxDSAction& GetUnk0x54() { return m_unk0x54; }
|
MxDSObjectList& GetUnk0x54() { return m_unk0x54; }
|
||||||
MxStreamListMxDSSubscriber& GetSubscriberList() { return m_subscriberList; }
|
MxDSSubscriberList& GetSubscriberList() { return m_subscriberList; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
MxCriticalSection m_criticalSection; // 0x08
|
MxCriticalSection m_criticalSection; // 0x08
|
||||||
MxAtomId m_atom; // 0x24
|
MxAtomId m_atom; // 0x24
|
||||||
MxStreamProvider* m_provider; // 0x28
|
MxStreamProvider* m_provider; // 0x28
|
||||||
undefined4* m_unk0x2c; // 0x2c
|
undefined4* m_unk0x2c; // 0x2c
|
||||||
MxStreamListMxDSSubscriber m_subscriberList; // 0x30
|
MxDSSubscriberList m_subscriberList; // 0x30
|
||||||
MxStreamListMxDSAction m_unk0x3c; // 0x3c
|
MxDSObjectList m_unk0x3c; // 0x3c
|
||||||
MxStreamListMxNextActionDataStart m_nextActionList; // 0x48
|
MxNextActionDataStartList m_nextActionList; // 0x48
|
||||||
MxStreamListMxDSAction m_unk0x54; // 0x54
|
MxDSObjectList m_unk0x54; // 0x54
|
||||||
MxDSAction* m_action0x60; // 0x60
|
MxDSAction* m_action0x60; // 0x60
|
||||||
};
|
};
|
||||||
|
|
||||||
// TEMPLATE: LEGO1 0x100c0d60
|
// TEMPLATE: LEGO1 0x100c0d60
|
||||||
// list<MxDSAction *,allocator<MxDSAction *> >::~list<MxDSAction *,allocator<MxDSAction *> >
|
// list<MxDSObject *,allocator<MxDSObject *> >::~list<MxDSObject *,allocator<MxDSObject *> >
|
||||||
|
|
||||||
// TEMPLATE: LEGO1 0x100c0dd0
|
// TEMPLATE: LEGO1 0x100c0dd0
|
||||||
// list<MxDSSubscriber *,allocator<MxDSSubscriber *> >::~list<MxDSSubscriber *,allocator<MxDSSubscriber *> >
|
// list<MxDSSubscriber *,allocator<MxDSSubscriber *> >::~list<MxDSSubscriber *,allocator<MxDSSubscriber *> >
|
||||||
@@ -92,33 +109,33 @@ protected:
|
|||||||
// MxStreamController::`scalar deleting destructor'
|
// MxStreamController::`scalar deleting destructor'
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100c0fc0
|
// FUNCTION: LEGO1 0x100c0fc0
|
||||||
// MxStreamListMxDSSubscriber::~MxStreamListMxDSSubscriber
|
// MxDSSubscriberList::~MxDSSubscriberList
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100c1010
|
// FUNCTION: LEGO1 0x100c1010
|
||||||
// MxStreamListMxDSAction::~MxStreamListMxDSAction
|
// MxDSObjectList::~MxDSObjectList
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100c1060
|
// FUNCTION: LEGO1 0x100c1060
|
||||||
// MxStreamListMxNextActionDataStart::~MxStreamListMxNextActionDataStart
|
// MxNextActionDataStartList::~MxNextActionDataStartList
|
||||||
|
|
||||||
// TEMPLATE: LEGO1 0x100c10b0
|
// TEMPLATE: LEGO1 0x100c10b0
|
||||||
// MxStreamList<MxDSSubscriber *>::~MxStreamList<MxDSSubscriber *>
|
// MxUtilityList<MxDSSubscriber *>::~MxUtilityList<MxDSSubscriber *>
|
||||||
|
|
||||||
// TEMPLATE: LEGO1 0x100c1100
|
// TEMPLATE: LEGO1 0x100c1100
|
||||||
// MxStreamList<MxDSAction *>::~MxStreamList<MxDSAction *>
|
// MxUtilityList<MxDSObject *>::~MxUtilityList<MxDSObject *>
|
||||||
|
|
||||||
// TEMPLATE: LEGO1 0x100c1150
|
// TEMPLATE: LEGO1 0x100c1150
|
||||||
// MxStreamList<MxNextActionDataStart *>::~MxStreamList<MxNextActionDataStart *>
|
// MxUtilityList<MxNextActionDataStart *>::~MxUtilityList<MxNextActionDataStart *>
|
||||||
|
|
||||||
// TEMPLATE: LEGO1 0x100c11a0
|
// TEMPLATE: LEGO1 0x100c11a0
|
||||||
// List<MxDSSubscriber *>::~List<MxDSSubscriber *>
|
// List<MxDSSubscriber *>::~List<MxDSSubscriber *>
|
||||||
|
|
||||||
// TEMPLATE: LEGO1 0x100c11f0
|
// TEMPLATE: LEGO1 0x100c11f0
|
||||||
// List<MxDSAction *>::~List<MxDSAction *>
|
// List<MxDSObject *>::~List<MxDSObject *>
|
||||||
|
|
||||||
// TEMPLATE: LEGO1 0x100c1240
|
// TEMPLATE: LEGO1 0x100c1240
|
||||||
// List<MxNextActionDataStart *>::~List<MxNextActionDataStart *>
|
// List<MxNextActionDataStart *>::~List<MxNextActionDataStart *>
|
||||||
|
|
||||||
// TEMPLATE: LEGO1 0x100c1bc0
|
// TEMPLATE: LEGO1 0x100c1bc0
|
||||||
// list<MxDSAction *,allocator<MxDSAction *> >::insert
|
// list<MxDSObject *,allocator<MxDSObject *> >::insert
|
||||||
|
|
||||||
#endif // MXSTREAMCONTROLLER_H
|
#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);
|
return !strcmp(p_name, MxStreamProvider::ClassName()) || MxCore::IsA(p_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual MxResult SetResourceToGet(MxStreamController* p_resource); // vtable+0x14
|
// FUNCTION: LEGO1 0x100d07c0
|
||||||
virtual MxU32 GetFileSize() = 0; // vtable+0x18
|
virtual MxResult SetResourceToGet(MxStreamController* p_pLookup)
|
||||||
virtual MxS32 GetStreamBuffersNum() = 0; // vtable+0x1c
|
{
|
||||||
virtual void VTable0x20(MxDSAction* p_action); // vtable+0x20
|
m_pLookup = p_pLookup;
|
||||||
virtual MxU32 GetLengthInDWords() = 0; // vtable+0x24
|
return SUCCESS;
|
||||||
virtual MxU32* GetBufferForDWords() = 0; // vtable+0x28
|
} // 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:
|
protected:
|
||||||
MxStreamController* m_pLookup; // 0x08
|
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 <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
DECOMP_SIZE_ASSERT(MxDSObject, 0x2c);
|
DECOMP_SIZE_ASSERT(MxDSObject, 0x2c)
|
||||||
|
DECOMP_SIZE_ASSERT(MxDSObjectList, 0x0c)
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100bf6a0
|
// FUNCTION: LEGO1 0x100bf6a0
|
||||||
// FUNCTION: BETA10 0x101478c0
|
// FUNCTION: BETA10 0x101478c0
|
||||||
@@ -172,6 +173,38 @@ void MxDSObject::Deserialize(MxU8*& p_source, MxS16 p_unk0x24)
|
|||||||
m_unk0x24 = 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: LEGO1 0x100bfb30
|
||||||
// FUNCTION: BETA10 0x10147f35
|
// FUNCTION: BETA10 0x10147f35
|
||||||
MxDSObject* DeserializeDSObjectDispatch(MxU8*& p_source, MxS16 p_flags)
|
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());
|
MxStreamController* controller = Streamer()->GetOpenStream(action->GetAtomId().GetInternal());
|
||||||
|
|
||||||
if (controller != NULL) {
|
if (controller != NULL) {
|
||||||
action = controller->GetUnk0x54().Find(action);
|
action = (MxDSAction*) controller->GetUnk0x54().Find(action);
|
||||||
if (action) {
|
if (action) {
|
||||||
if (ActionSourceEquals(action, "LegoLoopingAnimPresenter") == FALSE) {
|
if (ActionSourceEquals(action, "LegoLoopingAnimPresenter") == FALSE) {
|
||||||
delete controller->GetUnk0x54().FindAndErase(action);
|
delete controller->GetUnk0x54().FindAndErase(action);
|
||||||
@@ -399,9 +399,9 @@ void MxOmni::SetSound3D(MxBool p_use3dSound)
|
|||||||
MxBool MxOmni::DoesEntityExist(MxDSAction& p_dsAction)
|
MxBool MxOmni::DoesEntityExist(MxDSAction& p_dsAction)
|
||||||
{
|
{
|
||||||
if (m_streamer->FUN_100b9b30(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;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -35,9 +35,9 @@ MxDiskStreamController::~MxDiskStreamController()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
MxDSAction* action;
|
MxDSObject* object;
|
||||||
while (m_unk0x3c.PopFront(action)) {
|
while (m_unk0x3c.PopFront(object)) {
|
||||||
delete action;
|
delete object;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_provider) {
|
if (m_provider) {
|
||||||
@@ -47,12 +47,12 @@ MxDiskStreamController::~MxDiskStreamController()
|
|||||||
|
|
||||||
FUN_100c8720();
|
FUN_100c8720();
|
||||||
|
|
||||||
while (m_list0x80.PopFront(action)) {
|
while (m_list0x80.PopFront(object)) {
|
||||||
FUN_100c7cb0((MxDSStreamingAction*) action);
|
FUN_100c7cb0((MxDSStreamingAction*) object);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (m_list0x64.PopFront(action)) {
|
while (m_list0x64.PopFront(object)) {
|
||||||
FUN_100c7cb0((MxDSStreamingAction*) action);
|
FUN_100c7cb0((MxDSStreamingAction*) object);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!m_list0x74.empty()) {
|
while (!m_list0x74.empty()) {
|
||||||
@@ -162,7 +162,7 @@ void MxDiskStreamController::FUN_100c7980()
|
|||||||
MxDSStreamingAction* MxDiskStreamController::VTable0x28()
|
MxDSStreamingAction* MxDiskStreamController::VTable0x28()
|
||||||
{
|
{
|
||||||
AUTOLOCK(m_criticalSection);
|
AUTOLOCK(m_criticalSection);
|
||||||
MxDSAction* oldAction;
|
MxDSObject* oldAction;
|
||||||
MxDSStreamingAction* result = NULL;
|
MxDSStreamingAction* result = NULL;
|
||||||
MxU32 filesize = m_provider->GetFileSize();
|
MxU32 filesize = m_provider->GetFileSize();
|
||||||
|
|
||||||
@@ -252,10 +252,9 @@ MxDSStreamingAction* MxDiskStreamController::FUN_100c7db0()
|
|||||||
{
|
{
|
||||||
AUTOLOCK(m_criticalSection);
|
AUTOLOCK(m_criticalSection);
|
||||||
|
|
||||||
for (MxStreamListMxNextActionDataStart::iterator it = m_nextActionList.begin(); it != m_nextActionList.end();
|
for (MxNextActionDataStartList::iterator it = m_nextActionList.begin(); it != m_nextActionList.end(); it++) {
|
||||||
it++) {
|
|
||||||
MxNextActionDataStart* data = *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;
|
MxDSStreamingAction* streamingAction = (MxDSStreamingAction*) *it2;
|
||||||
if (streamingAction->GetObjectId() == data->GetObjectId() &&
|
if (streamingAction->GetObjectId() == data->GetObjectId() &&
|
||||||
streamingAction->GetUnknown24() == data->GetUnknown24() &&
|
streamingAction->GetUnknown24() == data->GetUnknown24() &&
|
||||||
@@ -320,7 +319,7 @@ void MxDiskStreamController::FUN_100c8120(MxDSAction* p_action)
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
MxDSAction* found = m_unk0x54.FindAndErase(p_action);
|
MxDSObject* found = m_unk0x54.FindAndErase(p_action);
|
||||||
if (!found) {
|
if (!found) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -38,15 +38,15 @@ MxResult MxDiskStreamProviderThread::StartWithTarget(MxDiskStreamProvider* p_tar
|
|||||||
// FUNCTION: LEGO1 0x100d0f70
|
// FUNCTION: LEGO1 0x100d0f70
|
||||||
MxDiskStreamProvider::MxDiskStreamProvider()
|
MxDiskStreamProvider::MxDiskStreamProvider()
|
||||||
{
|
{
|
||||||
this->m_pFile = NULL;
|
m_pFile = NULL;
|
||||||
this->m_remainingWork = FALSE;
|
m_remainingWork = FALSE;
|
||||||
this->m_unk0x35 = FALSE;
|
m_unk0x35 = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100d1240
|
// FUNCTION: LEGO1 0x100d1240
|
||||||
MxDiskStreamProvider::~MxDiskStreamProvider()
|
MxDiskStreamProvider::~MxDiskStreamProvider()
|
||||||
{
|
{
|
||||||
MxDSStreamingAction* action;
|
MxDSObject* action;
|
||||||
m_unk0x35 = FALSE;
|
m_unk0x35 = FALSE;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@@ -54,18 +54,18 @@ MxDiskStreamProvider::~MxDiskStreamProvider()
|
|||||||
|
|
||||||
{
|
{
|
||||||
AUTOLOCK(m_criticalSection);
|
AUTOLOCK(m_criticalSection);
|
||||||
m_list.PopFrontStreamingAction(action);
|
m_list.PopFront(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!action) {
|
if (!action) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action->GetUnknowna0()->GetWriteOffset() < 0x20000) {
|
if (((MxDSStreamingAction*) action)->GetUnknowna0()->GetWriteOffset() < 0x20000) {
|
||||||
g_unk0x10102878--;
|
g_unk0x10102878--;
|
||||||
}
|
}
|
||||||
|
|
||||||
((MxDiskStreamController*) m_pLookup)->FUN_100c8670(action);
|
((MxDiskStreamController*) m_pLookup)->FUN_100c8670((MxDSStreamingAction*) action);
|
||||||
} while (action);
|
} while (action);
|
||||||
|
|
||||||
if (m_remainingWork) {
|
if (m_remainingWork) {
|
||||||
@@ -116,7 +116,7 @@ done:
|
|||||||
// FUNCTION: LEGO1 0x100d15e0
|
// FUNCTION: LEGO1 0x100d15e0
|
||||||
void MxDiskStreamProvider::VTable0x20(MxDSAction* p_action)
|
void MxDiskStreamProvider::VTable0x20(MxDSAction* p_action)
|
||||||
{
|
{
|
||||||
MxDSStreamingAction* action;
|
MxDSObject* action;
|
||||||
|
|
||||||
if (p_action->GetObjectId() == -1) {
|
if (p_action->GetObjectId() == -1) {
|
||||||
m_unk0x35 = FALSE;
|
m_unk0x35 = FALSE;
|
||||||
@@ -126,18 +126,18 @@ void MxDiskStreamProvider::VTable0x20(MxDSAction* p_action)
|
|||||||
|
|
||||||
{
|
{
|
||||||
AUTOLOCK(m_criticalSection);
|
AUTOLOCK(m_criticalSection);
|
||||||
m_list.PopFrontStreamingAction(action);
|
m_list.PopFront(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!action) {
|
if (!action) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action->GetUnknowna0()->GetWriteOffset() < 0x20000) {
|
if (((MxDSStreamingAction*) action)->GetUnknowna0()->GetWriteOffset() < 0x20000) {
|
||||||
g_unk0x10102878--;
|
g_unk0x10102878--;
|
||||||
}
|
}
|
||||||
|
|
||||||
((MxDiskStreamController*) m_pLookup)->FUN_100c8670(action);
|
((MxDiskStreamController*) m_pLookup)->FUN_100c8670((MxDSStreamingAction*) action);
|
||||||
} while (action);
|
} while (action);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -151,11 +151,11 @@ void MxDiskStreamProvider::VTable0x20(MxDSAction* p_action)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action->GetUnknowna0()->GetWriteOffset() < 0x20000) {
|
if (((MxDSStreamingAction*) action)->GetUnknowna0()->GetWriteOffset() < 0x20000) {
|
||||||
g_unk0x10102878--;
|
g_unk0x10102878--;
|
||||||
}
|
}
|
||||||
|
|
||||||
((MxDiskStreamController*) m_pLookup)->FUN_100c8670(action);
|
((MxDiskStreamController*) m_pLookup)->FUN_100c8670((MxDSStreamingAction*) action);
|
||||||
} while (action);
|
} while (action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -213,14 +213,14 @@ MxResult MxDiskStreamProvider::FUN_100d1780(MxDSStreamingAction* p_action)
|
|||||||
void MxDiskStreamProvider::PerformWork()
|
void MxDiskStreamProvider::PerformWork()
|
||||||
{
|
{
|
||||||
MxDiskStreamController* controller = (MxDiskStreamController*) m_pLookup;
|
MxDiskStreamController* controller = (MxDiskStreamController*) m_pLookup;
|
||||||
MxDSStreamingAction* streamingAction = NULL;
|
MxDSObject* streamingAction = NULL;
|
||||||
|
|
||||||
{
|
{
|
||||||
AUTOLOCK(m_criticalSection);
|
AUTOLOCK(m_criticalSection);
|
||||||
if (!m_list.empty()) {
|
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_thread.Sleep(500);
|
||||||
m_busySemaphore.Release(1);
|
m_busySemaphore.Release(1);
|
||||||
return;
|
return;
|
||||||
@@ -233,33 +233,33 @@ void MxDiskStreamProvider::PerformWork()
|
|||||||
{
|
{
|
||||||
AUTOLOCK(m_criticalSection);
|
AUTOLOCK(m_criticalSection);
|
||||||
|
|
||||||
if (!m_list.PopFrontStreamingAction(streamingAction)) {
|
if (!m_list.PopFront(streamingAction)) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (streamingAction->GetUnknowna0()->GetWriteOffset() < 0x20000) {
|
if (((MxDSStreamingAction*) streamingAction)->GetUnknowna0()->GetWriteOffset() < 0x20000) {
|
||||||
g_unk0x10102878--;
|
g_unk0x10102878--;
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer = streamingAction->GetUnknowna0();
|
buffer = ((MxDSStreamingAction*) streamingAction)->GetUnknowna0();
|
||||||
|
|
||||||
if (m_pFile->GetPosition() == streamingAction->GetBufferOffset() ||
|
if (m_pFile->GetPosition() == ((MxDSStreamingAction*) streamingAction)->GetBufferOffset() ||
|
||||||
m_pFile->Seek(streamingAction->GetBufferOffset(), SEEK_SET) == 0) {
|
m_pFile->Seek(((MxDSStreamingAction*) streamingAction)->GetBufferOffset(), SEEK_SET) == 0) {
|
||||||
buffer->SetUnknown14(m_pFile->GetPosition());
|
buffer->SetUnknown14(m_pFile->GetPosition());
|
||||||
|
|
||||||
if (m_pFile->ReadToBuffer(buffer) == SUCCESS) {
|
if (m_pFile->ReadToBuffer(buffer) == SUCCESS) {
|
||||||
buffer->SetUnknown1c(m_pFile->GetPosition());
|
buffer->SetUnknown1c(m_pFile->GetPosition());
|
||||||
|
|
||||||
if (streamingAction->GetUnknown9c() > 0) {
|
if (((MxDSStreamingAction*) streamingAction)->GetUnknown9c() > 0) {
|
||||||
FUN_100d1b20(streamingAction);
|
FUN_100d1b20(((MxDSStreamingAction*) streamingAction));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (m_pLookup == NULL || !((MxDiskStreamController*) m_pLookup)->GetUnk0xc4()) {
|
if (m_pLookup == NULL || !((MxDiskStreamController*) m_pLookup)->GetUnk0xc4()) {
|
||||||
controller->FUN_100c8670(streamingAction);
|
controller->FUN_100c8670(((MxDSStreamingAction*) streamingAction));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
controller->FUN_100c7f40(streamingAction);
|
controller->FUN_100c7f40(((MxDSStreamingAction*) streamingAction));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -269,7 +269,7 @@ void MxDiskStreamProvider::PerformWork()
|
|||||||
|
|
||||||
done:
|
done:
|
||||||
if (streamingAction) {
|
if (streamingAction) {
|
||||||
controller->FUN_100c8670(streamingAction);
|
controller->FUN_100c8670(((MxDSStreamingAction*) streamingAction));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_thread.Sleep(0);
|
m_thread.Sleep(0);
|
||||||
|
@@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
#include "mxstreamcontroller.h"
|
#include "mxstreamcontroller.h"
|
||||||
|
|
||||||
DECOMP_SIZE_ASSERT(MxDSSubscriber, 0x4c);
|
DECOMP_SIZE_ASSERT(MxDSSubscriber, 0x4c)
|
||||||
|
DECOMP_SIZE_ASSERT(MxDSSubscriberList, 0x0c)
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100b7bb0
|
// FUNCTION: LEGO1 0x100b7bb0
|
||||||
MxDSSubscriber::MxDSSubscriber()
|
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) {
|
if (p_action->GetUnknown24() == -1) {
|
||||||
p_action->SetUnknown24(-3);
|
p_action->SetUnknown24(-3);
|
||||||
MxDSAction* action = m_unk0x54.Find(p_action);
|
MxDSObject* action = m_unk0x54.Find(p_action);
|
||||||
if (action != NULL) {
|
if (action != NULL) {
|
||||||
unk0x24 = action->GetUnknown24() + 1;
|
unk0x24 = action->GetUnknown24() + 1;
|
||||||
}
|
}
|
||||||
|
@@ -6,7 +6,8 @@
|
|||||||
#include "mxomni.h"
|
#include "mxomni.h"
|
||||||
#include "mxstreamcontroller.h"
|
#include "mxstreamcontroller.h"
|
||||||
|
|
||||||
DECOMP_SIZE_ASSERT(MxRAMStreamProvider, 0x24);
|
DECOMP_SIZE_ASSERT(MxStreamProvider, 0x10)
|
||||||
|
DECOMP_SIZE_ASSERT(MxRAMStreamProvider, 0x24)
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100d0730
|
// FUNCTION: LEGO1 0x100d0730
|
||||||
MxRAMStreamProvider::MxRAMStreamProvider()
|
MxRAMStreamProvider::MxRAMStreamProvider()
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#include "mxstreamchunk.h"
|
#include "mxstreamchunk.h"
|
||||||
|
|
||||||
#include "mxdsbuffer.h"
|
#include "mxdsbuffer.h"
|
||||||
#include "mxstreamlist.h"
|
#include "mxdssubscriber.h"
|
||||||
#include "mxutilities.h"
|
#include "mxutilities.h"
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100c2fe0
|
// FUNCTION: LEGO1 0x100c2fe0
|
||||||
@@ -58,9 +58,9 @@ MxU32 MxStreamChunk::ReadChunkHeader(MxU8* p_chunkData)
|
|||||||
|
|
||||||
// FUNCTION: LEGO1 0x100c30e0
|
// FUNCTION: LEGO1 0x100c30e0
|
||||||
// FUNCTION: BETA10 0x10151517
|
// 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 ((*it)->GetObjectId() == m_objectId && (*it)->GetUnknown48() == p_obj24val) {
|
||||||
if (m_flags & DS_CHUNK_END_OF_STREAM && m_buffer) {
|
if (m_flags & DS_CHUNK_END_OF_STREAM && m_buffer) {
|
||||||
m_buffer->ReleaseRef(this);
|
m_buffer->ReleaseRef(this);
|
||||||
|
@@ -14,24 +14,7 @@
|
|||||||
|
|
||||||
DECOMP_SIZE_ASSERT(MxStreamController, 0x64)
|
DECOMP_SIZE_ASSERT(MxStreamController, 0x64)
|
||||||
DECOMP_SIZE_ASSERT(MxNextActionDataStart, 0x14)
|
DECOMP_SIZE_ASSERT(MxNextActionDataStart, 0x14)
|
||||||
|
DECOMP_SIZE_ASSERT(MxNextActionDataStartList, 0x0c)
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100c0b90
|
// FUNCTION: LEGO1 0x100c0b90
|
||||||
MxStreamController::MxStreamController()
|
MxStreamController::MxStreamController()
|
||||||
@@ -53,7 +36,7 @@ MxStreamController::~MxStreamController()
|
|||||||
delete subscriber;
|
delete subscriber;
|
||||||
}
|
}
|
||||||
|
|
||||||
MxDSAction* action;
|
MxDSObject* action;
|
||||||
while (m_unk0x3c.PopFront(action)) {
|
while (m_unk0x3c.PopFront(action)) {
|
||||||
delete action;
|
delete action;
|
||||||
}
|
}
|
||||||
@@ -135,7 +118,7 @@ MxResult MxStreamController::VTable0x24(MxDSAction* p_action)
|
|||||||
{
|
{
|
||||||
AUTOLOCK(m_criticalSection);
|
AUTOLOCK(m_criticalSection);
|
||||||
VTable0x30(p_action);
|
VTable0x30(p_action);
|
||||||
m_action0x60 = m_unk0x54.FindAndErase(p_action);
|
m_action0x60 = (MxDSAction*) m_unk0x54.FindAndErase(p_action);
|
||||||
if (m_action0x60 == NULL) {
|
if (m_action0x60 == NULL) {
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
@@ -166,8 +149,8 @@ MxResult MxStreamController::FUN_100c1a00(MxDSAction* p_action, MxU32 p_offset)
|
|||||||
MxS16 newUnknown24 = -1;
|
MxS16 newUnknown24 = -1;
|
||||||
|
|
||||||
// These loops might be a template function in the list classes
|
// These loops might be a template function in the list classes
|
||||||
for (MxStreamListMxDSAction::iterator it = m_unk0x54.begin(); it != m_unk0x54.end(); it++) {
|
for (MxDSObjectList::iterator it = m_unk0x54.begin(); it != m_unk0x54.end(); it++) {
|
||||||
MxDSAction* action = *it;
|
MxDSObject* action = *it;
|
||||||
|
|
||||||
if (action->GetObjectId() == p_action->GetObjectId()) {
|
if (action->GetObjectId() == p_action->GetObjectId()) {
|
||||||
newUnknown24 = Max(newUnknown24, action->GetUnknown24());
|
newUnknown24 = Max(newUnknown24, action->GetUnknown24());
|
||||||
@@ -175,8 +158,8 @@ MxResult MxStreamController::FUN_100c1a00(MxDSAction* p_action, MxU32 p_offset)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (newUnknown24 == -1) {
|
if (newUnknown24 == -1) {
|
||||||
for (MxStreamListMxDSAction::iterator it = m_unk0x3c.begin(); it != m_unk0x3c.end(); it++) {
|
for (MxDSObjectList::iterator it = m_unk0x3c.begin(); it != m_unk0x3c.end(); it++) {
|
||||||
MxDSAction* action = *it;
|
MxDSObject* action = *it;
|
||||||
|
|
||||||
if (action->GetObjectId() == p_action->GetObjectId()) {
|
if (action->GetObjectId() == p_action->GetObjectId()) {
|
||||||
newUnknown24 = Max(newUnknown24, action->GetUnknown24());
|
newUnknown24 = Max(newUnknown24, action->GetUnknown24());
|
||||||
@@ -184,8 +167,7 @@ MxResult MxStreamController::FUN_100c1a00(MxDSAction* p_action, MxU32 p_offset)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (newUnknown24 == -1) {
|
if (newUnknown24 == -1) {
|
||||||
for (MxStreamListMxDSSubscriber::iterator it = m_subscriberList.begin(); it != m_subscriberList.end();
|
for (MxDSSubscriberList::iterator it = m_subscriberList.begin(); it != m_subscriberList.end(); it++) {
|
||||||
it++) {
|
|
||||||
MxDSSubscriber* subscriber = *it;
|
MxDSSubscriber* subscriber = *it;
|
||||||
|
|
||||||
if (subscriber->GetObjectId() == p_action->GetObjectId()) {
|
if (subscriber->GetObjectId() == p_action->GetObjectId()) {
|
||||||
@@ -235,7 +217,7 @@ MxResult MxStreamController::VTable0x30(MxDSAction* p_action)
|
|||||||
{
|
{
|
||||||
AUTOLOCK(m_criticalSection);
|
AUTOLOCK(m_criticalSection);
|
||||||
MxResult result = FAILURE;
|
MxResult result = FAILURE;
|
||||||
MxDSAction* action = m_unk0x3c.FindAndErase(p_action);
|
MxDSObject* action = m_unk0x3c.FindAndErase(p_action);
|
||||||
if (action != NULL) {
|
if (action != NULL) {
|
||||||
MxNextActionDataStart* data = m_nextActionList.FindAndErase(action->GetObjectId(), action->GetUnknown24());
|
MxNextActionDataStart* data = m_nextActionList.FindAndErase(action->GetObjectId(), action->GetUnknown24());
|
||||||
delete action;
|
delete action;
|
||||||
@@ -266,7 +248,7 @@ MxPresenter* MxStreamController::FUN_100c1e70(MxDSAction& p_action)
|
|||||||
AUTOLOCK(m_criticalSection);
|
AUTOLOCK(m_criticalSection);
|
||||||
MxPresenter* result = NULL;
|
MxPresenter* result = NULL;
|
||||||
if (p_action.GetObjectId() != -1) {
|
if (p_action.GetObjectId() != -1) {
|
||||||
MxDSAction* action = m_unk0x3c.Find(&p_action);
|
MxDSObject* action = m_unk0x3c.Find(&p_action);
|
||||||
if (action != NULL) {
|
if (action != NULL) {
|
||||||
result = action->GetUnknown28();
|
result = action->GetUnknown28();
|
||||||
}
|
}
|
||||||
@@ -344,3 +326,33 @@ MxBool MxStreamController::IsStoped(MxDSObject* p_obj)
|
|||||||
|
|
||||||
return TRUE;
|
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 "mxdebug.h"
|
||||||
#include "mxdiskstreamcontroller.h"
|
#include "mxdiskstreamcontroller.h"
|
||||||
|
#include "mxdsaction.h"
|
||||||
#include "mxmisc.h"
|
#include "mxmisc.h"
|
||||||
#include "mxnotificationmanager.h"
|
#include "mxnotificationmanager.h"
|
||||||
#include "mxramstreamcontroller.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++;
|
m_currentFrame++;
|
||||||
VTable0x88();
|
VTable0x88();
|
||||||
|
|
||||||
MxRectList list(TRUE);
|
MxRectList rects(TRUE);
|
||||||
MxSmack::LoadFrame(bitmapInfo, bitmapData, &m_mxSmack, chunkData, paletteChanged, &list);
|
MxSmack::LoadFrame(bitmapInfo, bitmapData, &m_mxSmack, chunkData, paletteChanged, &rects);
|
||||||
|
|
||||||
if (((MxDSMediaAction*) m_action)->GetPaletteManagement() && paletteChanged) {
|
if (((MxDSMediaAction*) m_action)->GetPaletteManagement() && paletteChanged) {
|
||||||
RealizePalette();
|
RealizePalette();
|
||||||
}
|
}
|
||||||
|
|
||||||
MxRect32 invalidateRect;
|
MxRect32 invalidateRect;
|
||||||
MxRectListCursor cursor(&list);
|
MxRectListCursor cursor(&rects);
|
||||||
MxRect32* rect;
|
MxRect32* rect;
|
||||||
|
|
||||||
while (cursor.Next(rect)) {
|
while (cursor.Next(rect)) {
|
||||||
|
Reference in New Issue
Block a user