mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-25 17:21:17 +00:00
Improve match of MxDSBuffer::FUN_100c67b0
This commit is contained in:
parent
ea6dcde105
commit
2802f6eefe
@ -128,35 +128,35 @@ MxResult MxDSBuffer::FUN_100c67b0(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
MxResult result = FAILURE;
|
MxResult result = FAILURE;
|
||||||
MxU8* data;
|
|
||||||
m_unk0x30 = (MxDSStreamingAction*) p_controller->GetUnk0x3c().Find(p_action, FALSE);
|
m_unk0x30 = (MxDSStreamingAction*) p_controller->GetUnk0x3c().Find(p_action, FALSE);
|
||||||
if (m_unk0x30 == NULL) {
|
if (m_unk0x30 == NULL)
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
|
||||||
|
|
||||||
do {
|
MxU8* data;
|
||||||
while (TRUE) {
|
while (data = (MxU8*) SkipToData()) {
|
||||||
data = (MxU8*) SkipToData();
|
if (*p_streamingAction == NULL) {
|
||||||
if (data == NULL) {
|
result = CreateObject(p_controller, (MxU32*) data, p_action, p_streamingAction);
|
||||||
return SUCCESS;
|
|
||||||
}
|
if (result == FAILURE)
|
||||||
if (*p_streamingAction == NULL) {
|
return result;
|
||||||
|
// TODO: Not a MxResult value?
|
||||||
|
if (result == 1)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
MxDSBuffer* buffer = (*p_streamingAction)->GetUnknowna0();
|
MxDSBuffer* buffer = (*p_streamingAction)->GetUnknowna0();
|
||||||
|
|
||||||
if (CalcBytesRemaining(data) != SUCCESS) {
|
if (buffer->CalcBytesRemaining(data) != SUCCESS) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buffer->GetBytesRemaining() == 0) {
|
if (buffer->GetBytesRemaining() == 0) {
|
||||||
buffer->SetUnk30(m_unk0x30);
|
buffer->SetUnk30(m_unk0x30);
|
||||||
|
|
||||||
MxResult createObjectBufferResult =
|
result = buffer->CreateObject(p_controller, (MxU32*) buffer->GetBuffer(), p_action, p_streamingAction);
|
||||||
buffer->CreateObject(p_controller, (MxU32*) buffer->GetBuffer(), p_action, p_streamingAction);
|
if (result != SUCCESS) {
|
||||||
if (createObjectBufferResult != SUCCESS) {
|
return result;
|
||||||
return createObjectBufferResult;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buffer->GetRefCount() != 0) {
|
if (buffer->GetRefCount() != 0) {
|
||||||
@ -167,16 +167,9 @@ MxResult MxDSBuffer::FUN_100c67b0(
|
|||||||
|
|
||||||
((MxDiskStreamController*) p_controller)->FUN_100c7cb0(*p_streamingAction);
|
((MxDiskStreamController*) p_controller)->FUN_100c7cb0(*p_streamingAction);
|
||||||
*p_streamingAction = NULL;
|
*p_streamingAction = NULL;
|
||||||
result = SUCCESS;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
MxResult createObjectResult = CreateObject(p_controller, (MxU32*) data, p_action, p_streamingAction);
|
|
||||||
if (createObjectResult == FAILURE) {
|
|
||||||
return FAILURE;
|
|
||||||
}
|
|
||||||
result = createObjectResult;
|
|
||||||
} while (result != 1);
|
|
||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user