Order compilation units according to retail, match and align Score class (#1271)

* Initial changes for ordering, Score

* Add mxdebug

* Match `Score::Paint`

* Refactor

* Add BETA asserts

* BETA match
This commit is contained in:
Christian Semmler
2024-12-24 11:38:15 -07:00
committed by GitHub
parent bb29d289fe
commit 7c41ff4569
13 changed files with 232 additions and 225 deletions

View File

@@ -29,22 +29,28 @@ public:
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

View File

@@ -34,6 +34,8 @@ public:
}
MxS16 GetUnknown0x02() { return m_unk0x02; }
// FUNCTION: BETA10 0x10088970
MxS16 GetHighScore() { return m_score; }
// FUNCTION: BETA10 0x100c96f0

View File

@@ -148,6 +148,7 @@ public:
// 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

View File

@@ -59,6 +59,9 @@ public:
~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
@@ -78,14 +81,13 @@ public:
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
void Paint();
MxLong FUN_10001510(MxEndActionNotificationParam& p_param);
MxLong FUN_100016d0(LegoControlManagerNotificationParam& p_param);
void FillArea(MxU32 i_activity, MxU32 i_actor, MxS16 score);
void FillArea(MxS32 i_activity, MxS32 i_actor, MxS16 score);
protected:
void DeleteScript();

View File

@@ -30,22 +30,28 @@ public:
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

View File

@@ -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

View File

@@ -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++) {

View File

@@ -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++) {

View File

@@ -32,12 +32,6 @@ Score::Score()
NotificationManager()->Register(this);
}
// FUNCTION: LEGO1 0x100010b0
MxBool Score::VTable0x5c()
{
return TRUE;
}
// FUNCTION: LEGO1 0x10001200
Score::~Score()
{
@@ -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;
@@ -296,7 +291,7 @@ void Score::Paint()
// FUNCTION: LEGO1 0x10001d20
// FUNCTION: BETA10 0x100f4a52
void Score::FillArea(MxU32 i_activity, MxU32 i_actor, MxS16 score)
void Score::FillArea(MxS32 i_activity, MxS32 i_actor, MxS16 score)
{
MxS32 local3c[] = {0x2b00, 0x5700, 0x8000, 0xab00, 0xd600};
MxS32 local14[] = {0x2a, 0x27, 0x29, 0x29, 0x2a};
@@ -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];

View File

@@ -57,7 +57,6 @@ public:
}
}
// FUNCTION: BETA10 0x1007bc00
T* Get(const char* p_name)
{
T* value = NULL;
@@ -197,4 +196,7 @@ protected:
// _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

View File

@@ -1,5 +0,0 @@
#include "matrix.h"
#include "decomp.h"
DECOMP_SIZE_ASSERT(Matrix4, 0x08);

View File

@@ -1,7 +0,0 @@
#include "vector.h"
#include "decomp.h"
DECOMP_SIZE_ASSERT(Vector2, 0x08);
DECOMP_SIZE_ASSERT(Vector3, 0x08);
DECOMP_SIZE_ASSERT(Vector4, 0x08);