Continued work on LegoGameState (#596)

* Continued work on LegoGameState

* Fixes/matches/refactor

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
Nathan M Gilbert
2024-02-26 11:19:16 -05:00
committed by GitHub
parent b524b47723
commit 124b73046b
21 changed files with 268 additions and 154 deletions

View File

@@ -3,7 +3,7 @@
DECOMP_SIZE_ASSERT(LegoActor, 0x78)
// GLOBAL: LEGO1 0x100f32d0
const char* g_unk0x100f32d0[] = {"none", "pepper", "mama", "papa", "nick", "laura", "The_Brickster!"};
const char* g_actorNames[] = {"none", "pepper", "mama", "papa", "nick", "laura", "The_Brickster!"};
// FUNCTION: LEGO1 0x1002d110
LegoActor::LegoActor()
@@ -12,7 +12,7 @@ LegoActor::LegoActor()
m_sound = NULL;
m_unk0x70 = 0.0f;
m_unk0x10 = 0;
m_unk0x74 = 0;
m_actorId = 0;
}
// FUNCTION: LEGO1 0x1002d320
@@ -29,16 +29,22 @@ void LegoActor::ParseAction(char*)
// TODO
}
// FUNCTION: LEGO1 0x1002d660
const char* LegoActor::GetActorName(MxU8 p_id)
{
return g_actorNames[p_id];
}
// FUNCTION: LEGO1 0x1002d670
void LegoActor::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2)
{
if (p_roi) {
const char* name = p_roi->GetName();
for (MxU32 i = 1; i <= _countof(g_unk0x100f32d0) - 1; i++) {
if (!strcmpi(name, g_unk0x100f32d0[i])) {
for (MxU32 i = 1; i <= _countof(g_actorNames) - 1; i++) {
if (!strcmpi(name, g_actorNames[i])) {
m_unk0x59 = 0;
m_unk0x74 = i;
m_actorId = i;
break;
}
}

View File

@@ -588,10 +588,10 @@ void LegoWorld::Enable(MxBool p_enable)
else if (!p_enable && m_set0xd0.empty()) {
MxPresenter* presenter;
LegoPathController* controller;
IslePathActor* vehicle = CurrentVehicle();
IslePathActor* actor = CurrentActor();
if (vehicle) {
FUN_1001fc80(vehicle);
if (actor) {
FUN_1001fc80(actor);
}
AnimationManager()->FUN_1005ee80(FALSE);