mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-28 18:51:16 +00:00
Readability
This commit is contained in:
parent
0d8caf3d34
commit
95e87a9972
@ -272,21 +272,28 @@ MxBool MxDiskStreamProvider::FUN_100d1af0(MxDSStreamingAction* p_action)
|
||||
MxResult MxDiskStreamProvider::FUN_100d1b20(MxDSStreamingAction* p_action)
|
||||
{
|
||||
MxDSBuffer* buffer = new MxDSBuffer();
|
||||
|
||||
if (!buffer)
|
||||
return FAILURE;
|
||||
|
||||
MxU32 size = p_action->GetUnknowna0()->GetWriteOffset() - p_action->GetUnknown94() + p_action->GetBufferOffset() +
|
||||
(p_action->GetUnknowna4() ? p_action->GetUnknowna4()->GetWriteOffset() : 0);
|
||||
|
||||
if (buffer->AllocateBuffer(size, MxDSBufferType_Allocate) != SUCCESS) {
|
||||
if (!buffer)
|
||||
return FAILURE;
|
||||
|
||||
delete buffer;
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
MxDSBuffer* buffer2 = p_action->GetUnknowna4();
|
||||
MxU8** pdata;
|
||||
MxU8* data;
|
||||
|
||||
if (buffer2 == NULL) {
|
||||
pdata = buffer->GetBufferRef();
|
||||
|
||||
memcpy(
|
||||
data = *pdata,
|
||||
p_action->GetUnknowna0()->GetBuffer() - p_action->GetBufferOffset() + p_action->GetUnknown94(),
|
||||
@ -296,38 +303,49 @@ MxResult MxDiskStreamProvider::FUN_100d1b20(MxDSStreamingAction* p_action)
|
||||
else {
|
||||
buffer->FUN_100c7090(buffer2);
|
||||
pdata = buffer->GetBufferRef();
|
||||
|
||||
memcpy(
|
||||
data = (p_action->GetUnknowna4()->GetWriteOffset() + *pdata),
|
||||
p_action->GetUnknowna0()->GetBuffer(),
|
||||
p_action->GetUnknowna0()->GetWriteOffset()
|
||||
);
|
||||
|
||||
delete p_action->GetUnknowna4();
|
||||
}
|
||||
|
||||
p_action->SetUnknowna4(buffer);
|
||||
|
||||
while (data) {
|
||||
if (*MxDSChunk::IntoType(data) != 'bOxM') {
|
||||
if (*MxDSChunk::IntoType(data) != FOURCC('M', 'x', 'O', 'b')) {
|
||||
if (*MxStreamChunk::IntoTime(data) > p_action->GetUnknown9c()) {
|
||||
*MxDSChunk::IntoType(data) = ' dap';
|
||||
*MxDSChunk::IntoType(data) = FOURCC('p', 'a', 'd', ' ');
|
||||
|
||||
memcpy(data + 8, *pdata, buffer->GetWriteOffset() + *pdata - data - 8);
|
||||
size = ReadData(*pdata, buffer->GetWriteOffset());
|
||||
|
||||
MxDSBuffer* buffer3 = new MxDSBuffer();
|
||||
if (!buffer3)
|
||||
return FAILURE;
|
||||
|
||||
if (buffer3->AllocateBuffer(size, MxDSBufferType_Allocate) == SUCCESS) {
|
||||
memcpy(buffer3->GetBuffer(), p_action->GetUnknowna4()->GetBuffer(), size);
|
||||
p_action->GetUnknowna4()->SetMode(MxDSBufferType_Allocate);
|
||||
delete p_action->GetUnknowna4();
|
||||
|
||||
buffer3->SetMode(MxDSBufferType_Unknown);
|
||||
p_action->SetUnknowna4(buffer3);
|
||||
MxDSBuffer* buffer4 = p_action->GetUnknowna0();
|
||||
MxU32 unk0x14 = buffer4->GetUnknown14();
|
||||
MxU8* data2 = buffer4->GetBuffer();
|
||||
while (true) {
|
||||
|
||||
while (TRUE) {
|
||||
if (*MxStreamChunk::IntoTime(data2) > p_action->GetUnknown9c())
|
||||
break;
|
||||
|
||||
data += MxDSChunk::Size(*MxDSChunk::IntoLength(data));
|
||||
unk0x14 += MxDSChunk::Size(*MxDSChunk::IntoLength(data));
|
||||
}
|
||||
|
||||
p_action->SetUnknown94(unk0x14);
|
||||
p_action->SetBufferOffset(p_action->GetUnknowna0()->GetUnknown14());
|
||||
delete p_action->GetUnknowna0();
|
||||
@ -339,8 +357,10 @@ MxResult MxDiskStreamProvider::FUN_100d1b20(MxDSStreamingAction* p_action)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
data = buffer->FUN_100c6fa0(data);
|
||||
}
|
||||
|
||||
p_action->SetUnknown94(GetFileSize() + p_action->GetBufferOffset());
|
||||
p_action->SetBufferOffset(GetFileSize() + p_action->GetBufferOffset());
|
||||
FUN_100d1780(p_action);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user