mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-28 18:51:16 +00:00
Add Read
This commit is contained in:
parent
616d1e9552
commit
b495350281
@ -58,8 +58,8 @@ class LegoCharacterManager {
|
|||||||
public:
|
public:
|
||||||
LegoCharacterManager();
|
LegoCharacterManager();
|
||||||
|
|
||||||
MxResult FUN_10083310(LegoStorage* p_storage);
|
MxResult Write(LegoStorage* p_storage);
|
||||||
MxResult FUN_100833f0(LegoStorage* p_storage);
|
MxResult Read(LegoStorage* p_storage);
|
||||||
LegoROI* GetROI(const char* p_key, MxBool p_createEntity);
|
LegoROI* GetROI(const char* p_key, MxBool p_createEntity);
|
||||||
|
|
||||||
void FUN_10083270();
|
void FUN_10083270();
|
||||||
|
|||||||
@ -52,7 +52,7 @@ void LegoCharacterManager::FUN_100832a0()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10083310
|
// FUNCTION: LEGO1 0x10083310
|
||||||
MxResult LegoCharacterManager::FUN_10083310(LegoStorage* p_storage)
|
MxResult LegoCharacterManager::Write(LegoStorage* p_storage)
|
||||||
{
|
{
|
||||||
MxResult result = FAILURE;
|
MxResult result = FAILURE;
|
||||||
|
|
||||||
@ -97,10 +97,50 @@ MxResult LegoCharacterManager::FUN_10083310(LegoStorage* p_storage)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x100833f0
|
// FUNCTION: LEGO1 0x100833f0
|
||||||
MxResult LegoCharacterManager::FUN_100833f0(LegoStorage* p_storage)
|
MxResult LegoCharacterManager::Read(LegoStorage* p_storage)
|
||||||
{
|
{
|
||||||
return SUCCESS;
|
MxResult result = FAILURE;
|
||||||
|
|
||||||
|
for (MxS32 i = 0; i < _countof(g_characterData); i++) {
|
||||||
|
LegoCharacterData* data = &g_characterData[i];
|
||||||
|
|
||||||
|
if (p_storage->Read(&data->m_unk0x0c, sizeof(data->m_unk0x0c)) != SUCCESS) {
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
if (p_storage->Read(&data->m_unk0x10, sizeof(data->m_unk0x10)) != SUCCESS) {
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
if (p_storage->Read(&data->m_unk0x14, sizeof(data->m_unk0x14)) != SUCCESS) {
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
if (p_storage->Read(&data->m_unk0x18[1].m_unk0x08, sizeof(data->m_unk0x18[1].m_unk0x08)) != SUCCESS) {
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
if (p_storage->Read(&data->m_unk0x18[1].m_unk0x14, sizeof(data->m_unk0x18[1].m_unk0x14)) != SUCCESS) {
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
if (p_storage->Read(&data->m_unk0x18[2].m_unk0x14, sizeof(data->m_unk0x18[2].m_unk0x14)) != SUCCESS) {
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
if (p_storage->Read(&data->m_unk0x18[4].m_unk0x14, sizeof(data->m_unk0x18[4].m_unk0x14)) != SUCCESS) {
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
if (p_storage->Read(&data->m_unk0x18[5].m_unk0x14, sizeof(data->m_unk0x18[5].m_unk0x14)) != SUCCESS) {
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
if (p_storage->Read(&data->m_unk0x18[8].m_unk0x14, sizeof(data->m_unk0x18[8].m_unk0x14)) != SUCCESS) {
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
if (p_storage->Read(&data->m_unk0x18[9].m_unk0x14, sizeof(data->m_unk0x18[9].m_unk0x14)) != SUCCESS) {
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
result = SUCCESS;
|
||||||
|
|
||||||
|
done:
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10083500
|
// FUNCTION: LEGO1 0x10083500
|
||||||
|
|||||||
@ -235,7 +235,7 @@ MxResult LegoGameState::Save(MxULong p_slot)
|
|||||||
}
|
}
|
||||||
|
|
||||||
WriteEndOfVariables(&fileStorage);
|
WriteEndOfVariables(&fileStorage);
|
||||||
CharacterManager()->FUN_10083310(&fileStorage);
|
CharacterManager()->Write(&fileStorage);
|
||||||
PlantManager()->Save(&fileStorage);
|
PlantManager()->Save(&fileStorage);
|
||||||
result = BuildingManager()->Save(&fileStorage);
|
result = BuildingManager()->Save(&fileStorage);
|
||||||
|
|
||||||
@ -334,7 +334,7 @@ MxResult LegoGameState::Load(MxULong p_slot)
|
|||||||
SetLightPosition(atoi(lightPosition));
|
SetLightPosition(atoi(lightPosition));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CharacterManager()->FUN_100833f0(&fileStorage) == FAILURE) {
|
if (CharacterManager()->Read(&fileStorage) == FAILURE) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (PlantManager()->Load(&fileStorage) == FAILURE) {
|
if (PlantManager()->Load(&fileStorage) == FAILURE) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user