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 compilation units according to retail, match and align Score class #1271

Merged
merged 6 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
357 changes: 176 additions & 181 deletions CMakeLists.txt

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions LEGO1/lego/legoomni/include/ambulance.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,28 @@ class AmbulanceMissionState : public LegoState {

MxResult Serialize(LegoFile* p_file) override; // vtable+0x1c

// FUNCTION: BETA10 0x10088770
MxS16 GetHighScore(MxU8 p_actorId)
{
switch (p_actorId) {
case LegoActor::c_pepper:
return m_peHighScore;
break;
case LegoActor::c_mama:
return m_maHighScore;
break;
case LegoActor::c_papa:
return m_paHighScore;
break;
case LegoActor::c_nick:
return m_niHighScore;
break;
case LegoActor::c_laura:
return m_laHighScore;
default:
return 0;
break;
}

return 0;
}

// FUNCTION: BETA10 0x100242d0
Expand Down
2 changes: 2 additions & 0 deletions LEGO1/lego/legoomni/include/legorace.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class RaceState : public LegoState {
}

MxS16 GetUnknown0x02() { return m_unk0x02; }

// FUNCTION: BETA10 0x10088970
MxS16 GetHighScore() { return m_score; }

// FUNCTION: BETA10 0x100c96f0
Expand Down
1 change: 1 addition & 0 deletions LEGO1/lego/legoomni/include/pizza.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ class PizzaMissionState : public LegoState {
// FUNCTION: BETA10 0x100ef850
MxU32 GetUnknown0xb0() { return m_unk0xb0; }

// FUNCTION: BETA10 0x10088850
MxS16 GetHighScore(MxU8 p_actorId) { return GetMission(p_actorId)->m_hiScore; }

// SYNTHETIC: LEGO1 0x10039350
Expand Down
4 changes: 3 additions & 1 deletion LEGO1/lego/legoomni/include/score.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ class Score : public LegoWorld {
~Score() override;
MxLong Notify(MxParam& p_param) override; // vtable+0x04

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

// FUNCTION: LEGO1 0x100010c0
// FUNCTION: BETA10 0x100f4f20
const char* ClassName() const override // vtable+0x0c
Expand All @@ -78,7 +81,6 @@ class Score : public LegoWorld {

MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool VTable0x5c() override; // vtable+0x5c
MxBool Escape() override; // vtable+0x64
void Enable(MxBool p_enable) override; // vtable+0x68

Expand Down
10 changes: 8 additions & 2 deletions LEGO1/lego/legoomni/include/towtrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,28 @@ class TowTrackMissionState : public LegoState {

MxResult Serialize(LegoFile* p_file) override; // vtable+0x1c

// FUNCTION: BETA10 0x10088890
MxS16 GetHighScore(MxU8 p_actorId)
{
switch (p_actorId) {
case LegoActor::c_pepper:
return m_peHighScore;
break;
case LegoActor::c_mama:
return m_maHighScore;
break;
case LegoActor::c_papa:
return m_paHighScore;
break;
case LegoActor::c_nick:
return m_niHighScore;
break;
case LegoActor::c_laura:
return m_laHighScore;
default:
return 0;
break;
}

return 0;
}

// FUNCTION: BETA10 0x100f8530
Expand Down
4 changes: 4 additions & 0 deletions LEGO1/lego/legoomni/src/actors/helicopter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@

DECOMP_SIZE_ASSERT(Helicopter, 0x230)
DECOMP_SIZE_ASSERT(HelicopterState, 0x0c)
DECOMP_SIZE_ASSERT(Vector2, 0x08)
DECOMP_SIZE_ASSERT(Vector3, 0x08)
DECOMP_SIZE_ASSERT(Vector4, 0x08)
DECOMP_SIZE_ASSERT(Mx3DPointFloat, 0x14)
DECOMP_SIZE_ASSERT(Mx4DPointFloat, 0x18)
DECOMP_SIZE_ASSERT(Matrix4, 0x08)
DECOMP_SIZE_ASSERT(MxMatrix, 0x48)

// FUNCTION: LEGO1 0x10001e60
Expand Down
1 change: 1 addition & 0 deletions LEGO1/lego/legoomni/src/actors/pizza.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ MxResult PizzaMissionState::Serialize(LegoFile* p_file)
}

// FUNCTION: LEGO1 0x10039510
// FUNCTION: BETA10 0x100eed45
PizzaMissionState::Mission* PizzaMissionState::GetMission(MxU8 p_actorId)
{
for (MxS16 i = 0; i < 5; i++) {
Expand Down
1 change: 1 addition & 0 deletions LEGO1/lego/legoomni/src/race/legorace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ MxResult RaceState::Serialize(LegoFile* p_file)
}

// FUNCTION: LEGO1 0x10016280
// FUNCTION: BETA10 0x100c7dfd
RaceState::Entry* RaceState::GetState(MxU8 p_id)
{
for (MxS16 i = 0;; i++) {
Expand Down
13 changes: 6 additions & 7 deletions LEGO1/lego/legoomni/src/worlds/score.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ Score::Score()
NotificationManager()->Register(this);
}

// FUNCTION: LEGO1 0x100010b0
MxBool Score::VTable0x5c()
{
return TRUE;
}

// FUNCTION: LEGO1 0x10001200
Score::~Score()
{
Expand Down Expand Up @@ -260,7 +254,8 @@ void Score::Paint()
memset(&desc, 0, sizeof(desc));
desc.dwSize = sizeof(desc);

if (cube->m_surface->Lock(NULL, &desc, 0, NULL) == DD_OK) {
HRESULT result = cube->m_surface->Lock(NULL, &desc, DDLOCK_SURFACEMEMORYPTR, NULL);
if (result == DD_OK) {
if (desc.lPitch != desc.dwWidth) {
cube->m_surface->Unlock(desc.lpSurface);
return;
Expand Down Expand Up @@ -304,6 +299,10 @@ void Score::FillArea(MxU32 i_activity, MxU32 i_actor, MxS16 score)
MxS32 local28[] = {0x25, 0x29, 0x27, 0x28, 0x28};
MxS32 colors[] = {0x11, 0x0f, 0x08, 0x05};

assert(i_activity >= 0 && i_activity < 5);
assert(i_actor >= 0 && i_actor < 5);
assert(score >= 0 && score < 4);

MxU8* ptr = m_surface + local3c[i_actor] + local50[i_activity];
MxS32 color = colors[score];
MxS32 size = local28[i_activity];
Expand Down
4 changes: 3 additions & 1 deletion LEGO1/lego/sources/misc/legocontainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class LegoContainer {
}
}

// FUNCTION: BETA10 0x1007bc00
T* Get(const char* p_name)
{
T* value = NULL;
Expand Down Expand Up @@ -197,4 +196,7 @@ class LegoTextureContainer : public LegoContainer<LegoTextureInfo> {
// _Tree<char const *,pair<char const * const,LegoTextureInfo *>,map<char const *,LegoTextureInfo *,LegoContainerInfoComparator,allocator<LegoTextureInfo *> >::_Kfn,LegoContainerInfoComparator,allocator<LegoTextureInfo *> >::_Nil
// clang-format on

// TEMPLATE: BETA10 0x1007bc00
// LegoContainer<LegoTextureInfo>::Get

#endif // LEGOCONTAINER_H
5 changes: 0 additions & 5 deletions LEGO1/realtime/matrix.cpp

This file was deleted.

7 changes: 0 additions & 7 deletions LEGO1/realtime/vector.cpp

This file was deleted.

Loading