mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-22 07:54:23 +00:00
Clear unknowns in LegoVehicleBuildState
(#1684)
This commit is contained in:
@@ -20,11 +20,11 @@ class MxActionNotificationParam;
|
||||
class LegoVehicleBuildState : public LegoState {
|
||||
public:
|
||||
enum AnimationState {
|
||||
e_unknown0 = 0,
|
||||
e_none = 0,
|
||||
e_entering = 1,
|
||||
e_unknown2 = 2,
|
||||
e_settingUpMovie = 2,
|
||||
e_cutscene = 3,
|
||||
e_unknown4 = 4,
|
||||
e_finishedBuild = 4,
|
||||
e_exiting = 6
|
||||
};
|
||||
|
||||
@@ -57,9 +57,9 @@ public:
|
||||
MxString m_className; // 0x38
|
||||
|
||||
AnimationState m_animationState; // 0x48
|
||||
MxU8 m_unk0x4c; // 0x4c
|
||||
MxBool m_unk0x4d; // 0x4d
|
||||
MxBool m_unk0x4e; // 0x4e
|
||||
MxU8 m_introductionCounter; // 0x4c
|
||||
MxBool m_finishedBuild; // 0x4d
|
||||
MxBool m_playedExitScript; // 0x4e
|
||||
MxU8 m_placedPartCount; // 0x4f
|
||||
};
|
||||
|
||||
|
@@ -583,11 +583,11 @@ void IslePathActor::SpawnPlayer(LegoGameState::Area p_area, MxBool p_enter, MxU8
|
||||
break;
|
||||
}
|
||||
|
||||
if (state != NULL && state->m_unk0x4d && !state->m_unk0x4e) {
|
||||
if (state != NULL && state->m_finishedBuild && !state->m_playedExitScript) {
|
||||
if (AnimationManager()
|
||||
->FUN_10060dc0(anim, NULL, TRUE, LegoAnimationManager::e_unk0, NULL, FALSE, TRUE, TRUE, TRUE) ==
|
||||
SUCCESS) {
|
||||
state->m_unk0x4e = TRUE;
|
||||
state->m_playedExitScript = TRUE;
|
||||
camAnim = FALSE;
|
||||
}
|
||||
}
|
||||
|
@@ -202,7 +202,7 @@ MxResult LegoCarBuild::Create(MxDSAction& p_dsAction)
|
||||
}
|
||||
|
||||
m_buildState = buildState;
|
||||
m_unk0x174 = m_buildState->m_unk0x4d;
|
||||
m_unk0x174 = m_buildState->m_finishedBuild;
|
||||
|
||||
GameState()->StopArea(LegoGameState::e_previousArea);
|
||||
|
||||
@@ -512,10 +512,10 @@ void LegoCarBuild::AddSelectedPartToBuild()
|
||||
FUN_100243a0();
|
||||
}
|
||||
else {
|
||||
m_buildState->m_unk0x4d = TRUE;
|
||||
m_buildState->m_finishedBuild = TRUE;
|
||||
InvokeAction(Extra::e_start, m_atomId, m_carId, NULL);
|
||||
NotificationManager()->Send(this, MxNotificationParam());
|
||||
m_buildState->m_animationState = LegoVehicleBuildState::e_unknown4;
|
||||
m_buildState->m_animationState = LegoVehicleBuildState::e_finishedBuild;
|
||||
m_buildState->m_placedPartCount = 0;
|
||||
}
|
||||
}
|
||||
@@ -671,7 +671,8 @@ MxLong LegoCarBuild::Notify(MxParam& p_param)
|
||||
((LegoEventNotificationParam&) p_param).GetY()
|
||||
);
|
||||
|
||||
if (result || m_unk0x10a || m_buildState->m_animationState == 4 || m_buildState->m_animationState == 6) {
|
||||
if (result || m_unk0x10a || m_buildState->m_animationState == LegoVehicleBuildState::e_finishedBuild ||
|
||||
m_buildState->m_animationState == LegoVehicleBuildState::e_exiting) {
|
||||
m_unk0x109 = 0;
|
||||
break;
|
||||
}
|
||||
@@ -684,9 +685,10 @@ MxLong LegoCarBuild::Notify(MxParam& p_param)
|
||||
break;
|
||||
case c_notificationButtonDown:
|
||||
assert(m_buildState);
|
||||
if (((m_buildState->m_animationState != 4) && (m_buildState->m_animationState != 6)) &&
|
||||
(m_buildState->m_animationState != 2)) {
|
||||
m_buildState->m_animationState = LegoVehicleBuildState::e_unknown0;
|
||||
if (((m_buildState->m_animationState != LegoVehicleBuildState::e_finishedBuild) &&
|
||||
(m_buildState->m_animationState != LegoVehicleBuildState::e_exiting)) &&
|
||||
(m_buildState->m_animationState != LegoVehicleBuildState::e_settingUpMovie)) {
|
||||
m_buildState->m_animationState = LegoVehicleBuildState::e_none;
|
||||
result = SelectPartFromMousePosition(
|
||||
((LegoEventNotificationParam&) p_param).GetX(),
|
||||
((LegoEventNotificationParam&) p_param).GetY()
|
||||
@@ -735,7 +737,8 @@ MxLong LegoCarBuild::Notify(MxParam& p_param)
|
||||
// FUNCTION: BETA10 0x1006cc48
|
||||
undefined4 LegoCarBuild::FUN_10024250(LegoEventNotificationParam* p_param)
|
||||
{
|
||||
if (p_param->GetKey() == ' ' && m_buildState->m_animationState != 4 && m_buildState->m_animationState != 2) {
|
||||
if (p_param->GetKey() == ' ' && m_buildState->m_animationState != LegoVehicleBuildState::e_finishedBuild &&
|
||||
m_buildState->m_animationState != LegoVehicleBuildState::e_settingUpMovie) {
|
||||
if (m_numAnimsRun > 0) {
|
||||
DeleteObjects(&m_atomId, 500, 0x1fe);
|
||||
BackgroundAudioManager()->RaiseVolume();
|
||||
@@ -756,7 +759,7 @@ void LegoCarBuild::ReadyWorld()
|
||||
|
||||
if (BackgroundAudioManager()->GetEnabled()) {
|
||||
InvokeAction(Extra::ActionType::e_start, *g_jukeboxScript, FUN_10025ee0(m_carId), NULL);
|
||||
m_buildState->m_animationState = LegoVehicleBuildState::e_unknown2;
|
||||
m_buildState->m_animationState = LegoVehicleBuildState::e_settingUpMovie;
|
||||
NotificationManager()->Send(this, MxNotificationParam());
|
||||
}
|
||||
else {
|
||||
@@ -799,12 +802,12 @@ undefined4 LegoCarBuild::FUN_10024480(MxActionNotificationParam* p_param)
|
||||
MxS32 result = 0;
|
||||
|
||||
switch (m_buildState->m_animationState) {
|
||||
case 3:
|
||||
case LegoVehicleBuildState::e_cutscene:
|
||||
BackgroundAudioManager()->RaiseVolume();
|
||||
m_buildState->m_animationState = LegoVehicleBuildState::e_unknown0;
|
||||
m_buildState->m_animationState = LegoVehicleBuildState::e_none;
|
||||
result = 1;
|
||||
break;
|
||||
case 6:
|
||||
case LegoVehicleBuildState::e_exiting:
|
||||
if (p_param->GetAction()->GetObjectId() == m_unk0x344) {
|
||||
FUN_100243a0();
|
||||
result = 1;
|
||||
@@ -957,8 +960,8 @@ undefined4 LegoCarBuild::FUN_10024890(MxParam* p_param)
|
||||
switch (param->m_clickedObjectId) {
|
||||
// The enum values are all identical between CopterScript, DunecarScript, JetskiScript, and RacecarScript
|
||||
case CopterScript::c_Info_Ctl:
|
||||
if (m_buildState->m_animationState != LegoVehicleBuildState::e_unknown4 &&
|
||||
m_buildState->m_animationState != LegoVehicleBuildState::e_unknown2 &&
|
||||
if (m_buildState->m_animationState != LegoVehicleBuildState::e_finishedBuild &&
|
||||
m_buildState->m_animationState != LegoVehicleBuildState::e_settingUpMovie &&
|
||||
m_buildState->m_animationState != LegoVehicleBuildState::e_exiting &&
|
||||
GameState()->GetCurrentAct() != LegoGameState::e_act2) {
|
||||
if (m_numAnimsRun > 0) {
|
||||
@@ -974,7 +977,7 @@ undefined4 LegoCarBuild::FUN_10024890(MxParam* p_param)
|
||||
break;
|
||||
case CopterScript::c_Exit_Ctl:
|
||||
if (m_buildState->m_animationState != LegoVehicleBuildState::e_exiting &&
|
||||
m_buildState->m_animationState != LegoVehicleBuildState::e_unknown4) {
|
||||
m_buildState->m_animationState != LegoVehicleBuildState::e_finishedBuild) {
|
||||
if (m_numAnimsRun > 0) {
|
||||
DeleteObjects(&m_atomId, 500, 510);
|
||||
}
|
||||
@@ -984,13 +987,13 @@ undefined4 LegoCarBuild::FUN_10024890(MxParam* p_param)
|
||||
if (GameState()->GetCurrentAct() == LegoGameState::e_act2) {
|
||||
FUN_100243a0();
|
||||
}
|
||||
else if (m_animPresenter->AllPartsPlaced() || m_buildState->m_unk0x4d) {
|
||||
m_buildState->m_unk0x4d = TRUE;
|
||||
else if (m_animPresenter->AllPartsPlaced() || m_buildState->m_finishedBuild) {
|
||||
m_buildState->m_finishedBuild = TRUE;
|
||||
InvokeAction(Extra::e_start, m_atomId, m_carId, NULL);
|
||||
|
||||
NotificationManager()->Send(this, MxNotificationParam());
|
||||
|
||||
m_buildState->m_animationState = LegoVehicleBuildState::e_unknown4;
|
||||
m_buildState->m_animationState = LegoVehicleBuildState::e_finishedBuild;
|
||||
}
|
||||
else {
|
||||
FUN_10025720(4);
|
||||
@@ -1063,8 +1066,8 @@ undefined4 LegoCarBuild::FUN_10024890(MxParam* p_param)
|
||||
if (m_buildState->m_animationState != LegoVehicleBuildState::e_exiting) {
|
||||
m_animPresenter->SetShelfState(LegoCarBuildAnimPresenter::e_selected);
|
||||
|
||||
if (m_animPresenter->AllPartsPlaced() || m_buildState->m_unk0x4d) {
|
||||
m_buildState->m_unk0x4d = TRUE;
|
||||
if (m_animPresenter->AllPartsPlaced() || m_buildState->m_finishedBuild) {
|
||||
m_buildState->m_finishedBuild = TRUE;
|
||||
|
||||
// GameState()->GetCurrentAct() returns an MxS16 in BETA10
|
||||
if (GameState()->GetCurrentAct() == 0) {
|
||||
@@ -1073,7 +1076,7 @@ undefined4 LegoCarBuild::FUN_10024890(MxParam* p_param)
|
||||
NotificationManager()->Send(this, MxNotificationParam());
|
||||
|
||||
assert(m_buildState);
|
||||
m_buildState->m_animationState = LegoVehicleBuildState::e_unknown4;
|
||||
m_buildState->m_animationState = LegoVehicleBuildState::e_finishedBuild;
|
||||
}
|
||||
|
||||
else {
|
||||
@@ -1153,7 +1156,7 @@ undefined4 LegoCarBuild::FUN_10024c20(MxNotificationParam* p_param)
|
||||
assert(m_buildState);
|
||||
|
||||
switch (m_buildState->m_animationState) {
|
||||
case 4:
|
||||
case LegoVehicleBuildState::e_finishedBuild:
|
||||
entity = (LegoEntity*) Find(m_atomId, m_carId);
|
||||
|
||||
if (entity && entity->GetROI()) {
|
||||
@@ -1213,7 +1216,7 @@ undefined4 LegoCarBuild::FUN_10024c20(MxNotificationParam* p_param)
|
||||
NotificationManager()->Send(this, MxNotificationParam());
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case LegoVehicleBuildState::e_settingUpMovie:
|
||||
MxU32 jukeboxScript;
|
||||
|
||||
switch (m_carId) {
|
||||
@@ -1252,7 +1255,7 @@ void LegoCarBuild::FUN_10024ef0()
|
||||
ResetViewVelocity();
|
||||
m_buildState->m_animationState = LegoVehicleBuildState::e_cutscene;
|
||||
FUN_10025720(FUN_10025d70());
|
||||
m_buildState->m_unk0x4c += 1;
|
||||
m_buildState->m_introductionCounter += 1;
|
||||
Disable(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
||||
}
|
||||
|
||||
@@ -1623,7 +1626,7 @@ void LegoCarBuild::FUN_10025d10(MxS32 p_param)
|
||||
// FUNCTION: LEGO1 0x10025d70
|
||||
MxS32 LegoCarBuild::FUN_10025d70()
|
||||
{
|
||||
switch (m_buildState->m_unk0x4c % 3) {
|
||||
switch (m_buildState->m_introductionCounter % 3) {
|
||||
case 1:
|
||||
return 1;
|
||||
case 2:
|
||||
@@ -1676,7 +1679,7 @@ MxBool LegoCarBuild::Escape()
|
||||
InvokeAction(Extra::ActionType::e_stop, *g_jukeboxScript, targetEntityId, NULL);
|
||||
DeleteObjects(&m_atomId, 500, 999);
|
||||
|
||||
m_buildState->m_animationState = LegoVehicleBuildState::e_unknown0;
|
||||
m_buildState->m_animationState = LegoVehicleBuildState::e_none;
|
||||
m_destLocation = LegoGameState::e_infomain;
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1703,9 +1706,9 @@ MxS32 LegoCarBuild::FUN_10025ee0(undefined4 p_param1)
|
||||
LegoVehicleBuildState::LegoVehicleBuildState(const char* p_classType)
|
||||
{
|
||||
m_className = p_classType;
|
||||
m_unk0x4c = 0;
|
||||
m_unk0x4d = FALSE;
|
||||
m_unk0x4e = FALSE;
|
||||
m_introductionCounter = 0;
|
||||
m_finishedBuild = FALSE;
|
||||
m_playedExitScript = FALSE;
|
||||
m_placedPartCount = 0;
|
||||
}
|
||||
|
||||
@@ -1716,17 +1719,17 @@ MxResult LegoVehicleBuildState::Serialize(LegoStorage* p_storage)
|
||||
LegoState::Serialize(p_storage);
|
||||
|
||||
if (p_storage->IsReadMode()) {
|
||||
p_storage->ReadU8(m_unk0x4c);
|
||||
p_storage->ReadU8(m_unk0x4d);
|
||||
p_storage->ReadU8(m_unk0x4e);
|
||||
p_storage->ReadU8(m_introductionCounter);
|
||||
p_storage->ReadU8(m_finishedBuild);
|
||||
p_storage->ReadU8(m_playedExitScript);
|
||||
#ifndef BETA10
|
||||
p_storage->ReadU8(m_placedPartCount);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
p_storage->WriteU8(m_unk0x4c);
|
||||
p_storage->WriteU8(m_unk0x4d);
|
||||
p_storage->WriteU8(m_unk0x4e);
|
||||
p_storage->WriteU8(m_introductionCounter);
|
||||
p_storage->WriteU8(m_finishedBuild);
|
||||
p_storage->WriteU8(m_playedExitScript);
|
||||
#ifndef BETA10
|
||||
p_storage->WriteU8(m_placedPartCount);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user