mirror of
https://github.com/isledecomp/isle.git
synced 2025-02-17 12:10:22 -05:00
Beta match* MxStreamer (#1099)
* Beta addrs * Streamer changes * Typo and comment. One more beta addr * Rename member to m_controllers
This commit is contained in:
parent
2b14d3d6a5
commit
97b3dcaa2c
8 changed files with 222 additions and 40 deletions
|
@ -74,6 +74,13 @@ public:
|
||||||
MxBool operator!=(const MxAtomId& p_atomId) const { return this->m_internal != p_atomId.m_internal; }
|
MxBool operator!=(const MxAtomId& p_atomId) const { return this->m_internal != p_atomId.m_internal; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// TODO:
|
||||||
|
// BETA10 0x1007dc20 operator==
|
||||||
|
// BETA10 0x10096970 operator!=
|
||||||
|
|
||||||
|
// FUNCTION: BETA10 0x10146dd0
|
||||||
|
MxBool operator==(const char* p_internal) const { return p_internal && !strcmp(m_internal, p_internal); }
|
||||||
|
|
||||||
// FUNCTION: BETA10 0x10025d40
|
// FUNCTION: BETA10 0x10025d40
|
||||||
MxAtomId() { this->m_internal = 0; }
|
MxAtomId() { this->m_internal = 0; }
|
||||||
|
|
||||||
|
|
|
@ -92,4 +92,76 @@ private:
|
||||||
MxU32 m_blocks[e_blocksRequired + 1]; // 0x00
|
MxU32 m_blocks[e_blocksRequired + 1]; // 0x00
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10146600
|
||||||
|
// MxBitset<2>::MxBitset<2>
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x101464e0
|
||||||
|
// MxBitset<22>::MxBitset<22>
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10146510
|
||||||
|
// MxBitset<22>::Tidy
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10146570
|
||||||
|
// MxBitset<22>::Trim
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10146630
|
||||||
|
// MxBitset<2>::Tidy
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10146690
|
||||||
|
// MxBitset<2>::Trim
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10146880
|
||||||
|
// MxBitset<22>::Size
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x101469d0
|
||||||
|
// MxBitset<2>::Size
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x101587a0
|
||||||
|
// MxBitset<22>::Reference::Flip
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x101587d0
|
||||||
|
// MxBitset<22>::Reference::operator int
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10158800
|
||||||
|
// MxBitset<22>::operator[]
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10158830
|
||||||
|
// MxBitset<22>::Reference::Reference
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10158860
|
||||||
|
// MxBitset<22>::Flip
|
||||||
|
|
||||||
|
// STUB: BETA10 0x101588b0
|
||||||
|
// MxBitset<22>::Count
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10158930
|
||||||
|
// MxBitset<22>::Test
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10158990
|
||||||
|
// MxBitset<22>::Xran
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10158b70
|
||||||
|
// MxBitset<2>::Reference::Flip
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10158ba0
|
||||||
|
// MxBitset<2>::Reference::operator int
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10158bd0
|
||||||
|
// MxBitset<2>::operator[]
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10158c00
|
||||||
|
// MxBitset<2>::Reference::Reference
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10158c30
|
||||||
|
// MxBitset<2>::Flip
|
||||||
|
|
||||||
|
// STUB: BETA10 0x10158c80
|
||||||
|
// MxBitset<2>::Count
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10158d00
|
||||||
|
// MxBitset<2>::Test
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10158d60
|
||||||
|
// MxBitset<2>::Xran
|
||||||
|
|
||||||
#endif // MXBITSET_H
|
#endif // MXBITSET_H
|
||||||
|
|
|
@ -78,4 +78,42 @@ void MxMemoryPool<BS, NB>::Release(MxU8* p_buf)
|
||||||
MxTrace("Release> %d pool: busy %d blocks\n", m_blockSize, m_blockRef.Count());
|
MxTrace("Release> %d pool: busy %d blocks\n", m_blockSize, m_blockRef.Count());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x101464a0
|
||||||
|
// MxMemoryPool<64,22>::MxMemoryPool<64,22>
|
||||||
|
|
||||||
|
// TEMPLATE: LEGO1 0x100b9100
|
||||||
|
// TEMPLATE: BETA10 0x10146590
|
||||||
|
// MxMemoryPool<64,22>::~MxMemoryPool<64,22>
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x101465c0
|
||||||
|
// MxMemoryPool<128,2>::MxMemoryPool<128,2>
|
||||||
|
|
||||||
|
// TEMPLATE: LEGO1 0x100b9110
|
||||||
|
// TEMPLATE: BETA10 0x101466b0
|
||||||
|
// MxMemoryPool<128,2>::~MxMemoryPool<128,2>
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10146780
|
||||||
|
// MxMemoryPool<64,22>::Allocate
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x101468a0
|
||||||
|
// MxMemoryPool<64,22>::GetPoolSize
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x101468d0
|
||||||
|
// MxMemoryPool<128,2>::Allocate
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x101469f0
|
||||||
|
// MxMemoryPool<128,2>::GetPoolSize
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10158610
|
||||||
|
// MxMemoryPool<64,22>::Release
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x101589e0
|
||||||
|
// MxMemoryPool<128,2>::Release
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10158e50
|
||||||
|
// MxMemoryPool<64,22>::Get
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10158f90
|
||||||
|
// MxMemoryPool<128,2>::Get
|
||||||
|
|
||||||
#endif // MXMEMORYPOOL_H
|
#endif // MXMEMORYPOOL_H
|
||||||
|
|
|
@ -35,16 +35,23 @@ enum NotificationId {
|
||||||
};
|
};
|
||||||
|
|
||||||
// VTABLE: LEGO1 0x100d56e0
|
// VTABLE: LEGO1 0x100d56e0
|
||||||
|
// VTABLE: BETA10 0x101b86a8
|
||||||
// SIZE 0x0c
|
// SIZE 0x0c
|
||||||
class MxNotificationParam : public MxParam {
|
class MxNotificationParam : public MxParam {
|
||||||
public:
|
public:
|
||||||
MxNotificationParam() : m_type(c_notificationType0), m_sender(NULL) {}
|
MxNotificationParam() : m_type(c_notificationType0), m_sender(NULL) {}
|
||||||
|
|
||||||
|
// FUNCTION: BETA10 0x10013490
|
||||||
MxNotificationParam(NotificationId p_type, MxCore* p_sender) : MxParam(), m_type(p_type), m_sender(p_sender) {}
|
MxNotificationParam(NotificationId p_type, MxCore* p_sender) : MxParam(), m_type(p_type), m_sender(p_sender) {}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10010390
|
// FUNCTION: LEGO1 0x10010390
|
||||||
|
// FUNCTION: BETA10 0x100135f0
|
||||||
virtual MxNotificationParam* Clone() const { return new MxNotificationParam(m_type, m_sender); } // vtable+0x04
|
virtual MxNotificationParam* Clone() const { return new MxNotificationParam(m_type, m_sender); } // vtable+0x04
|
||||||
|
|
||||||
|
// FUNCTION: BETA10 0x100135c0
|
||||||
NotificationId GetNotification() const { return m_type; }
|
NotificationId GetNotification() const { return m_type; }
|
||||||
|
|
||||||
|
// FUNCTION: BETA10 0x1003c960
|
||||||
MxCore* GetSender() const { return m_sender; }
|
MxCore* GetSender() const { return m_sender; }
|
||||||
|
|
||||||
void SetNotification(NotificationId p_type) { m_type = p_type; }
|
void SetNotification(NotificationId p_type) { m_type = p_type; }
|
||||||
|
@ -56,9 +63,11 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x10010430
|
// SYNTHETIC: LEGO1 0x10010430
|
||||||
|
// SYNTHETIC: BETA10 0x100136c0
|
||||||
// MxNotificationParam::`scalar deleting destructor'
|
// MxNotificationParam::`scalar deleting destructor'
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x100104a0
|
// SYNTHETIC: LEGO1 0x100104a0
|
||||||
|
// SYNTHETIC: BETA10 0x10013740
|
||||||
// MxNotificationParam::~MxNotificationParam
|
// MxNotificationParam::~MxNotificationParam
|
||||||
|
|
||||||
#endif // MXNOTIFICATIONPARAM_H
|
#endif // MXNOTIFICATIONPARAM_H
|
||||||
|
|
|
@ -3,16 +3,22 @@
|
||||||
|
|
||||||
// VTABLE: ISLE 0x40f018
|
// VTABLE: ISLE 0x40f018
|
||||||
// VTABLE: LEGO1 0x100d56e8
|
// VTABLE: LEGO1 0x100d56e8
|
||||||
|
// VTABLE: BETA10 0x101b86b4
|
||||||
// SIZE 0x04
|
// SIZE 0x04
|
||||||
class MxParam {
|
class MxParam {
|
||||||
public:
|
public:
|
||||||
// FUNCTION: ISLE 0x401530
|
// FUNCTION: ISLE 0x401530
|
||||||
// FUNCTION: LEGO1 0x10010360
|
// FUNCTION: LEGO1 0x10010360
|
||||||
|
// FUNCTION: BETA10 0x10013540
|
||||||
virtual ~MxParam() {}
|
virtual ~MxParam() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// SYNTHETIC: BETA10 0x10013710
|
||||||
|
// MxParam::MxParam
|
||||||
|
|
||||||
// SYNTHETIC: ISLE 0x401540
|
// SYNTHETIC: ISLE 0x401540
|
||||||
// SYNTHETIC: LEGO1 0x10010370
|
// SYNTHETIC: LEGO1 0x10010370
|
||||||
|
// SYNTHETIC: BETA10 0x10013570
|
||||||
// MxParam::`scalar deleting destructor'
|
// MxParam::`scalar deleting destructor'
|
||||||
|
|
||||||
#endif // MXPARAM_H
|
#endif // MXPARAM_H
|
||||||
|
|
|
@ -17,9 +17,11 @@ typedef MxMemoryPool<64, 22> MxMemoryPool64;
|
||||||
typedef MxMemoryPool<128, 2> MxMemoryPool128;
|
typedef MxMemoryPool<128, 2> MxMemoryPool128;
|
||||||
|
|
||||||
// VTABLE: LEGO1 0x100dc760
|
// VTABLE: LEGO1 0x100dc760
|
||||||
|
// VTABLE: BETA10 0x101c23c8
|
||||||
// SIZE 0x10
|
// SIZE 0x10
|
||||||
class MxStreamerNotification : public MxNotificationParam {
|
class MxStreamerNotification : public MxNotificationParam {
|
||||||
public:
|
public:
|
||||||
|
// FUNCTION: BETA10 0x10146e40
|
||||||
MxStreamerNotification(NotificationId p_type, MxCore* p_sender, MxStreamController* p_ctrlr)
|
MxStreamerNotification(NotificationId p_type, MxCore* p_sender, MxStreamController* p_ctrlr)
|
||||||
: MxNotificationParam(p_type, p_sender)
|
: MxNotificationParam(p_type, p_sender)
|
||||||
{
|
{
|
||||||
|
@ -28,6 +30,7 @@ public:
|
||||||
|
|
||||||
MxNotificationParam* Clone() const override;
|
MxNotificationParam* Clone() const override;
|
||||||
|
|
||||||
|
// FUNCTION: BETA10 0x10147190
|
||||||
MxStreamController* GetController() { return m_controller; }
|
MxStreamController* GetController() { return m_controller; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -53,6 +56,7 @@ public:
|
||||||
MxLong Notify(MxParam& p_param) override; // vtable+0x04
|
MxLong Notify(MxParam& p_param) override; // vtable+0x04
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100b9000
|
// FUNCTION: LEGO1 0x100b9000
|
||||||
|
// FUNCTION: BETA10 0x10145ee0
|
||||||
const char* ClassName() const override // vtable+0x0c
|
const char* ClassName() const override // vtable+0x0c
|
||||||
{
|
{
|
||||||
// STRING: LEGO1 0x1010210c
|
// STRING: LEGO1 0x1010210c
|
||||||
|
@ -60,6 +64,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100b9010
|
// FUNCTION: LEGO1 0x100b9010
|
||||||
|
// FUNCTION: BETA10 0x10145f00
|
||||||
MxBool IsA(const char* p_name) const override // vtable+0x10
|
MxBool IsA(const char* p_name) const override // vtable+0x10
|
||||||
{
|
{
|
||||||
return !strcmp(p_name, MxStreamer::ClassName()) || MxCore::IsA(p_name);
|
return !strcmp(p_name, MxStreamer::ClassName()) || MxCore::IsA(p_name);
|
||||||
|
@ -74,6 +79,7 @@ public:
|
||||||
MxResult FUN_100b99b0(MxDSAction* p_action);
|
MxResult FUN_100b99b0(MxDSAction* p_action);
|
||||||
MxResult DeleteObject(MxDSAction* p_dsAction);
|
MxResult DeleteObject(MxDSAction* p_dsAction);
|
||||||
|
|
||||||
|
// FUNCTION: BETA10 0x10158db0
|
||||||
MxU8* GetMemoryBlock(MxU32 p_blockSize)
|
MxU8* GetMemoryBlock(MxU32 p_blockSize)
|
||||||
{
|
{
|
||||||
switch (p_blockSize) {
|
switch (p_blockSize) {
|
||||||
|
@ -91,6 +97,7 @@ public:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FUNCTION: BETA10 0x10158570
|
||||||
void ReleaseMemoryBlock(MxU8* p_block, MxU32 p_blockSize)
|
void ReleaseMemoryBlock(MxU8* p_block, MxU32 p_blockSize)
|
||||||
{
|
{
|
||||||
switch (p_blockSize) {
|
switch (p_blockSize) {
|
||||||
|
@ -109,33 +116,57 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
list<MxStreamController*> m_openStreams; // 0x08
|
list<MxStreamController*> m_controllers; // 0x08
|
||||||
MxMemoryPool64 m_pool64; // 0x14
|
MxMemoryPool64 m_pool64; // 0x14
|
||||||
MxMemoryPool128 m_pool128; // 0x20
|
MxMemoryPool128 m_pool128; // 0x20
|
||||||
};
|
};
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
// TEMPLATE: LEGO1 0x100b9090
|
// TEMPLATE: LEGO1 0x100b9090
|
||||||
// TEMPLATE: BETA10 0x10146720
|
// TEMPLATE: BETA10 0x10146020
|
||||||
// list<MxStreamController *,allocator<MxStreamController *> >::~list<MxStreamController *,allocator<MxStreamController *> >
|
// list<MxStreamController *,allocator<MxStreamController *> >::~list<MxStreamController *,allocator<MxStreamController *> >
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
// TEMPLATE: LEGO1 0x100b9100
|
// TEMPLATE: BETA10 0x10146090
|
||||||
// MxMemoryPool<64,22>::~MxMemoryPool<64,22>
|
// list<MxStreamController *,allocator<MxStreamController *> >::begin
|
||||||
|
|
||||||
// TEMPLATE: LEGO1 0x100b9110
|
// TEMPLATE: BETA10 0x10146120
|
||||||
// MxMemoryPool<128,2>::~MxMemoryPool<128,2>
|
// list<MxStreamController *,allocator<MxStreamController *> >::end
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x101461b0
|
||||||
|
// list<MxStreamController *,allocator<MxStreamController *> >::iterator::operator++
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x100b9120
|
// SYNTHETIC: LEGO1 0x100b9120
|
||||||
|
// SYNTHETIC: BETA10 0x101466e0
|
||||||
// MxStreamer::`scalar deleting destructor'
|
// MxStreamer::`scalar deleting destructor'
|
||||||
|
|
||||||
// TEMPLATE: LEGO1 0x100b9140
|
// TEMPLATE: LEGO1 0x100b9140
|
||||||
|
// TEMPLATE: BETA10 0x10146720
|
||||||
// List<MxStreamController *>::~List<MxStreamController *>
|
// List<MxStreamController *>::~List<MxStreamController *>
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10146ab0
|
||||||
|
// list<MxStreamController *,allocator<MxStreamController *> >::iterator::operator*
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x100b97b0
|
// SYNTHETIC: LEGO1 0x100b97b0
|
||||||
|
// SYNTHETIC: BETA10 0x10146f80
|
||||||
// MxStreamerNotification::`scalar deleting destructor'
|
// MxStreamerNotification::`scalar deleting destructor'
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x100b9820
|
// SYNTHETIC: LEGO1 0x100b9820
|
||||||
|
// SYNTHETIC: BETA10 0x10146fc0
|
||||||
// MxStreamerNotification::~MxStreamerNotification
|
// MxStreamerNotification::~MxStreamerNotification
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10147020
|
||||||
|
// list<MxStreamController *,allocator<MxStreamController *> >::iterator::operator==
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10147060
|
||||||
|
// list<MxStreamController *,allocator<MxStreamController *> >::push_back
|
||||||
|
|
||||||
|
// TEMPLATE: BETA10 0x10147200
|
||||||
|
// ??9@YAHABViterator@?$list@PAVMxStreamController@@V?$allocator@PAVMxStreamController@@@@@@0@Z
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
// TEMPLATE: BETA10 0x10147230
|
||||||
|
// ?find@@YA?AViterator@?$list@PAVMxStreamController@@V?$allocator@PAVMxStreamController@@@@@@V12@0ABQAVMxStreamController@@@Z
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
#endif // MXSTREAMER_H
|
#endif // MXSTREAMER_H
|
||||||
|
|
|
@ -63,6 +63,7 @@ MxResult MxNotificationManager::Create(MxU32 p_frequencyMS, MxBool p_createThrea
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100ac6c0
|
// FUNCTION: LEGO1 0x100ac6c0
|
||||||
|
// FUNCTION: BETA10 0x10125b57
|
||||||
MxResult MxNotificationManager::Send(MxCore* p_listener, const MxNotificationParam& p_param)
|
MxResult MxNotificationManager::Send(MxCore* p_listener, const MxNotificationParam& p_param)
|
||||||
{
|
{
|
||||||
AUTOLOCK(m_lock);
|
AUTOLOCK(m_lock);
|
||||||
|
|
|
@ -37,8 +37,8 @@ MxResult MxStreamer::Create()
|
||||||
// FUNCTION: BETA10 0x10145268
|
// FUNCTION: BETA10 0x10145268
|
||||||
MxStreamer::~MxStreamer()
|
MxStreamer::~MxStreamer()
|
||||||
{
|
{
|
||||||
while (!m_openStreams.empty()) {
|
while (!m_controllers.empty()) {
|
||||||
MxStreamController* controller = m_openStreams.front();
|
MxStreamController* controller = m_controllers.front();
|
||||||
|
|
||||||
#ifdef COMPAT_MODE
|
#ifdef COMPAT_MODE
|
||||||
{
|
{
|
||||||
|
@ -49,7 +49,7 @@ MxStreamer::~MxStreamer()
|
||||||
assert(controller->IsStoped(&MxDSAction()));
|
assert(controller->IsStoped(&MxDSAction()));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_openStreams.pop_front();
|
m_controllers.pop_front();
|
||||||
delete controller;
|
delete controller;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,11 +99,11 @@ MxLong MxStreamer::Close(const char* p_name)
|
||||||
MxDSAction ds;
|
MxDSAction ds;
|
||||||
ds.SetUnknown24(-2);
|
ds.SetUnknown24(-2);
|
||||||
|
|
||||||
for (list<MxStreamController*>::iterator it = m_openStreams.begin(); it != m_openStreams.end(); it++) {
|
for (list<MxStreamController*>::iterator it = m_controllers.begin(); it != m_controllers.end(); it++) {
|
||||||
MxStreamController* c = *it;
|
MxStreamController* c = *it;
|
||||||
|
|
||||||
if (!p_name || !strcmp(p_name, c->GetAtom().GetInternal())) {
|
if (!p_name || c->GetAtom() == p_name) {
|
||||||
m_openStreams.erase(it);
|
m_controllers.erase(it);
|
||||||
|
|
||||||
if (c->IsStoped(&ds)) {
|
if (c->IsStoped(&ds)) {
|
||||||
delete c;
|
delete c;
|
||||||
|
@ -120,6 +120,7 @@ MxLong MxStreamer::Close(const char* p_name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100b9700
|
// FUNCTION: LEGO1 0x100b9700
|
||||||
|
// FUNCTION: BETA10 0x10146ed0
|
||||||
MxNotificationParam* MxStreamerNotification::Clone() const
|
MxNotificationParam* MxStreamerNotification::Clone() const
|
||||||
{
|
{
|
||||||
return new MxStreamerNotification(m_type, m_sender, m_controller);
|
return new MxStreamerNotification(m_type, m_sender, m_controller);
|
||||||
|
@ -129,13 +130,9 @@ MxNotificationParam* MxStreamerNotification::Clone() const
|
||||||
// FUNCTION: BETA10 0x1014584b
|
// FUNCTION: BETA10 0x1014584b
|
||||||
MxStreamController* MxStreamer::GetOpenStream(const char* p_name)
|
MxStreamController* MxStreamer::GetOpenStream(const char* p_name)
|
||||||
{
|
{
|
||||||
for (list<MxStreamController*>::iterator it = m_openStreams.begin(); it != m_openStreams.end(); it++) {
|
for (list<MxStreamController*>::iterator it = m_controllers.begin(); it != m_controllers.end(); it++) {
|
||||||
MxStreamController* c = *it;
|
if ((*it)->GetAtom() == p_name) {
|
||||||
MxAtomId& atom = c->GetAtom();
|
return *it;
|
||||||
if (p_name) {
|
|
||||||
if (!strcmp(atom.GetInternal(), p_name)) {
|
|
||||||
return *it;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,10 +149,16 @@ void MxStreamer::FUN_100b98f0(MxDSAction* p_action)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100b9930
|
// FUNCTION: LEGO1 0x100b9930
|
||||||
|
// FUNCTION: BETA10 0x101458e5
|
||||||
MxResult MxStreamer::AddStreamControllerToOpenList(MxStreamController* p_stream)
|
MxResult MxStreamer::AddStreamControllerToOpenList(MxStreamController* p_stream)
|
||||||
{
|
{
|
||||||
if (find(m_openStreams.begin(), m_openStreams.end(), p_stream) == m_openStreams.end()) {
|
list<MxStreamController*>::iterator i = find(m_controllers.begin(), m_controllers.end(), p_stream);
|
||||||
m_openStreams.push_back(p_stream);
|
|
||||||
|
assert(i == m_controllers.end());
|
||||||
|
|
||||||
|
// DECOMP: Retail is missing the optimization that skips this check if find() reaches the end.
|
||||||
|
if (i == m_controllers.end()) {
|
||||||
|
m_controllers.push_back(p_stream);
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,37 +166,41 @@ MxResult MxStreamer::AddStreamControllerToOpenList(MxStreamController* p_stream)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100b99b0
|
// FUNCTION: LEGO1 0x100b99b0
|
||||||
|
// FUNCTION: BETA10 0x101459ad
|
||||||
MxResult MxStreamer::FUN_100b99b0(MxDSAction* p_action)
|
MxResult MxStreamer::FUN_100b99b0(MxDSAction* p_action)
|
||||||
{
|
{
|
||||||
MxStreamController* controller;
|
// TODO: MxAtomId operator== used here for NULL test. BETA10 0x1007dc20
|
||||||
if (p_action != NULL && p_action->GetAtomId().GetInternal() != NULL && p_action->GetObjectId() != -1) {
|
if (p_action == NULL || p_action->GetAtomId().GetInternal() == NULL || p_action->GetObjectId() == -1) {
|
||||||
controller = GetOpenStream(p_action->GetAtomId().GetInternal());
|
return FAILURE;
|
||||||
if (controller == NULL) {
|
|
||||||
return FAILURE;
|
|
||||||
}
|
|
||||||
return controller->VTable0x20(p_action);
|
|
||||||
}
|
}
|
||||||
return FAILURE;
|
|
||||||
|
MxStreamController* controller = GetOpenStream(p_action->GetAtomId().GetInternal());
|
||||||
|
if (controller == NULL) {
|
||||||
|
return FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return controller->VTable0x20(p_action);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100b99f0
|
// FUNCTION: LEGO1 0x100b99f0
|
||||||
|
// FUNCTION: BETA10 0x10145a54
|
||||||
MxResult MxStreamer::DeleteObject(MxDSAction* p_dsAction)
|
MxResult MxStreamer::DeleteObject(MxDSAction* p_dsAction)
|
||||||
{
|
{
|
||||||
MxDSAction tempAction;
|
MxDSAction tempAction;
|
||||||
|
|
||||||
if (p_dsAction == NULL) {
|
if (p_dsAction) {
|
||||||
tempAction.SetUnknown24(-2);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
tempAction.SetObjectId(p_dsAction->GetObjectId());
|
tempAction.SetObjectId(p_dsAction->GetObjectId());
|
||||||
tempAction.SetAtomId(p_dsAction->GetAtomId());
|
tempAction.SetAtomId(p_dsAction->GetAtomId());
|
||||||
tempAction.SetUnknown24(p_dsAction->GetUnknown24());
|
tempAction.SetUnknown24(p_dsAction->GetUnknown24());
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
tempAction.SetUnknown24(-2);
|
||||||
|
}
|
||||||
|
|
||||||
MxResult result = FAILURE;
|
MxResult result = FAILURE;
|
||||||
for (list<MxStreamController*>::iterator it = m_openStreams.begin(); it != m_openStreams.end(); it++) {
|
for (list<MxStreamController*>::iterator it = m_controllers.begin(); it != m_controllers.end(); it++) {
|
||||||
const char* id = p_dsAction->GetAtomId().GetInternal();
|
// TODO: MxAtomId operator== used here for NULL test. BETA10 0x1007dc20
|
||||||
if (!id || id == (*it)->GetAtom().GetInternal()) {
|
if (p_dsAction->GetAtomId().GetInternal() == NULL || p_dsAction->GetAtomId() == (*it)->GetAtom()) {
|
||||||
tempAction.SetAtomId((*it)->GetAtom());
|
tempAction.SetAtomId((*it)->GetAtom());
|
||||||
result = (*it)->VTable0x24(&tempAction);
|
result = (*it)->VTable0x24(&tempAction);
|
||||||
}
|
}
|
||||||
|
@ -203,6 +210,7 @@ MxResult MxStreamer::DeleteObject(MxDSAction* p_dsAction)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100b9b30
|
// FUNCTION: LEGO1 0x100b9b30
|
||||||
|
// FUNCTION: BETA10 0x10145d01
|
||||||
MxBool MxStreamer::FUN_100b9b30(MxDSObject& p_dsObject)
|
MxBool MxStreamer::FUN_100b9b30(MxDSObject& p_dsObject)
|
||||||
{
|
{
|
||||||
MxStreamController* controller = GetOpenStream(p_dsObject.GetAtomId().GetInternal());
|
MxStreamController* controller = GetOpenStream(p_dsObject.GetAtomId().GetInternal());
|
||||||
|
@ -213,21 +221,31 @@ MxBool MxStreamer::FUN_100b9b30(MxDSObject& p_dsObject)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100b9b60
|
// FUNCTION: LEGO1 0x100b9b60
|
||||||
|
// FUNCTION: BETA10 0x10145d51
|
||||||
MxLong MxStreamer::Notify(MxParam& p_param)
|
MxLong MxStreamer::Notify(MxParam& p_param)
|
||||||
{
|
{
|
||||||
if (((MxNotificationParam&) p_param).GetNotification() == c_notificationStreamer) {
|
MxStreamerNotification& s = static_cast<MxStreamerNotification&>(p_param);
|
||||||
|
|
||||||
|
switch (s.GetNotification()) {
|
||||||
|
case c_notificationStreamer: {
|
||||||
|
// DECOMP: Beta does not use a variable, but this matches retail better.
|
||||||
|
MxStreamController* c = s.GetController();
|
||||||
|
|
||||||
MxDSAction ds;
|
MxDSAction ds;
|
||||||
|
|
||||||
ds.SetUnknown24(-2);
|
ds.SetUnknown24(-2);
|
||||||
|
|
||||||
MxStreamController* c = static_cast<MxStreamerNotification&>(p_param).GetController();
|
|
||||||
|
|
||||||
if (c->IsStoped(&ds)) {
|
if (c->IsStoped(&ds)) {
|
||||||
delete c;
|
delete c;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
NotificationManager()->Send(this, MxStreamerNotification(c_notificationStreamer, NULL, c));
|
NotificationManager()->Send(this, MxStreamerNotification(c_notificationStreamer, NULL, c));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
assert(0);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue