mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-26 18:04:06 +00:00
Move Read/Write functions to LegoStorage base class, match Act1State::Serialize (#1335)
* Move Read/Write function to LegoStorage base class * Proper const use for vector / BETA match * Match `Act1State::Serialize`
This commit is contained in:
committed by
GitHub
parent
77a3dc0795
commit
70b0f76fa1
@@ -82,7 +82,7 @@ public:
|
||||
|
||||
MxResult Remove();
|
||||
MxResult Create(Act3* p_world, MxU32 p_isPizza, MxS32 p_index);
|
||||
MxResult FUN_10053b40(Vector3& p_srcLoc, Vector3& p_srcDir, Vector3& p_srcUp);
|
||||
MxResult FUN_10053b40(const Vector3& p_srcLoc, const Vector3& p_srcDir, const Vector3& p_srcUp);
|
||||
MxResult FUN_10053cb0(LegoPathController* p_p, LegoPathBoundary* p_boundary, MxFloat p_unk0x19c);
|
||||
MxResult FUN_10053d30(LegoPathController* p_p, MxFloat p_unk0x19c);
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
return !strcmp(p_name, AmbulanceMissionState::ClassName()) || LegoState::IsA(p_name);
|
||||
}
|
||||
|
||||
MxResult Serialize(LegoFile* p_file) override; // vtable+0x1c
|
||||
MxResult Serialize(LegoStorage* p_storage) override; // vtable+0x1c
|
||||
|
||||
// FUNCTION: BETA10 0x10088770
|
||||
MxS16 GetHighScore(MxU8 p_actorId)
|
||||
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
return !strcmp(p_name, GasStationState::ClassName()) || LegoState::IsA(p_name);
|
||||
}
|
||||
|
||||
MxResult Serialize(LegoFile* p_file) override; // vtable+0x1c
|
||||
MxResult Serialize(LegoStorage* p_storage) override; // vtable+0x1c
|
||||
|
||||
// SYNTHETIC: LEGO1 0x10006290
|
||||
// GasStationState::`scalar deleting destructor'
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
return !strcmp(p_name, HospitalState::ClassName()) || LegoState::IsA(p_name);
|
||||
}
|
||||
|
||||
MxResult Serialize(LegoFile* p_file) override; // vtable+0x1c
|
||||
MxResult Serialize(LegoStorage* p_storage) override; // vtable+0x1c
|
||||
|
||||
// SYNTHETIC: LEGO1 0x100764c0
|
||||
// HospitalState::`scalar deleting destructor'
|
||||
|
||||
@@ -50,8 +50,8 @@ public:
|
||||
return !strcmp(p_name, Act1State::ClassName()) || LegoState::IsA(p_name);
|
||||
}
|
||||
|
||||
MxBool Reset() override; // vtable+0x18
|
||||
MxResult Serialize(LegoFile* p_file) override; // vtable+0x1c
|
||||
MxBool Reset() override; // vtable+0x18
|
||||
MxResult Serialize(LegoStorage* p_storage) override; // vtable+0x1c
|
||||
|
||||
void PlayCptClickDialogue();
|
||||
void StopCptClickDialogue();
|
||||
|
||||
@@ -70,8 +70,8 @@ public:
|
||||
return !strcmp(p_name, AnimState::ClassName()) || LegoState::IsA(p_name);
|
||||
}
|
||||
|
||||
MxBool Reset() override; // vtable+0x18
|
||||
MxResult Serialize(LegoFile* p_file) override; // vtable+0x1c
|
||||
MxBool Reset() override; // vtable+0x18
|
||||
MxResult Serialize(LegoStorage* p_storage) override; // vtable+0x1c
|
||||
|
||||
void CopyToAnims(MxU32, AnimInfo* p_anims, MxU32& p_outExtraCharacterId);
|
||||
void InitFromAnims(MxU32 p_animsLength, AnimInfo* p_anims, MxU32 p_extraCharacterId);
|
||||
@@ -164,8 +164,8 @@ public:
|
||||
void EnableCamAnims(MxBool p_enableCamAnims);
|
||||
MxResult LoadWorldInfo(LegoOmni::World p_worldId);
|
||||
MxBool FindVehicle(const char* p_name, MxU32& p_index);
|
||||
MxResult ReadAnimInfo(LegoFile* p_file, AnimInfo* p_info);
|
||||
MxResult ReadModelInfo(LegoFile* p_file, ModelInfo* p_info);
|
||||
MxResult ReadAnimInfo(LegoStorage* p_storage, AnimInfo* p_info);
|
||||
MxResult ReadModelInfo(LegoStorage* p_storage, ModelInfo* p_info);
|
||||
void FUN_10060480(const LegoChar* p_characterNames[], MxU32 p_numCharacterNames);
|
||||
void FUN_100604d0(MxBool p_unk0x08);
|
||||
void FUN_100604f0(MxS32 p_objectIds[], MxU32 p_numObjectIds);
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
return !strcmp(p_name, m_className.GetData()) || LegoState::IsA(p_name);
|
||||
}
|
||||
|
||||
MxResult Serialize(LegoFile* p_file) override; // vtable+0x1c
|
||||
MxResult Serialize(LegoStorage* p_storage) override; // vtable+0x1c
|
||||
|
||||
// SYNTHETIC: LEGO1 0x100260a0
|
||||
// LegoVehicleBuildState::`scalar deleting destructor'
|
||||
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
Username(Username& p_other) { Set(p_other); }
|
||||
void Set(Username& p_other) { memcpy(m_letters, p_other.m_letters, sizeof(m_letters)); }
|
||||
|
||||
MxResult Serialize(LegoFile* p_file);
|
||||
MxResult Serialize(LegoStorage* p_storage);
|
||||
Username& operator=(const Username& p_other);
|
||||
|
||||
MxS16 m_letters[7]; // 0x00
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
|
||||
// SIZE 0x2c
|
||||
struct ScoreItem {
|
||||
MxResult Serialize(LegoFile* p_file);
|
||||
MxResult Serialize(LegoStorage* p_storage);
|
||||
|
||||
MxS16 m_totalScore; // 0x00
|
||||
MxU8 m_scores[5][5]; // 0x02
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
struct History {
|
||||
History();
|
||||
void WriteScoreHistory();
|
||||
MxResult Serialize(LegoFile* p_file);
|
||||
MxResult Serialize(LegoStorage* p_storage);
|
||||
ScoreItem* FUN_1003cc90(Username* p_player, MxU16 p_unk0x24, MxS32& p_unk0x2c);
|
||||
|
||||
// FUNCTION: BETA10 0x1002c2b0
|
||||
|
||||
@@ -29,19 +29,19 @@ public:
|
||||
void Reset() { m_name = ""; }
|
||||
|
||||
// FUNCTION: LEGO1 0x100344d0
|
||||
MxResult Serialize(LegoFile* p_file)
|
||||
MxResult Serialize(LegoStorage* p_storage)
|
||||
{
|
||||
if (p_file->IsWriteMode()) {
|
||||
p_file->Write(MxString(m_name));
|
||||
p_file->Write(m_position);
|
||||
p_file->Write(m_direction);
|
||||
p_file->Write(m_up);
|
||||
if (p_storage->IsWriteMode()) {
|
||||
p_storage->WriteMxString(m_name);
|
||||
p_storage->WriteVector(m_position);
|
||||
p_storage->WriteVector(m_direction);
|
||||
p_storage->WriteVector(m_up);
|
||||
}
|
||||
else if (p_file->IsReadMode()) {
|
||||
p_file->Read(m_name);
|
||||
p_file->Read(m_position);
|
||||
p_file->Read(m_direction);
|
||||
p_file->Read(m_up);
|
||||
else if (p_storage->IsReadMode()) {
|
||||
p_storage->ReadMxString(m_name);
|
||||
p_storage->ReadVector(m_position);
|
||||
p_storage->ReadVector(m_direction);
|
||||
p_storage->ReadVector(m_up);
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
|
||||
@@ -39,17 +39,17 @@ public:
|
||||
MxS16 GetHighScore() { return m_score; }
|
||||
|
||||
// FUNCTION: BETA10 0x100c96f0
|
||||
MxResult Serialize(LegoFile* p_file)
|
||||
MxResult Serialize(LegoStorage* p_storage)
|
||||
{
|
||||
if (p_file->IsReadMode()) {
|
||||
p_file->Read(m_id);
|
||||
p_file->Read(m_unk0x02);
|
||||
p_file->Read(m_score);
|
||||
if (p_storage->IsReadMode()) {
|
||||
p_storage->ReadU8(m_id);
|
||||
p_storage->ReadS16(m_unk0x02);
|
||||
p_storage->ReadS16(m_score);
|
||||
}
|
||||
else if (p_file->IsWriteMode()) {
|
||||
p_file->Write(m_id);
|
||||
p_file->Write(m_unk0x02);
|
||||
p_file->Write(m_score);
|
||||
else if (p_storage->IsWriteMode()) {
|
||||
p_storage->WriteU8(m_id);
|
||||
p_storage->WriteS16(m_unk0x02);
|
||||
p_storage->WriteS16(m_score);
|
||||
}
|
||||
else {
|
||||
return FAILURE;
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
return !strcmp(p_name, RaceState::ClassName()) || LegoState::IsA(p_name);
|
||||
}
|
||||
|
||||
MxResult Serialize(LegoFile* p_file) override; // vtable+0x1c
|
||||
MxResult Serialize(LegoStorage* p_storage) override; // vtable+0x1c
|
||||
|
||||
Entry* GetState(MxU8 p_id);
|
||||
|
||||
|
||||
@@ -76,10 +76,10 @@ public:
|
||||
|
||||
// FUNCTION: LEGO1 0x10005fb0
|
||||
// FUNCTION: BETA10 0x10017af0
|
||||
virtual MxResult Serialize(LegoFile* p_file)
|
||||
virtual MxResult Serialize(LegoStorage* p_storage)
|
||||
{
|
||||
if (p_file->IsWriteMode()) {
|
||||
p_file->Write(MxString(ClassName()));
|
||||
if (p_storage->IsWriteMode()) {
|
||||
p_storage->WriteMxString(ClassName());
|
||||
}
|
||||
return SUCCESS;
|
||||
} // vtable+0x1c
|
||||
|
||||
@@ -31,11 +31,11 @@ enum Cursor {
|
||||
class BoundingSphere;
|
||||
class MxAtomId;
|
||||
class LegoEntity;
|
||||
class LegoFile;
|
||||
class LegoAnimPresenter;
|
||||
class LegoNamedTexture;
|
||||
class LegoPathActor;
|
||||
class LegoROI;
|
||||
class LegoStorage;
|
||||
class LegoTreeNode;
|
||||
|
||||
extern MxAtomId* g_isleScript;
|
||||
@@ -63,9 +63,9 @@ MxBool FUN_1003ef60();
|
||||
MxBool RemoveFromWorld(MxAtomId& p_entityAtom, MxS32 p_entityId, MxAtomId& p_worldAtom, MxS32 p_worldEntityId);
|
||||
MxS32 UpdateLightPosition(MxS32 p_increase);
|
||||
void SetLightPosition(MxS32 p_index);
|
||||
LegoNamedTexture* ReadNamedTexture(LegoFile* p_file);
|
||||
void WriteDefaultTexture(LegoFile* p_file, const char* p_name);
|
||||
void WriteNamedTexture(LegoFile* p_file, LegoNamedTexture* p_namedTexture);
|
||||
LegoNamedTexture* ReadNamedTexture(LegoStorage* p_storage);
|
||||
void WriteDefaultTexture(LegoStorage* p_storage, const char* p_name);
|
||||
void WriteNamedTexture(LegoStorage* p_storage, LegoNamedTexture* p_namedTexture);
|
||||
void FUN_1003f930(LegoNamedTexture* p_namedTexture);
|
||||
|
||||
// FUNCTION: BETA10 0x100260a0
|
||||
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
return !strcmp(p_name, PizzaMissionState::ClassName()) || LegoState::IsA(p_name);
|
||||
}
|
||||
|
||||
MxResult Serialize(LegoFile* p_file) override; // vtable+0x1c
|
||||
MxResult Serialize(LegoStorage* p_storage) override; // vtable+0x1c
|
||||
|
||||
// FUNCTION: BETA10 0x100ef470
|
||||
void SetUnknown0xb0(MxU32 p_unk0xb0) { m_unk0xb0 = p_unk0xb0; }
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
return !strcmp(p_name, PizzeriaState::ClassName()) || LegoState::IsA(p_name);
|
||||
}
|
||||
|
||||
MxResult Serialize(LegoFile* p_file) override; // vtable+0x1c
|
||||
MxResult Serialize(LegoStorage* p_storage) override; // vtable+0x1c
|
||||
|
||||
// SYNTHETIC: LEGO1 0x10017ce0
|
||||
// PizzeriaState::`scalar deleting destructor'
|
||||
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
return !strcmp(p_name, PoliceState::ClassName()) || LegoState::IsA(p_name);
|
||||
}
|
||||
|
||||
MxResult Serialize(LegoFile* p_file) override; // vtable+0x1c
|
||||
MxResult Serialize(LegoStorage* p_storage) override; // vtable+0x1c
|
||||
|
||||
// SYNTHETIC: LEGO1 0x1005e920
|
||||
// PoliceState::`scalar deleting destructor'
|
||||
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
return !strcmp(p_name, TowTrackMissionState::ClassName()) || LegoState::IsA(p_name);
|
||||
}
|
||||
|
||||
MxResult Serialize(LegoFile* p_file) override; // vtable+0x1c
|
||||
MxResult Serialize(LegoStorage* p_storage) override; // vtable+0x1c
|
||||
|
||||
// FUNCTION: BETA10 0x10088890
|
||||
MxS16 GetHighScore(MxU8 p_actorId)
|
||||
|
||||
Reference in New Issue
Block a user