Score class cleanup (#855)

* Cleanup/fixes

* Improve Paint match

* Improve Score::FillArea

* Fix naming

* Fix value
This commit is contained in:
Christian Semmler
2024-04-26 10:58:42 -04:00
committed by GitHub
parent 180a1e6360
commit 19d39394be
12 changed files with 145 additions and 165 deletions

View File

@@ -26,19 +26,19 @@ public:
inline void SetUnknown0x08(undefined4 p_unk0x08) { m_unk0x08 = p_unk0x08; }
inline MxU16 GetColor(MxU8 p_id)
inline MxU16 GetScore(MxU8 p_id)
{
switch (p_id) {
case 1:
return m_color1;
return m_score1;
case 2:
return m_color2;
return m_score2;
case 3:
return m_color3;
return m_score3;
case 4:
return m_color4;
return m_score4;
case 5:
return m_color5;
return m_score5;
default:
return 0;
}
@@ -55,11 +55,11 @@ protected:
MxU16 m_unk0x14; // 0x14
MxU16 m_unk0x16; // 0x16
MxU16 m_unk0x18; // 0x18
MxU16 m_color1; // 0x1a
MxU16 m_color2; // 0x1c
MxU16 m_color3; // 0x1e
MxU16 m_color4; // 0x20
MxU16 m_color5; // 0x22
MxU16 m_score1; // 0x1a
MxU16 m_score2; // 0x1c
MxU16 m_score3; // 0x1e
MxU16 m_score4; // 0x20
MxU16 m_score5; // 0x22
};
#endif // AMBULANCEMISSIONSTATE_H

View File

@@ -6,11 +6,11 @@
// SIZE 0x20
struct PizzaMissionStateEntry {
public:
undefined2 m_unk0x00;
MxU8 m_id;
undefined m_unk0x03[0x15];
MxU16 m_color;
undefined m_unk0x18[6];
undefined2 m_unk0x00; // 0x00
MxU8 m_id; // 0x02
undefined m_unk0x03[0x15]; // 0x03
MxU16 m_score; // 0x18
undefined m_unk0x18[6]; // 0x1a
};
// VTABLE: LEGO1 0x100d7408
@@ -32,7 +32,7 @@ public:
MxResult Serialize(LegoFile* p_legoFile) override; // vtable+0x1c
inline MxU16 GetColor(MxU8 p_id) { return GetState(p_id)->m_color; }
inline MxU16 GetScore(MxU8 p_id) { return GetState(p_id)->m_score; }
// SYNTHETIC: LEGO1 0x10039350
// PizzaMissionState::`scalar deleting destructor'

View File

@@ -7,11 +7,12 @@
struct RaceStateEntry {
public:
inline MxS16 GetUnknown0x02() { return m_unk0x02; }
inline MxU16 GetScore() { return m_score; }
// TODO: Possibly private
MxU8 m_id; // 0x00
MxS16 m_unk0x02; // 0x02
MxU16 m_color; // 0x04
MxU16 m_score; // 0x04
};
// VTABLE: LEGO1 0x100d5e30
@@ -37,7 +38,6 @@ public:
RaceStateEntry* GetState(MxU8 p_id);
inline MxU16 GetColor(MxU8 p_id) { return GetState(p_id)->m_color; }
inline undefined4 GetUnknown0x28() { return m_unk0x28; }
// SYNTHETIC: LEGO1 0x1000f6f0

View File

@@ -13,7 +13,7 @@
class Score : public LegoWorld {
public:
Score();
~Score() override; // vtable+0x00
~Score() override;
MxLong Notify(MxParam& p_param) override; // vtable+0x04
// FUNCTION: LEGO1 0x100010c0
@@ -32,24 +32,23 @@ public:
// SYNTHETIC: LEGO1 0x100011e0
// Score::`scalar deleting destructor'
MxResult Create(MxDSAction& p_dsAction) override; // vtable+18
void ReadyWorld() override; // vtable+50
MxBool VTable0x5c() override; // vtable+5c
MxBool VTable0x64() override; // vtable+64
void Enable(MxBool p_enable) override; // vtable+68
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool VTable0x5c() override; // vtable+0x5c
MxBool VTable0x64() override; // vtable+0x64
void Enable(MxBool p_enable) override; // vtable+0x68
void Paint();
MxLong FUN_10001510(MxEndActionNotificationParam& p_param);
MxLong FUN_100016d0(LegoControlManagerEvent& p_param);
void FillArea(MxU32 p_x, MxU32 p_y, MxS16 p_color);
void FillArea(MxU32 i_activity, MxU32 i_actor, MxS16 score);
protected:
LegoGameState::Area m_destLocation;
ScoreState* m_state;
MxU8* m_surface;
private:
void DeleteScript();
LegoGameState::Area m_destLocation; // 0xf8
ScoreState* m_state; // 0xfc
MxU8* m_surface; // 0x100
};
#endif // SCORE_H

View File

@@ -24,19 +24,19 @@ public:
MxResult Serialize(LegoFile* p_legoFile) override; // vtable+0x1c
inline MxU16 GetColor(MxU8 p_id)
inline MxU16 GetScore(MxU8 p_id)
{
switch (p_id) {
case 1:
return m_color1;
return m_score1;
case 2:
return m_color2;
return m_score2;
case 3:
return m_color3;
return m_score3;
case 4:
return m_color4;
return m_score4;
case 5:
return m_color5;
return m_score5;
default:
return 0;
}
@@ -54,12 +54,11 @@ protected:
MxU16 m_unk0x16; // 0x16
MxU16 m_unk0x18; // 0x18
MxU16 m_unk0x1a; // 0x1a
MxU16 m_unk0x1c; // 0x1c
MxU16 m_color1; // 0x1e
MxU16 m_color2; // 0x20
MxU16 m_color3; // 0x22
MxU16 m_color4; // 0x24
MxU16 m_color5; // 0x26
MxU16 m_score1; // 0x1c
MxU16 m_score2; // 0x1e
MxU16 m_score3; // 0x20
MxU16 m_score4; // 0x22
MxU16 m_score5; // 0x24
};
#endif // TOWTRACKMISSIONSTATE_H