Implement/match Pizza::PlayAction (#1123)

* Implement/match Pizza::PlayAction

* Remove unused header
This commit is contained in:
Christian Semmler 2024-10-28 09:25:54 -07:00 committed by GitHub
parent 2fa2ab4a96
commit ad353b7f3e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 27 additions and 19 deletions

View File

@ -1,7 +1,6 @@
#ifndef LEGOANIMATIONMANAGER_H
#define LEGOANIMATIONMANAGER_H
#include "actionsfwd.h"
#include "decomp.h"
#include "legolocations.h"
#include "legostate.h"
@ -161,7 +160,7 @@ public:
void FUN_10060570(MxBool p_unk0x1a);
MxResult StartEntityAction(MxDSAction& p_dsAction, LegoEntity* p_entity);
MxResult FUN_10060dc0(
IsleScript::Script p_objectId,
MxU32 p_objectId,
MxMatrix* p_matrix,
MxBool p_param3,
MxBool p_param4,

View File

@ -132,7 +132,7 @@ public:
MxResult Serialize(LegoFile* p_file) override; // vtable+0x1c
// FUNCTION: BETA10 0x100ef470
void SetUnknown0xb0(undefined4 p_unk0xb0) { m_unk0xb0 = p_unk0xb0; }
void SetUnknown0xb0(MxU32 p_unk0xb0) { m_unk0xb0 = p_unk0xb0; }
MxS16 GetHighScore(MxU8 p_actorId) { return GetMission(p_actorId)->m_hiScore; }
@ -145,7 +145,7 @@ public:
PizzeriaState* m_pizzeriaState; // 0x08
undefined4 m_unk0x0c; // 0x0c
Mission m_missions[5]; // 0x10
undefined4 m_unk0xb0; // 0xb0
MxU32 m_unk0xb0; // 0xb0
};
// VTABLE: LEGO1 0x100d7380
@ -176,10 +176,10 @@ public:
MxLong HandlePathStruct(LegoPathStructNotificationParam& p_param) override; // vtable+0x80
void CreateState();
void FUN_10038220(MxU32 p_objectId);
void FUN_10038220(IsleScript::Script p_objectId);
void FUN_100382b0();
void StopActions();
void PlayAction(MxU32 p_objectId, MxBool);
void PlayAction(MxU32 p_objectId, MxBool p_param7);
void SetSkateboard(SkateBoard* p_skateBoard) { m_skateBoard = p_skateBoard; }
@ -191,7 +191,7 @@ private:
PizzaMissionState::Mission* m_mission; // 0x80
SkateBoard* m_skateBoard; // 0x84
Act1State* m_act1state; // 0x88
undefined4 m_unk0x8c; // 0x8c
IsleScript::Script m_unk0x8c; // 0x8c
MxLong m_unk0x90; // 0x90
undefined4 m_unk0x94; // 0x94
MxBool m_unk0x98; // 0x98

View File

@ -15,6 +15,7 @@
#include "mxtimer.h"
#include "pizzeria.h"
#include "skateboard.h"
#include "sndanim_actions.h"
DECOMP_SIZE_ASSERT(Pizza, 0x9c)
DECOMP_SIZE_ASSERT(PizzaMissionState, 0xb4)
@ -130,7 +131,7 @@ Pizza::Pizza()
m_mission = NULL;
m_skateBoard = NULL;
m_act1state = NULL;
m_unk0x8c = -1;
m_unk0x8c = IsleScript::c_noneIsle;
m_unk0x98 = FALSE;
m_unk0x90 = INT_MIN;
}
@ -171,7 +172,7 @@ void Pizza::CreateState()
// FUNCTION: LEGO1 0x10038220
// FUNCTION: BETA10 0x100edb81
void Pizza::FUN_10038220(MxU32 p_objectId)
void Pizza::FUN_10038220(IsleScript::Script p_objectId)
{
AnimationManager()->FUN_10064740(NULL);
m_mission = m_state->GetMission(GameState()->GetActorId());
@ -182,14 +183,14 @@ void Pizza::FUN_10038220(MxU32 p_objectId)
AnimationManager()->EnableCamAnims(FALSE);
AnimationManager()->FUN_1005f6d0(FALSE);
PlayAction(p_objectId, FALSE);
m_unk0x8c = -1;
m_unk0x8c = IsleScript::c_noneIsle;
}
// FUNCTION: LEGO1 0x100382b0
void Pizza::FUN_100382b0()
{
if (m_state->m_unk0x0c != 8) {
if (m_unk0x8c != -1) {
if (m_unk0x8c != IsleScript::c_noneIsle) {
InvokeAction(Extra::e_stop, *g_isleScript, m_unk0x8c, NULL);
}
@ -202,7 +203,7 @@ void Pizza::FUN_100382b0()
m_mission->m_startTime = INT_MIN;
m_mission = NULL;
m_unk0x98 = FALSE;
m_unk0x8c = -1;
m_unk0x8c = IsleScript::c_noneIsle;
BackgroundAudioManager()->RaiseVolume();
TickleManager()->UnregisterClient(this);
m_unk0x90 = INT_MIN;
@ -275,7 +276,7 @@ MxLong Pizza::HandlePathStruct(LegoPathStructNotificationParam& p_param)
if (p_param.GetTrigger() == LegoPathStruct::c_s && p_param.GetData() == 0x12e &&
GameState()->GetActorId() == LegoActor::c_pepper) {
m_state->m_unk0x0c = 5;
m_state->SetUnknown0xb0(0x12e);
m_state->SetUnknown0xb0(SndanimScript::c_TRS302_OpenJailDoor);
if (time < m_mission->GetRedFinishTime()) {
m_mission->UpdateScore(LegoState::e_red);
@ -371,10 +372,17 @@ MxLong Pizza::HandleEndAction(MxEndActionNotificationParam&)
return 0;
}
// STUB: LEGO1 0x10038fe0
void Pizza::PlayAction(MxU32 p_objectId, MxBool)
// FUNCTION: LEGO1 0x10038fe0
// FUNCTION: BETA10 0x100ef520
void Pizza::PlayAction(MxU32 p_objectId, MxBool p_param7)
{
// TODO
m_state->SetUnknown0xb0(p_objectId);
if (m_unk0x8c != IsleScript::c_noneIsle) {
InvokeAction(Extra::e_stop, *g_isleScript, m_unk0x8c, NULL);
}
AnimationManager()->FUN_10060dc0(p_objectId, NULL, TRUE, FALSE, NULL, FALSE, p_param7, TRUE, TRUE);
}
// FUNCTION: LEGO1 0x10039030
@ -388,7 +396,7 @@ PizzaMissionState::PizzaMissionState()
m_missions[3] = Mission(LegoActor::c_nick, 2, g_nickFinishTimes, g_nickActions, 4);
m_missions[4] = Mission(LegoActor::c_laura, 2, g_lauraFinishTimes, g_lauraActions, 4);
m_pizzeriaState = (PizzeriaState*) GameState()->GetState("PizzeriaState");
m_unk0xb0 = -1;
m_unk0xb0 = IsleScript::c_noneIsle;
}
// FUNCTION: LEGO1 0x100393c0

View File

@ -58,7 +58,7 @@ MxLong Pizzeria::HandleClick()
AnimationManager()->FUN_10061010(FALSE);
Pizza* pizza = (Pizza*) CurrentWorld()->Find(*g_isleScript, IsleScript::c_Pizza_Actor);
pizza->FUN_10038220(m_pizzeriaState->FUN_10017d70());
pizza->FUN_10038220((IsleScript::Script) m_pizzeriaState->FUN_10017d70());
}
return 1;

View File

@ -1108,7 +1108,7 @@ MxResult LegoAnimationManager::StartEntityAction(MxDSAction& p_dsAction, LegoEnt
// FUNCTION: LEGO1 0x10060dc0
// FUNCTION: BETA10 0x10041f2c
MxResult LegoAnimationManager::FUN_10060dc0(
IsleScript::Script p_objectId,
MxU32 p_objectId,
MxMatrix* p_matrix,
MxBool p_param3,
MxBool p_param4,

View File

@ -33,6 +33,7 @@
#include "mxvariabletable.h"
#include "pizza.h"
#include "pizzeria.h"
#include "racecar.h"
#include "scripts.h"
#include "skateboard.h"
#include "towtrack.h"