mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-28 02:31:15 +00:00
Mostly match MxDiskStreamProvider::FUN_100d1780
This commit is contained in:
parent
d403ff70b5
commit
503941c11a
@ -341,6 +341,7 @@ void MxDiskStreamController::FUN_100c8540()
|
|||||||
MxAutoLocker lock(&this->m_criticalSection);
|
MxAutoLocker lock(&this->m_criticalSection);
|
||||||
for (list<MxDSBuffer*>::iterator it = m_list0x74.begin(); it != m_list0x74.end();) {
|
for (list<MxDSBuffer*>::iterator it = m_list0x74.begin(); it != m_list0x74.end();) {
|
||||||
MxDSBuffer* buf = *it;
|
MxDSBuffer* buf = *it;
|
||||||
|
// TODO: Match
|
||||||
if (buf->GetRefCount() == 0) {
|
if (buf->GetRefCount() == 0) {
|
||||||
m_list0x74.erase(it++);
|
m_list0x74.erase(it++);
|
||||||
FUN_100c7ce0(buf);
|
FUN_100c7ce0(buf);
|
||||||
|
|||||||
@ -96,34 +96,35 @@ MxResult MxDiskStreamProvider::WaitForWorkToComplete()
|
|||||||
// FUNCTION: LEGO1 0x100d1780
|
// FUNCTION: LEGO1 0x100d1780
|
||||||
MxResult MxDiskStreamProvider::FUN_100d1780(MxDSStreamingAction* p_action)
|
MxResult MxDiskStreamProvider::FUN_100d1780(MxDSStreamingAction* p_action)
|
||||||
{
|
{
|
||||||
if (m_remainingWork != 0) {
|
if (m_remainingWork == 0)
|
||||||
if (p_action->GetUnknown94() > 0 && !p_action->GetUnknowna0()) {
|
return FAILURE;
|
||||||
MxDSBuffer* buffer = new MxDSBuffer();
|
|
||||||
if (buffer) {
|
if (p_action->GetUnknown9c() > 0 && !p_action->GetUnknowna0()) {
|
||||||
if (buffer->AllocateBuffer(GetFileSize(), MxDSBufferType_Allocate) == SUCCESS) {
|
MxDSBuffer* buffer = new MxDSBuffer();
|
||||||
p_action->SetUnknowna0(buffer);
|
|
||||||
}
|
if (!buffer)
|
||||||
else {
|
return FAILURE;
|
||||||
delete buffer;
|
|
||||||
return FAILURE;
|
if (buffer->AllocateBuffer(GetFileSize(), MxDSBufferType_Allocate) != SUCCESS) {
|
||||||
}
|
delete buffer;
|
||||||
}
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_action->GetUnknowna0()->GetWriteOffset() < 0x20000) {
|
p_action->SetUnknowna0(buffer);
|
||||||
g_unk0x10102878++;
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
MxAutoLocker lock(&m_criticalSection);
|
|
||||||
m_list.push_back(p_action);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_unk0x35 = 1;
|
|
||||||
m_busySemaphore.Release(1);
|
|
||||||
return SUCCESS;
|
|
||||||
}
|
}
|
||||||
return FAILURE;
|
|
||||||
|
if (p_action->GetUnknowna0()->GetWriteOffset() < 0x20000) {
|
||||||
|
g_unk0x10102878++;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
MxAutoLocker lock(&m_criticalSection);
|
||||||
|
m_list.push_back(p_action);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_unk0x35 = 1;
|
||||||
|
m_busySemaphore.Release(1);
|
||||||
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100d18f0
|
// FUNCTION: LEGO1 0x100d18f0
|
||||||
|
|||||||
@ -27,7 +27,6 @@ class MxDiskStreamProviderThread : public MxThread {
|
|||||||
class MxDiskStreamProvider : public MxStreamProvider {
|
class MxDiskStreamProvider : public MxStreamProvider {
|
||||||
public:
|
public:
|
||||||
MxDiskStreamProvider();
|
MxDiskStreamProvider();
|
||||||
|
|
||||||
virtual ~MxDiskStreamProvider() override;
|
virtual ~MxDiskStreamProvider() override;
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100d1160
|
// FUNCTION: LEGO1 0x100d1160
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class MxDSStreamingAction : public MxDSAction {
|
|||||||
void FUN_100cd2d0();
|
void FUN_100cd2d0();
|
||||||
|
|
||||||
inline MxU32 GetUnknown94() { return m_unk0x94; }
|
inline MxU32 GetUnknown94() { return m_unk0x94; }
|
||||||
inline MxU32 GetUnknown9c() { return m_unk0x9c; }
|
inline MxS32 GetUnknown9c() { return m_unk0x9c; }
|
||||||
inline MxDSBuffer* GetUnknowna0() { return m_unk0xa0; }
|
inline MxDSBuffer* GetUnknowna0() { return m_unk0xa0; }
|
||||||
inline MxDSBuffer* GetUnknowna4() { return m_unk0xa4; }
|
inline MxDSBuffer* GetUnknowna4() { return m_unk0xa4; }
|
||||||
inline MxDSAction* GetInternalAction() { return m_internalAction; }
|
inline MxDSAction* GetInternalAction() { return m_internalAction; }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user