Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order symbols until end of LegoGameState #1340

Merged
merged 4 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -334,15 +334,14 @@ function(add_lego_libraries NAME)
LEGO1/lego/legoomni/src/paths/legopathactor.cpp
LEGO1/lego/legoomni/src/common/legobuildingmanager.cpp
LEGO1/lego/legoomni/src/worlds/isle.cpp
LEGO1/lego/legoomni/src/actors/motorcycle.cpp
LEGO1/lego/legoomni/src/actors/ambulance.cpp
LEGO1/lego/legoomni/src/worlds/infocenterdoor.cpp
LEGO1/lego/legoomni/src/common/legovariables.cpp
LEGO1/lego/legoomni/src/actors/pizza.cpp
LEGO1/lego/legoomni/src/actors/motorcycle.cpp
LEGO1/lego/legoomni/src/common/legogamestate.cpp
LEGO1/lego/legoomni/src/actors/act3ammo.cpp
LEGO1/lego/legoomni/src/audio/legocachesoundmanager.cpp
LEGO1/lego/legoomni/src/worlds/infocenterdoor.cpp
LEGO1/lego/legoomni/src/common/legogamestate.cpp
LEGO1/lego/legoomni/src/common/legobackgroundcolor.cpp
LEGO1/lego/legoomni/src/common/legofullscreenmovie.cpp
LEGO1/lego/legoomni/src/common/legoutils.cpp
LEGO1/lego/legoomni/src/actors/act3actors.cpp
LEGO1/lego/legoomni/src/control/legometerpresenter.cpp
Expand All @@ -360,7 +359,6 @@ function(add_lego_libraries NAME)
LEGO1/lego/legoomni/src/video/legophonemepresenter.cpp
LEGO1/lego/legoomni/src/video/legotexturepresenter.cpp
LEGO1/lego/legoomni/src/worlds/legoact2.cpp
LEGO1/lego/legoomni/src/common/legovariables.cpp
LEGO1/lego/legoomni/src/main/scripts.cpp
LEGO1/lego/legoomni/src/entity/legoentitypresenter.cpp
LEGO1/lego/legoomni/src/entity/legonavcontroller.cpp
Expand Down
40 changes: 37 additions & 3 deletions LEGO1/lego/legoomni/include/ambulance.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,40 @@ class AmbulanceMissionState : public LegoState {
public:
AmbulanceMissionState();

// FUNCTION: LEGO1 0x10037440
// FUNCTION: BETA10 0x10024480
MxResult Serialize(LegoStorage* p_storage) override
{
LegoState::Serialize(p_storage);

if (p_storage->IsReadMode()) {
p_storage->ReadS16(m_peScore);
p_storage->ReadS16(m_maScore);
p_storage->ReadS16(m_paScore);
p_storage->ReadS16(m_niScore);
p_storage->ReadS16(m_laScore);
p_storage->ReadS16(m_peHighScore);
p_storage->ReadS16(m_maHighScore);
p_storage->ReadS16(m_paHighScore);
p_storage->ReadS16(m_niHighScore);
p_storage->ReadS16(m_laHighScore);
}
else if (p_storage->IsWriteMode()) {
p_storage->WriteS16(m_peScore);
p_storage->WriteS16(m_maScore);
p_storage->WriteS16(m_paScore);
p_storage->WriteS16(m_niScore);
p_storage->WriteS16(m_laScore);
p_storage->WriteS16(m_peHighScore);
p_storage->WriteS16(m_maHighScore);
p_storage->WriteS16(m_paHighScore);
p_storage->WriteS16(m_niHighScore);
p_storage->WriteS16(m_laHighScore);
}

return SUCCESS;
} // vtable+0x1c

// FUNCTION: LEGO1 0x10037600
// FUNCTION: BETA10 0x100246c0
const char* ClassName() const override // vtable+0x0c
Expand All @@ -27,8 +61,6 @@ class AmbulanceMissionState : public LegoState {
return !strcmp(p_name, AmbulanceMissionState::ClassName()) || LegoState::IsA(p_name);
}

MxResult Serialize(LegoStorage* p_storage) override; // vtable+0x1c

// FUNCTION: BETA10 0x10088770
MxS16 GetHighScore(MxU8 p_actorId)
{
Expand Down Expand Up @@ -118,6 +150,9 @@ class Ambulance : public IslePathActor {
MxLong Notify(MxParam& p_param) override; // vtable+0x04
MxResult Tickle() override; // vtable+0x08

// FUNCTION: LEGO1 0x10035f90
void Destroy(MxBool p_fromDestructor) override {} // vtable+0x1c

// FUNCTION: LEGO1 0x10035fa0
// FUNCTION: BETA10 0x100240b0
const char* ClassName() const override // vtable+0x0c
Expand All @@ -133,7 +168,6 @@ class Ambulance : public IslePathActor {
}

MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void Destroy(MxBool p_fromDestructor) override; // vtable+0x1c
void Animate(float p_time) override; // vtable+0x70
MxLong HandleClick() override; // vtable+0xcc
MxLong HandleControl(LegoControlManagerNotificationParam& p_param) override; // vtable+0xd4
Expand Down
11 changes: 5 additions & 6 deletions LEGO1/lego/legoomni/include/infocenterdoor.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ class InfocenterDoor : public LegoWorld {

MxLong Notify(MxParam& p_param) override; // vtable+0x04

// FUNCTION: LEGO1 0x100377a0
MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c

// FUNCTION: LEGO1 0x100377b0
// FUNCTION: BETA10 0x10032790
const char* ClassName() const override // vtable+0x0c
Expand All @@ -32,12 +35,8 @@ class InfocenterDoor : public LegoWorld {

MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50

// FUNCTION: LEGO1 0x100377a0
MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c

MxBool Escape() override; // vtable+0x64
void Enable(MxBool p_enable) override; // vtable+0x68
MxBool Escape() override; // vtable+0x64
void Enable(MxBool p_enable) override; // vtable+0x68

// SYNTHETIC: LEGO1 0x100378d0
// InfocenterDoor::`scalar deleting destructor'
Expand Down
6 changes: 0 additions & 6 deletions LEGO1/lego/legoomni/include/islepathactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,6 @@ class IslePathActor : public LegoPathActor {

void FUN_1001b660();

void Reset()
{
m_roi->SetVisibility(TRUE);
SetActorState(c_initial);
}

void SetWorld(LegoWorld* p_world) { m_world = p_world; }

static void RegisterSpawnLocations();
Expand Down
24 changes: 0 additions & 24 deletions LEGO1/lego/legoomni/include/legobackgroundcolor.h

This file was deleted.

11 changes: 10 additions & 1 deletion LEGO1/lego/legoomni/include/legocharactermanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#include "decomp.h"
#include "mxstl/stlcompat.h"
#include "mxtypes.h"
#include "mxvariable.h"
#include "roi/legoroi.h"

class CustomizeAnimFileVariable;
class LegoActor;
class LegoExtraActor;
class LegoStorage;
Expand Down Expand Up @@ -45,6 +45,15 @@ struct LegoActorInfo;

typedef map<char*, LegoCharacter*, LegoCharacterComparator> LegoCharacterMap;

// VTABLE: LEGO1 0x100da878
// SIZE 0x24
class CustomizeAnimFileVariable : public MxVariable {
public:
CustomizeAnimFileVariable(const char* p_key);

void SetValue(const char* p_value) override; // vtable+0x04
};

// SIZE 0x08
class LegoCharacterManager {
public:
Expand Down
14 changes: 0 additions & 14 deletions LEGO1/lego/legoomni/include/legofullscreenmovie.h

This file was deleted.

34 changes: 30 additions & 4 deletions LEGO1/lego/legoomni/include/legogamestate.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
#include "actionsfwd.h"
#include "decomp.h"
#include "mxtypes.h"
#include "mxvariable.h"

#include <string.h>

class LegoBackgroundColor;
class LegoFile;
class LegoFullScreenMovie;
class LegoState;
class LegoStorage;
class MxVariable;
class MxVariableTable;
class MxString;

Expand All @@ -24,6 +22,34 @@ struct ColorStringStruct {
const char* m_colorName; // 0x04
};

// VTABLE: LEGO1 0x100d74a8
// SIZE 0x30
class LegoBackgroundColor : public MxVariable {
public:
LegoBackgroundColor(const char* p_key, const char* p_value);

void SetValue(const char* p_colorString) override; // vtable+0x04

void SetLightColor(float p_r, float p_g, float p_b);
void SetLightColor();
void ToggleDayNight(MxBool p_sun);
void ToggleSkyColor();

private:
float m_h; // 0x24
float m_s; // 0x28
float m_v; // 0x2c
};

// VTABLE: LEGO1 0x100d74b8
// SIZE 0x24
class LegoFullScreenMovie : public MxVariable {
public:
LegoFullScreenMovie(const char* p_key, const char* p_value);

void SetValue(const char* p_option) override; // vtable+0x04
};

// SIZE 0x430
class LegoGameState {
public:
Expand Down Expand Up @@ -132,7 +158,7 @@ class LegoGameState {
History();
void WriteScoreHistory();
MxResult Serialize(LegoStorage* p_storage);
ScoreItem* FUN_1003cc90(Username* p_player, MxU16 p_unk0x24, MxS32& p_unk0x2c);
ScoreItem* FUN_1003cc90(Username* p_player, MxS16 p_unk0x24, MxS32& p_unk0x2c);

// FUNCTION: BETA10 0x1002c2b0
MxS16 GetCount() { return m_count; }
Expand Down
9 changes: 0 additions & 9 deletions LEGO1/lego/legoomni/include/legovariables.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,4 @@ class WhoAmIVariable : public MxVariable {
void SetValue(const char* p_value) override; // vtable+0x04
};

// VTABLE: LEGO1 0x100da878
// SIZE 0x24
class CustomizeAnimFileVariable : public MxVariable {
public:
CustomizeAnimFileVariable(const char* p_key);

void SetValue(const char* p_value) override; // vtable+0x04
};

#endif // LEGOVARIABLES_H
39 changes: 0 additions & 39 deletions LEGO1/lego/legoomni/src/actors/ambulance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ Ambulance::Ambulance()
m_fuel = 1.0;
}

// FUNCTION: LEGO1 0x10035f90
void Ambulance::Destroy(MxBool p_fromDestructor)
{
}

// FUNCTION: LEGO1 0x10036150
// FUNCTION: BETA10 0x100228fe
Ambulance::~Ambulance()
Expand Down Expand Up @@ -644,37 +639,3 @@ AmbulanceMissionState::AmbulanceMissionState()
m_niHighScore = 0;
m_laHighScore = 0;
}

// FUNCTION: LEGO1 0x10037440
// FUNCTION: BETA10 0x10024480
MxResult AmbulanceMissionState::Serialize(LegoStorage* p_storage)
{
LegoState::Serialize(p_storage);

if (p_storage->IsReadMode()) {
p_storage->ReadS16(m_peScore);
p_storage->ReadS16(m_maScore);
p_storage->ReadS16(m_paScore);
p_storage->ReadS16(m_niScore);
p_storage->ReadS16(m_laScore);
p_storage->ReadS16(m_peHighScore);
p_storage->ReadS16(m_maHighScore);
p_storage->ReadS16(m_paHighScore);
p_storage->ReadS16(m_niHighScore);
p_storage->ReadS16(m_laHighScore);
}
else if (p_storage->IsWriteMode()) {
p_storage->WriteS16(m_peScore);
p_storage->WriteS16(m_maScore);
p_storage->WriteS16(m_paScore);
p_storage->WriteS16(m_niScore);
p_storage->WriteS16(m_laScore);
p_storage->WriteS16(m_peHighScore);
p_storage->WriteS16(m_maHighScore);
p_storage->WriteS16(m_paHighScore);
p_storage->WriteS16(m_niHighScore);
p_storage->WriteS16(m_laHighScore);
}

return SUCCESS;
}
3 changes: 2 additions & 1 deletion LEGO1/lego/legoomni/src/actors/islepathactor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ void IslePathActor::Enter()
// FUNCTION: BETA10 0x1003669f
void IslePathActor::Exit()
{
Reset();
SetActorState(c_initial);
m_roi->SetVisibility(TRUE);

GetViewManager()->Remove(m_roi);
GetViewManager()->Add(m_roi);
Expand Down
Loading
Loading