From f84abd61afd52a068d1783fc316c2c6378eb96b8 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Tue, 26 Dec 2023 14:59:59 -0500 Subject: [PATCH] Match MxDiskStreamProvider::VTable0x20 --- LEGO1/mxdiskstreamprovider.cpp | 27 ++++++++++++--------------- LEGO1/mxdschunk.h | 1 - 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/LEGO1/mxdiskstreamprovider.cpp b/LEGO1/mxdiskstreamprovider.cpp index bd52e3a4..badc1623 100644 --- a/LEGO1/mxdiskstreamprovider.cpp +++ b/LEGO1/mxdiskstreamprovider.cpp @@ -81,27 +81,26 @@ MxResult MxDiskStreamProvider::SetResourceToGet(MxStreamController* p_resource) void MxDiskStreamProvider::VTable0x20(MxDSAction* p_action) { MxDSStreamingAction* action; + if (p_action->GetObjectId() == -1) { - m_unk0x35 = 1; + m_unk0x35 = FALSE; + do { + action = NULL; + { MxAutoLocker lock(&m_criticalSection); - action = NULL; - if (m_list.size()) { - m_list.pop_front(); - } + m_list.PopFrontStreamingAction(action); } - if (action == NULL) { + if (!action) return; - } - if (action->GetUnknowna0()->GetWriteOffset() < 0x20000) { + if (action->GetUnknowna0()->GetWriteOffset() < 0x20000) g_unk0x10102878--; - } ((MxDiskStreamController*) m_pLookup)->FUN_100c8670(action); - } while (action != NULL); + } while (action); } else { do { @@ -110,16 +109,14 @@ void MxDiskStreamProvider::VTable0x20(MxDSAction* p_action) action = (MxDSStreamingAction*) m_list.Find(p_action, TRUE); } - if (action == NULL) { + if (!action) return; - } - if (action->GetUnknowna0()->GetWriteOffset() < 0x20000) { + if (action->GetUnknowna0()->GetWriteOffset() < 0x20000) g_unk0x10102878--; - } ((MxDiskStreamController*) m_pLookup)->FUN_100c8670(action); - } while (action != NULL); + } while (action); } } diff --git a/LEGO1/mxdschunk.h b/LEGO1/mxdschunk.h index 5e438bd4..ec4a8cbe 100644 --- a/LEGO1/mxdschunk.h +++ b/LEGO1/mxdschunk.h @@ -46,7 +46,6 @@ class MxDSChunk : public MxCore { inline MxU16 GetFlags() { return m_flags; } inline undefined4 GetObjectId() { return m_objectId; } inline MxLong GetTime() { return m_time; } - inline MxLong& GetTimeRef() { return m_time; } inline MxU32 GetLength() { return m_length; } inline MxU8* GetData() { return m_data; }