Add enum for actor IDs ()

This commit is contained in:
Christian Semmler 2024-06-05 12:11:46 -04:00 committed by GitHub
parent 6e7e9a3f20
commit 6a9f68872b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 59 additions and 49 deletions

View file

@ -10,6 +10,16 @@ class LegoCacheSound;
// SIZE 0x78
class LegoActor : public LegoEntity {
public:
enum {
c_none = 0,
c_pepper,
c_mama,
c_papa,
c_nick,
c_laura,
c_brickster
};
LegoActor();
~LegoActor() override;

View file

@ -1496,7 +1496,7 @@ MxResult LegoAnimationManager::Tickle()
MxU8 unk0x0c = 0;
MxU8 actorId = GameState()->GetActorId();
if (actorId <= 5) {
if (actorId <= LegoActor::c_laura) {
unk0x0c = g_unk0x100d8b28[actorId];
}
@ -1762,7 +1762,7 @@ MxBool LegoAnimationManager::FUN_10062710(AnimInfo& p_info)
MxU8 und = 0;
MxU8 actorId = GameState()->GetActorId();
if (actorId <= 5) {
if (actorId <= LegoActor::c_laura) {
und = g_unk0x100d8b28[actorId];
}
@ -2712,11 +2712,11 @@ MxResult LegoAnimationManager::FUN_10064740(Vector3* p_position)
}
if (success) {
if (GameState()->GetActorId() != 2) {
if (GameState()->GetActorId() != LegoActor::c_mama) {
FUN_10064380("mama", "USR00_47", 1, 0.43f, 3, 0.84f, rand() % 3 + 13, -1, rand() % 3, -1, 0.7f);
}
if (GameState()->GetActorId() != 3) {
if (GameState()->GetActorId() != LegoActor::c_papa) {
FUN_10064380("papa", "USR00_193", 3, 0.55f, 1, 0.4f, rand() % 3 + 13, -1, rand() % 3, -1, 0.9f);
}

View file

@ -346,25 +346,25 @@ MxLong LegoEntity::Notify(MxParam& p_param)
}
else {
switch (GameState()->GetActorId()) {
case 1:
case LegoActor::c_pepper:
if (GameState()->GetCurrentAct() != LegoGameState::e_act2 &&
GameState()->GetCurrentAct() != LegoGameState::e_act3) {
VTable0x3c();
}
break;
case 2:
case LegoActor::c_mama:
VTable0x40();
break;
case 3:
case LegoActor::c_papa:
VTable0x44();
break;
case 4:
case LegoActor::c_nick:
VTable0x48(param.GetROI());
break;
case 5:
case LegoActor::c_laura:
VTable0x4c();
break;
case 6:
case LegoActor::c_brickster:
switch (m_type) {
case e_actor:
case e_unk1:

View file

@ -675,24 +675,24 @@ MxResult LegoPathActor::VTable0x9c()
void LegoPathActor::VTable0xa4(MxBool& p_und1, MxS32& p_und2)
{
switch (GetActorId()) {
case 1:
case c_pepper:
p_und1 = TRUE;
p_und2 = 2;
break;
case 2:
case c_mama:
p_und1 = FALSE;
p_und2 = 1;
break;
case 3:
case c_papa:
p_und1 = TRUE;
p_und2 = 1;
break;
case 4:
case 6:
case c_nick:
case c_brickster:
p_und1 = TRUE;
p_und2 = rand() % p_und2 + 1;
break;
case 5:
case c_laura:
p_und1 = FALSE;
p_und2 = 2;
break;

View file

@ -31,7 +31,7 @@ MxBool g_trackLedEnabled = FALSE;
// FUNCTION: LEGO1 0x100046a0
GasStation::GasStation()
{
m_currentActorId = 0;
m_currentActorId = LegoActor::c_none;
m_state = NULL;
m_destLocation = LegoGameState::e_undefined;
m_trackLedBitmap = NULL;
@ -134,7 +134,7 @@ void GasStation::ReadyWorld()
m_currentActorId = CurrentActor()->GetActorId();
switch (m_currentActorId) {
case 1:
case LegoActor::c_pepper:
switch (m_state->m_unk0x18) {
case 0:
m_state->m_unk0x14.m_unk0x00 = 5;
@ -165,7 +165,7 @@ void GasStation::ReadyWorld()
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
break;
case 2:
case LegoActor::c_mama:
switch (m_state->m_unk0x1a) {
case 0:
m_state->m_unk0x14.m_unk0x00 = 5;
@ -191,7 +191,7 @@ void GasStation::ReadyWorld()
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
break;
case 3:
case LegoActor::c_papa:
switch (m_state->m_unk0x1c) {
case 0:
m_state->m_unk0x14.m_unk0x00 = 5;
@ -217,7 +217,7 @@ void GasStation::ReadyWorld()
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
break;
case 4:
case LegoActor::c_nick:
switch (m_state->m_unk0x1e) {
case 0:
m_state->m_unk0x14.m_unk0x00 = 5;
@ -243,7 +243,7 @@ void GasStation::ReadyWorld()
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
break;
case 5:
case LegoActor::c_laura:
switch (m_state->m_unk0x20) {
case 0:
m_state->m_unk0x14.m_unk0x00 = 5;

View file

@ -35,7 +35,7 @@ MxBool g_pizzaLedEnabled = FALSE;
// FUNCTION: LEGO1 0x100745e0
Hospital::Hospital()
{
m_currentActorId = 0;
m_currentActorId = LegoActor::c_none;
m_unk0x100 = 0;
m_hospitalState = NULL;
m_unk0x108 = 0;
@ -145,14 +145,14 @@ void Hospital::ReadyWorld()
m_pizzaLedBitmap = (MxStillPresenter*) Find("MxStillPresenter", "PizzaLed_Bitmap");
if (CurrentActor() == NULL) {
m_currentActorId = 5;
m_currentActorId = LegoActor::c_laura;
}
else {
m_currentActorId = CurrentActor()->GetActorId();
}
switch (m_currentActorId) {
case 1:
case LegoActor::c_pepper:
m_hospitalState->m_unk0x0c = m_hospitalState->m_unk0x0e;
if (m_hospitalState->m_unk0x0e < 5) {
@ -160,7 +160,7 @@ void Hospital::ReadyWorld()
}
break;
case 2:
case LegoActor::c_mama:
m_hospitalState->m_unk0x0c = m_hospitalState->m_unk0x10;
if (m_hospitalState->m_unk0x10 < 5) {
@ -168,7 +168,7 @@ void Hospital::ReadyWorld()
}
break;
case 3:
case LegoActor::c_papa:
m_hospitalState->m_unk0x0c = m_hospitalState->m_unk0x12;
if (m_hospitalState->m_unk0x12 < 5) {
@ -176,7 +176,7 @@ void Hospital::ReadyWorld()
}
break;
case 4:
case LegoActor::c_nick:
m_hospitalState->m_unk0x0c = m_hospitalState->m_unk0x14;
if (m_hospitalState->m_unk0x14 < 5) {
@ -184,7 +184,7 @@ void Hospital::ReadyWorld()
}
break;
case 5:
case LegoActor::c_laura:
m_hospitalState->m_unk0x0c = m_hospitalState->m_unk0x16;
if (m_hospitalState->m_unk0x16 < 5) {
@ -269,7 +269,7 @@ MxLong Hospital::HandleEndAction(MxEndActionNotificationParam& p_param)
break;
case 11:
switch (m_currentActorId) {
case 1:
case LegoActor::c_pepper:
switch (m_hospitalState->m_unk0x0e) {
case 0:
case 1:
@ -288,7 +288,7 @@ MxLong Hospital::HandleEndAction(MxEndActionNotificationParam& p_param)
break;
}
break;
case 2:
case LegoActor::c_mama:
switch (m_hospitalState->m_unk0x10) {
case 0:
case 1:
@ -307,7 +307,7 @@ MxLong Hospital::HandleEndAction(MxEndActionNotificationParam& p_param)
break;
}
break;
case 3:
case LegoActor::c_papa:
switch (m_hospitalState->m_unk0x12) {
case 0:
case 1:
@ -326,7 +326,7 @@ MxLong Hospital::HandleEndAction(MxEndActionNotificationParam& p_param)
break;
}
break;
case 4:
case LegoActor::c_nick:
switch (m_hospitalState->m_unk0x14) {
case 0:
case 1:
@ -345,7 +345,7 @@ MxLong Hospital::HandleEndAction(MxEndActionNotificationParam& p_param)
break;
}
break;
case 5:
case LegoActor::c_laura:
switch (m_hospitalState->m_unk0x16) {
case 0:
case 1:
@ -438,7 +438,7 @@ MxLong Hospital::HandleButtonDown(LegoControlManagerEvent& p_param)
}
else {
switch (m_currentActorId) {
case 1:
case LegoActor::c_pepper:
switch (m_hospitalState->m_unk0x0e) {
case 0:
case 1:
@ -457,7 +457,7 @@ MxLong Hospital::HandleButtonDown(LegoControlManagerEvent& p_param)
break;
}
break;
case 2:
case LegoActor::c_mama:
switch (m_hospitalState->m_unk0x10) {
case 0:
case 1:
@ -476,7 +476,7 @@ MxLong Hospital::HandleButtonDown(LegoControlManagerEvent& p_param)
break;
}
break;
case 3:
case LegoActor::c_papa:
switch (m_hospitalState->m_unk0x12) {
case 0:
case 1:
@ -495,7 +495,7 @@ MxLong Hospital::HandleButtonDown(LegoControlManagerEvent& p_param)
break;
}
break;
case 4:
case LegoActor::c_nick:
switch (m_hospitalState->m_unk0x14) {
case 0:
case 1:
@ -514,7 +514,7 @@ MxLong Hospital::HandleButtonDown(LegoControlManagerEvent& p_param)
break;
}
break;
case 5:
case LegoActor::c_laura:
switch (m_hospitalState->m_unk0x16) {
case 0:
case 1:

View file

@ -1047,7 +1047,7 @@ MxU8 Infocenter::HandleControl(LegoControlManagerEvent& p_param)
InputManager()->SetUnknown336(TRUE);
break;
case LegoGameState::e_unk4:
if (state->GetActorId()) {
if (state->GetActorId() != LegoActor::c_none) {
if (m_infocenterState->HasRegistered()) {
m_infocenterState->SetUnknown0x74(5);
m_destLocation = state->GetPreviousArea();
@ -1336,23 +1336,23 @@ void Infocenter::UpdateFrameHot(MxBool p_display)
MxS32 x, y;
switch (GameState()->GetActorId()) {
case 1:
case LegoActor::c_pepper:
x = 302;
y = 81;
break;
case 2:
case LegoActor::c_mama:
x = 204;
y = 81;
break;
case 3:
case LegoActor::c_papa:
x = 253;
y = 81;
break;
case 4:
case LegoActor::c_nick:
x = 353;
y = 81;
break;
case 5:
case LegoActor::c_laura:
x = 399;
y = 81;
break;

View file

@ -114,7 +114,7 @@ MxLong InfocenterDoor::HandleControl(LegoControlManagerEvent& p_param)
result = 1;
break;
case InfodoorScript::c_Door_Ctl:
if (GameState()->GetActorId()) {
if (GameState()->GetActorId() != LegoActor::c_none) {
InfocenterState* state = (InfocenterState*) GameState()->GetState("InfocenterState");
if (state->HasRegistered()) {
m_destLocation = LegoGameState::e_unk4;

View file

@ -544,7 +544,7 @@ void Isle::Enable(MxBool p_enable)
VideoManager()->ResetPalette(FALSE);
m_act1state->FUN_10034d00();
if (CurrentActor() != NULL && CurrentActor()->GetActorId() != 0) {
if (CurrentActor() != NULL && CurrentActor()->GetActorId() != LegoActor::c_none) {
// TODO: Match, most likely an inline function
MxS32 targetEntityId = (CurrentActor()->GetActorId() == 1) + 250;

View file

@ -231,11 +231,11 @@ void PoliceState::FUN_1005ea40()
}
switch (CurrentActor()->GetActorId()) {
case 4:
case LegoActor::c_nick:
policeScript = PoliceScript::c_nps002la_RunAnim;
m_policeScript = policeScript;
break;
case 5:
case LegoActor::c_laura:
policeScript = PoliceScript::c_nps001ni_RunAnim;
m_policeScript = policeScript;
break;