mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-28 02:31:15 +00:00
implement rest of MxDSBuffer
This commit is contained in:
parent
0fd05e5a4d
commit
190926572f
@ -30,11 +30,40 @@ MxDSBuffer::MxDSBuffer()
|
|||||||
MxDSBuffer::~MxDSBuffer()
|
MxDSBuffer::~MxDSBuffer()
|
||||||
{
|
{
|
||||||
if (m_pBuffer != NULL) {
|
if (m_pBuffer != NULL) {
|
||||||
if (m_mode == MxDSBufferType_Chunk) {
|
|
||||||
// TODO
|
switch (m_mode) {
|
||||||
}
|
case MxDSBufferType_Allocate:
|
||||||
else if (m_mode == MxDSBufferType_Allocate || m_mode == MxDSBufferType_Unknown) {
|
case MxDSBufferType_Unknown:
|
||||||
delete[] m_pBuffer;
|
delete[] m_pBuffer;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MxDSBufferType_Chunk: {
|
||||||
|
MxStreamer* streamer = Streamer();
|
||||||
|
switch (m_writeOffset / 1024) {
|
||||||
|
case 0x40: {
|
||||||
|
MxU32 a = streamer->GetSubclass1().GetSize() << 10;
|
||||||
|
MxU32 bit = ((m_pBuffer - streamer->GetSubclass1().GetBuffer()) / a) & 0x1f;
|
||||||
|
MxU32 index = (((m_pBuffer - streamer->GetSubclass1().GetBuffer()) / a) & 0xFFFFFFE7) >> 3;
|
||||||
|
|
||||||
|
if (((((*(MxU32*) &streamer->GetSubclass1().GetUnk08Ref()[(index)])) & 1) << bit) != 0) {
|
||||||
|
MxU32* ptr = (MxU32*) &streamer->GetSubclass1().GetUnk08Ref()[(index)];
|
||||||
|
*ptr = *ptr ^ bit;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x80: {
|
||||||
|
MxU32 a = streamer->GetSubclass2().GetSize() << 10;
|
||||||
|
MxU32 bit = ((m_pBuffer - streamer->GetSubclass2().GetBuffer()) / a) & 0x1f;
|
||||||
|
MxU32 index = (((m_pBuffer - streamer->GetSubclass2().GetBuffer()) / a) & 0xFFFFFFE7) >> 3;
|
||||||
|
|
||||||
|
if (((((*(MxU32*) &streamer->GetSubclass2().GetUnk08Ref()[(index)])) & 1) << bit) != 0) {
|
||||||
|
MxU32* ptr = (MxU32*) &streamer->GetSubclass2().GetUnk08Ref()[(index)];
|
||||||
|
*ptr = *ptr ^ bit;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -274,7 +303,20 @@ MxResult MxDSBuffer::ParseChunk(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
OutputDebugString("Case A not implemented in parse Chunk\n");
|
if (p_action->GetObjectId() == p_header->GetObjectId()) {
|
||||||
|
MxU32 val = p_controller->GetProvider()->GetBufferForDWords()[m_unk0x30->GetObjectId()];
|
||||||
|
m_unk0x30->SetUnknown94(val);
|
||||||
|
m_unk0x30->SetBufferOffset((val / m_writeOffset) * m_writeOffset);
|
||||||
|
MxNextActionDataStart* data =
|
||||||
|
p_controller->FindNextActionDataStartFromStreamingAction(m_unk0x30);
|
||||||
|
if (data) {
|
||||||
|
data->SetData(m_unk0x30->GetBufferOffset());
|
||||||
|
}
|
||||||
|
m_unk0x30->FUN_100cd2d0();
|
||||||
|
}
|
||||||
|
|
||||||
|
delete p_header;
|
||||||
|
p_header = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -259,6 +259,12 @@ MxResult MxStreamController::FUN_100c1f00(MxDSAction* p_action)
|
|||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// STUB: LEGO1 0x100c20b0
|
||||||
|
MxNextActionDataStart* MxStreamController::FindNextActionDataStartFromStreamingAction(MxDSStreamingAction* p_action)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x100c20d0
|
// STUB: LEGO1 0x100c20d0
|
||||||
MxBool MxStreamController::FUN_100c20d0(MxDSObject& p_obj)
|
MxBool MxStreamController::FUN_100c20d0(MxDSObject& p_obj)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -51,6 +51,7 @@ class MxStreamController : public MxCore {
|
|||||||
MxResult FUN_100c1f00(MxDSAction* p_action);
|
MxResult FUN_100c1f00(MxDSAction* p_action);
|
||||||
MxBool FUN_100c20d0(MxDSObject& p_obj);
|
MxBool FUN_100c20d0(MxDSObject& p_obj);
|
||||||
MxResult InsertActionToList54(MxDSAction* p_action);
|
MxResult InsertActionToList54(MxDSAction* p_action);
|
||||||
|
MxNextActionDataStart* FindNextActionDataStartFromStreamingAction(MxDSStreamingAction* p_action);
|
||||||
|
|
||||||
inline MxAtomId& GetAtom() { return m_atom; };
|
inline MxAtomId& GetAtom() { return m_atom; };
|
||||||
inline MxStreamProvider* GetProvider() { return m_provider; };
|
inline MxStreamProvider* GetProvider() { return m_provider; };
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user