mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-24 00:44:21 +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
@@ -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