2023-09-25 22:30:56 -04:00
|
|
|
#include "mxramstreamcontroller.h"
|
2023-10-24 19:38:27 -04:00
|
|
|
|
2023-10-29 10:01:14 -04:00
|
|
|
#include "mxautolocker.h"
|
2023-10-08 16:41:34 -04:00
|
|
|
#include "mxramstreamprovider.h"
|
2023-09-25 22:30:56 -04:00
|
|
|
|
|
|
|
DECOMP_SIZE_ASSERT(MxRAMStreamController, 0x98);
|
2023-10-08 16:41:34 -04:00
|
|
|
|
2023-11-21 03:44:45 -05:00
|
|
|
undefined* __cdecl FUN_100d0d80(MxU32* p_fileSizeBuffer, MxU32 p_fileSize);
|
2023-10-29 10:01:14 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100c6110
|
2023-10-24 19:38:27 -04:00
|
|
|
MxResult MxRAMStreamController::Open(const char* p_filename)
|
2023-10-08 16:41:34 -04:00
|
|
|
{
|
2023-10-29 10:01:14 -04:00
|
|
|
MxAutoLocker locker(&m_criticalSection);
|
|
|
|
if (MxStreamController::Open(p_filename) != SUCCESS) {
|
|
|
|
return FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_provider = new MxRAMStreamProvider();
|
|
|
|
if (((MxRAMStreamProvider*) m_provider) != NULL) {
|
|
|
|
if (m_provider->SetResourceToGet(this) != SUCCESS) {
|
|
|
|
return FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
FUN_100d0d80(
|
|
|
|
((MxRAMStreamProvider*) m_provider)->GetBufferOfFileSize(),
|
|
|
|
((MxRAMStreamProvider*) m_provider)->GetFileSize()
|
|
|
|
);
|
2023-10-30 09:54:00 -04:00
|
|
|
m_buffer.SetBufferPointer(
|
2023-10-29 10:01:14 -04:00
|
|
|
((MxRAMStreamProvider*) m_provider)->GetBufferOfFileSize(),
|
|
|
|
((MxRAMStreamProvider*) m_provider)->GetFileSize()
|
|
|
|
);
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
return FAILURE;
|
2023-10-08 16:41:34 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// STUB: LEGO1 0x100c6210
|
2023-10-08 16:41:34 -04:00
|
|
|
MxResult MxRAMStreamController::vtable0x20(MxDSAction* p_action)
|
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
// TODO STUB
|
|
|
|
return FAILURE;
|
2023-10-08 16:41:34 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// STUB: LEGO1 0x100c6320
|
2023-10-08 16:41:34 -04:00
|
|
|
MxResult MxRAMStreamController::vtable0x24(undefined4 p_unknown)
|
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
// TODO STUB
|
|
|
|
return FAILURE;
|
2023-10-08 16:41:34 -04:00
|
|
|
}
|
2023-11-21 03:44:45 -05:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// STUB: LEGO1 0x100d0d80
|
2023-11-21 03:44:45 -05:00
|
|
|
undefined* __cdecl FUN_100d0d80(MxU32* p_fileSizeBuffer, MxU32 p_fileSize)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|