2023-10-12 12:18:24 -04:00
|
|
|
#include "legounksavedatawriter.h"
|
2023-10-24 19:38:27 -04:00
|
|
|
|
2023-10-12 12:18:24 -04:00
|
|
|
#include "legogamestate.h"
|
2024-01-22 10:18:46 -05:00
|
|
|
#include "roi/legoroi.h"
|
2023-10-12 12:18:24 -04:00
|
|
|
|
2024-02-10 20:52:16 -05:00
|
|
|
DECOMP_SIZE_ASSERT(LegoUnkSaveDataWriter, 0x08)
|
|
|
|
DECOMP_SIZE_ASSERT(LegoSaveDataEntry3, 0x108)
|
2023-10-12 12:18:24 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// GLOBAL: LEGO1 0x10104f20
|
2023-10-12 12:18:24 -04:00
|
|
|
LegoSaveDataEntry3 g_saveData3[66];
|
|
|
|
|
2024-02-10 20:52:16 -05:00
|
|
|
// STUB: LEGO1 0x10082a20
|
|
|
|
LegoUnkSaveDataWriter::LegoUnkSaveDataWriter()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
2024-02-05 12:35:26 -05:00
|
|
|
// STUB: LEGO1 0x100832a0
|
|
|
|
void LegoUnkSaveDataWriter::FUN_100832a0()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x10083310
|
2024-01-24 12:12:57 -05:00
|
|
|
MxResult LegoUnkSaveDataWriter::WriteSaveData3(LegoStorage* p_stream)
|
2023-10-12 12:18:24 -04:00
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
MxResult result = FAILURE;
|
2023-10-12 12:18:24 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
// This should probably be a for loop but I can't figure out how to
|
|
|
|
// make it match as a for loop.
|
|
|
|
LegoSaveDataEntry3* entry = g_saveData3;
|
|
|
|
const LegoSaveDataEntry3* end = &g_saveData3[66];
|
2023-10-12 12:18:24 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
while (TRUE) {
|
2024-02-01 15:42:10 -05:00
|
|
|
if (p_stream->Write(&entry->m_savePart1, 4) != SUCCESS) {
|
2023-10-24 19:38:27 -04:00
|
|
|
break;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
|
|
|
if (p_stream->Write(&entry->m_savePart2, 4) != SUCCESS) {
|
2023-10-24 19:38:27 -04:00
|
|
|
break;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
|
|
|
if (p_stream->Write(&entry->m_savePart3, 1) != SUCCESS) {
|
2023-10-24 19:38:27 -04:00
|
|
|
break;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
|
|
|
if (p_stream->Write(&entry->m_currentFrame, 1) != SUCCESS) {
|
2023-10-24 19:38:27 -04:00
|
|
|
break;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
|
|
|
if (p_stream->Write(&entry->m_savePart5, 1) != SUCCESS) {
|
2023-10-24 19:38:27 -04:00
|
|
|
break;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
|
|
|
if (p_stream->Write(&entry->m_savePart6, 1) != SUCCESS) {
|
2023-10-24 19:38:27 -04:00
|
|
|
break;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
|
|
|
if (p_stream->Write(&entry->m_savePart7, 1) != SUCCESS) {
|
2023-10-24 19:38:27 -04:00
|
|
|
break;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
|
|
|
if (p_stream->Write(&entry->m_savePart8, 1) != SUCCESS) {
|
2023-10-24 19:38:27 -04:00
|
|
|
break;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
|
|
|
if (p_stream->Write(&entry->m_savePart9, 1) != SUCCESS) {
|
2023-10-24 19:38:27 -04:00
|
|
|
break;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
|
|
|
if (p_stream->Write(&entry->m_savePart10, 1) != SUCCESS) {
|
2023-10-24 19:38:27 -04:00
|
|
|
break;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
2023-10-24 19:38:27 -04:00
|
|
|
if (++entry >= end) {
|
|
|
|
result = SUCCESS;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result;
|
2023-10-12 12:18:24 -04:00
|
|
|
}
|
2024-01-16 14:33:03 -05:00
|
|
|
|
2024-01-22 10:18:46 -05:00
|
|
|
// STUB: LEGO1 0x10083500
|
2024-02-11 09:03:56 -05:00
|
|
|
AutoROI* LegoUnkSaveDataWriter::FUN_10083500(char*, undefined4)
|
2024-01-22 10:18:46 -05:00
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
// involves an STL map with a _Nil node at 0x100fc508
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2024-01-16 14:33:03 -05:00
|
|
|
// STUB: LEGO1 0x10083db0
|
|
|
|
void LegoUnkSaveDataWriter::FUN_10083db0(LegoROI* p_roi)
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|