Order symbols in Act1State (#1336)

* Order functions in `Act1State`

* Remove IsPresent

* Revert some stuff
This commit is contained in:
Christian Semmler 2025-01-16 18:25:31 -07:00 committed by GitHub
parent 70b0f76fa1
commit e8c856c585
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 33 additions and 30 deletions

View File

@ -6,14 +6,17 @@
#include "mxstring.h"
// SIZE 0x4c
class LegoNamedPlane {
public:
struct LegoNamedPlane {
// FUNCTION: LEGO1 0x10033800
LegoNamedPlane() {}
// FUNCTION: LEGO1 0x10033a70
// LegoNamedPlane::~LegoNamedPlane
// Unclear whether getters/setters were used.
// Act1State::Serialize seems to access `m_name` directly (only matches like that)
// Act1State::PlaceActors though seems to require extensive use of getters to improve
const char* GetName() const { return m_name.GetData(); }
const Mx3DPointFloat& GetPosition() { return m_position; }
const Mx3DPointFloat& GetDirection() { return m_direction; }
@ -47,7 +50,6 @@ public:
return SUCCESS;
}
// private:
MxString m_name; // 0x00
Mx3DPointFloat m_position; // 0x10
Mx3DPointFloat m_direction; // 0x24

View File

@ -6,7 +6,7 @@
#include "mxtypes.h"
struct LegoEdge;
class LegoNamedPlane;
struct LegoNamedPlane;
class LegoPathBoundary;
class LegoPathController;
struct LegoPathEdgeContainer;

View File

@ -1487,12 +1487,12 @@ void Act1State::StopCptClickDialogue()
// FUNCTION: LEGO1 0x100346d0
MxBool Act1State::Reset()
{
m_motocyclePlane.Reset();
m_bikePlane.Reset();
m_skateboardPlane.Reset();
m_motocyclePlane.m_name = "";
m_bikePlane.m_name = "";
m_skateboardPlane.m_name = "";
m_unk0x022 = FALSE;
m_helicopterPlane.Reset();
m_helicopterPlane.m_name = "";
if (m_helicopterWindshield) {
delete m_helicopterWindshield;
m_helicopterWindshield = NULL;
@ -1513,7 +1513,7 @@ MxBool Act1State::Reset()
m_helicopter = NULL;
}
m_jetskiPlane.Reset();
m_jetskiPlane.m_name = "";
if (m_jetskiFront) {
delete m_jetskiFront;
m_jetskiFront = NULL;
@ -1529,7 +1529,7 @@ MxBool Act1State::Reset()
m_jetski = NULL;
}
m_dunebuggyPlane.Reset();
m_dunebuggyPlane.m_name = "";
if (m_dunebuggyFront) {
delete m_dunebuggyFront;
m_dunebuggyFront = NULL;
@ -1540,7 +1540,7 @@ MxBool Act1State::Reset()
m_dunebuggy = NULL;
}
m_racecarPlane.Reset();
m_racecarPlane.m_name = "";
if (m_racecarFront) {
delete m_racecarFront;
m_racecarFront = NULL;

View File

@ -33,14 +33,6 @@ public:
// FUNCTION: LEGO1 0x10045af0
virtual LegoBool IsReadMode() { return m_mode == c_read; } // vtable+0x18
// FUNCTION: LEGO1 0x10006030
// FUNCTION: BETA10 0x10017bb0
LegoStorage* WriteMxString(MxString p_data)
{
WriteString(p_data.GetData());
return this;
}
// FUNCTION: BETA10 0x10017c80
LegoStorage* WriteString(const char* p_data)
{
@ -102,18 +94,11 @@ public:
return this;
}
// FUNCTION: LEGO1 0x10034470
LegoStorage* ReadMxString(MxString& p_data)
// FUNCTION: LEGO1 0x10006030
// FUNCTION: BETA10 0x10017bb0
LegoStorage* WriteMxString(MxString p_data)
{
LegoS16 length;
ReadS16(length);
char* text = new char[length + 1];
Read(text, length);
text[length] = '\0';
p_data = text;
delete[] text;
WriteString(p_data.GetData());
return this;
}
@ -178,6 +163,21 @@ public:
return this;
}
// FUNCTION: LEGO1 0x10034470
LegoStorage* ReadMxString(MxString& p_data)
{
LegoS16 length;
ReadS16(length);
char* text = new char[length + 1];
Read(text, length);
text[length] = '\0';
p_data = text;
delete[] text;
return this;
}
// SYNTHETIC: LEGO1 0x10045b00
// LegoStorage::`scalar deleting destructor'

View File

@ -42,6 +42,7 @@ public:
// FUNCTION: BETA10 0x100576b0
const CompoundObject& GetROIs() { return rois; }
// FUNCTION: BETA10 0x100e1260
void Add(ViewROI* p_roi) { rois.push_back(p_roi); }
// SYNTHETIC: LEGO1 0x100a6000