2023-06-29 04:10:08 -04:00
|
|
|
#include "isle.h"
|
|
|
|
|
2023-12-15 18:11:34 -05:00
|
|
|
#include "act1state.h"
|
2023-12-16 11:01:22 -05:00
|
|
|
#include "ambulance.h"
|
2024-03-16 14:20:44 -04:00
|
|
|
#include "bike.h"
|
|
|
|
#include "carracestate.h"
|
|
|
|
#include "dunebuggy.h"
|
|
|
|
#include "helicopter.h"
|
2023-12-15 17:29:32 -05:00
|
|
|
#include "islepathactor.h"
|
2024-03-16 14:20:44 -04:00
|
|
|
#include "jetski.h"
|
|
|
|
#include "jetskiracestate.h"
|
|
|
|
#include "jukeboxentity.h"
|
|
|
|
#include "legoanimationmanager.h"
|
2023-12-15 18:11:34 -05:00
|
|
|
#include "legocontrolmanager.h"
|
|
|
|
#include "legoinputmanager.h"
|
2023-12-14 18:24:21 -05:00
|
|
|
#include "legoomni.h"
|
2024-03-09 15:07:52 -05:00
|
|
|
#include "legoutils.h"
|
2024-03-16 14:20:44 -04:00
|
|
|
#include "legovideomanager.h"
|
2024-03-09 15:07:52 -05:00
|
|
|
#include "misc.h"
|
2024-03-16 14:20:44 -04:00
|
|
|
#include "motocycle.h"
|
2024-03-09 15:07:52 -05:00
|
|
|
#include "mxmisc.h"
|
2023-12-14 18:24:21 -05:00
|
|
|
#include "mxnotificationmanager.h"
|
2023-12-15 18:11:34 -05:00
|
|
|
#include "mxtransitionmanager.h"
|
2023-12-16 11:01:22 -05:00
|
|
|
#include "pizza.h"
|
2024-03-16 14:20:44 -04:00
|
|
|
#include "skateboard.h"
|
2023-12-16 11:01:22 -05:00
|
|
|
#include "towtrack.h"
|
2023-12-14 18:24:21 -05:00
|
|
|
|
2024-03-16 14:20:44 -04:00
|
|
|
#include <vec.h>
|
|
|
|
|
2023-12-14 18:24:21 -05:00
|
|
|
DECOMP_SIZE_ASSERT(Isle, 0x140);
|
|
|
|
|
2024-03-16 14:20:44 -04:00
|
|
|
// GLOBAL: LEGO1 0x100f1198
|
|
|
|
undefined4 g_unk0x100f1198 = 0x7f;
|
|
|
|
|
2023-12-14 18:24:21 -05:00
|
|
|
// FUNCTION: LEGO1 0x10030820
|
2023-06-29 04:10:08 -04:00
|
|
|
Isle::Isle()
|
|
|
|
{
|
2023-12-15 18:11:34 -05:00
|
|
|
m_pizza = NULL;
|
|
|
|
m_pizzeria = NULL;
|
|
|
|
m_towtrack = NULL;
|
|
|
|
m_ambulance = NULL;
|
|
|
|
m_jukebox = NULL;
|
|
|
|
m_helicopter = NULL;
|
|
|
|
m_bike = NULL;
|
|
|
|
m_dunebuggy = NULL;
|
2024-01-14 17:00:03 -05:00
|
|
|
m_motocycle = NULL;
|
2023-12-15 18:11:34 -05:00
|
|
|
m_skateboard = NULL;
|
|
|
|
m_racecar = NULL;
|
|
|
|
m_jetski = NULL;
|
|
|
|
m_act1state = 0;
|
2024-03-16 14:20:44 -04:00
|
|
|
m_unk0x13c = LegoGameState::e_undefined;
|
2023-12-14 18:24:21 -05:00
|
|
|
|
|
|
|
NotificationManager()->Register(this);
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
2023-12-15 18:11:34 -05:00
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10030a50
|
|
|
|
Isle::~Isle()
|
|
|
|
{
|
|
|
|
TransitionManager()->SetWaitIndicator(NULL);
|
|
|
|
ControlManager()->Unregister(this);
|
|
|
|
|
|
|
|
if (InputManager()->GetWorld() == this) {
|
|
|
|
InputManager()->ClearWorld();
|
|
|
|
}
|
|
|
|
|
2024-02-26 11:19:16 -05:00
|
|
|
if (CurrentActor() != NULL) {
|
|
|
|
VTable0x6c(CurrentActor());
|
2023-12-15 18:11:34 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
NotificationManager()->Unregister(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10030b20
|
2024-01-13 15:00:11 -05:00
|
|
|
MxResult Isle::Create(MxDSAction& p_dsAction)
|
2023-12-15 18:11:34 -05:00
|
|
|
{
|
2024-02-10 11:37:22 -05:00
|
|
|
GameState()->FindLoadedAct();
|
2023-12-15 18:11:34 -05:00
|
|
|
|
2024-01-13 15:00:11 -05:00
|
|
|
MxResult result = LegoWorld::Create(p_dsAction);
|
2023-12-15 18:11:34 -05:00
|
|
|
if (result == SUCCESS) {
|
|
|
|
ControlManager()->Register(this);
|
|
|
|
InputManager()->SetWorld(this);
|
2024-02-10 13:17:07 -05:00
|
|
|
GameState()->StopArea(LegoGameState::e_previousArea);
|
2023-12-15 18:11:34 -05:00
|
|
|
|
2024-02-10 11:37:22 -05:00
|
|
|
switch (GameState()->GetLoadedAct()) {
|
|
|
|
case LegoGameState::e_act2:
|
2024-02-10 13:17:07 -05:00
|
|
|
GameState()->StopArea(LegoGameState::e_act2main);
|
2023-12-15 18:11:34 -05:00
|
|
|
break;
|
2024-02-10 11:37:22 -05:00
|
|
|
case LegoGameState::e_act3:
|
2024-02-10 13:17:07 -05:00
|
|
|
GameState()->StopArea(LegoGameState::e_act2main); // Looks like a bug
|
2023-12-15 18:11:34 -05:00
|
|
|
break;
|
2024-02-10 11:37:22 -05:00
|
|
|
case LegoGameState::e_actNotFound:
|
2024-03-16 14:20:44 -04:00
|
|
|
m_unk0x13c = LegoGameState::e_infomain;
|
2023-12-15 18:11:34 -05:00
|
|
|
}
|
|
|
|
|
2024-02-10 13:17:07 -05:00
|
|
|
if (GameState()->GetCurrentArea() == LegoGameState::e_isle) {
|
2024-03-13 13:17:20 -04:00
|
|
|
GameState()->SetCurrentArea(LegoGameState::e_undefined);
|
2023-12-15 18:11:34 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
LegoGameState* gameState = GameState();
|
|
|
|
Act1State* state = (Act1State*) gameState->GetState("Act1State");
|
|
|
|
if (state == NULL) {
|
|
|
|
state = (Act1State*) gameState->CreateState("Act1State");
|
|
|
|
}
|
|
|
|
m_act1state = state;
|
|
|
|
|
|
|
|
FUN_1003ef00(TRUE);
|
|
|
|
GameState()->SetDirty(TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2023-12-16 11:01:22 -05:00
|
|
|
// FUNCTION: LEGO1 0x10030c10
|
2023-12-15 18:11:34 -05:00
|
|
|
MxLong Isle::Notify(MxParam& p_param)
|
|
|
|
{
|
2023-12-16 11:01:22 -05:00
|
|
|
MxLong result = 0;
|
|
|
|
LegoWorld::Notify(p_param);
|
|
|
|
|
2024-01-12 17:27:07 -05:00
|
|
|
if (m_worldStarted) {
|
2023-12-16 11:01:22 -05:00
|
|
|
switch (((MxNotificationParam&) p_param).GetNotification()) {
|
|
|
|
case c_notificationEndAction:
|
|
|
|
result = StopAction(p_param);
|
|
|
|
break;
|
|
|
|
case c_notificationButtonUp:
|
|
|
|
case c_notificationButtonDown:
|
|
|
|
switch (m_act1state->GetUnknown18()) {
|
|
|
|
case 3:
|
|
|
|
result = m_pizza->Notify(p_param);
|
|
|
|
break;
|
|
|
|
case 10:
|
|
|
|
result = m_ambulance->Notify(p_param);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2024-01-31 09:47:15 -05:00
|
|
|
case c_notificationClick:
|
2023-12-16 11:01:22 -05:00
|
|
|
result = HandleType17Notification(p_param);
|
|
|
|
break;
|
2024-01-17 11:53:53 -05:00
|
|
|
case c_notificationType18:
|
2023-12-16 11:01:22 -05:00
|
|
|
switch (m_act1state->GetUnknown18()) {
|
|
|
|
case 4:
|
2024-02-26 11:19:16 -05:00
|
|
|
result = CurrentActor()->Notify(p_param);
|
2023-12-16 11:01:22 -05:00
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
result = m_towtrack->Notify(p_param);
|
|
|
|
break;
|
|
|
|
case 10:
|
|
|
|
result = m_ambulance->Notify(p_param);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2024-01-17 11:53:53 -05:00
|
|
|
case c_notificationType19:
|
2023-12-16 11:01:22 -05:00
|
|
|
result = HandleType19Notification(p_param);
|
|
|
|
break;
|
2024-01-17 11:53:53 -05:00
|
|
|
case c_notificationType20:
|
2024-02-02 12:18:46 -05:00
|
|
|
Enable(TRUE);
|
2023-12-16 11:01:22 -05:00
|
|
|
break;
|
2024-01-17 11:53:53 -05:00
|
|
|
case c_notificationTransitioned:
|
2023-12-16 11:01:22 -05:00
|
|
|
result = HandleTransitionEnd();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x10030d90
|
|
|
|
MxLong Isle::StopAction(MxParam& p_param)
|
|
|
|
{
|
2023-12-15 18:11:34 -05:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2024-01-13 15:42:09 -05:00
|
|
|
// FUNCTION: LEGO1 0x10030fc0
|
2024-01-27 15:18:35 -05:00
|
|
|
void Isle::ReadyWorld()
|
2023-12-15 18:11:34 -05:00
|
|
|
{
|
2024-01-27 15:18:35 -05:00
|
|
|
LegoWorld::ReadyWorld();
|
2024-01-13 15:42:09 -05:00
|
|
|
|
|
|
|
if (m_act1state->GetUnknown21()) {
|
2024-02-10 13:17:07 -05:00
|
|
|
GameState()->SwitchArea(LegoGameState::e_infomain);
|
2024-01-13 15:42:09 -05:00
|
|
|
m_act1state->SetUnknown18(0);
|
|
|
|
m_act1state->SetUnknown21(0);
|
|
|
|
}
|
2024-02-10 11:37:22 -05:00
|
|
|
else if (GameState()->GetLoadedAct()) {
|
2024-01-13 15:42:09 -05:00
|
|
|
FUN_1003ef00(TRUE);
|
|
|
|
FUN_10032620();
|
|
|
|
m_act1state->FUN_10034d00();
|
2024-01-17 15:48:48 -05:00
|
|
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
2024-01-13 15:42:09 -05:00
|
|
|
}
|
2023-12-15 18:11:34 -05:00
|
|
|
}
|
|
|
|
|
2023-12-16 11:01:22 -05:00
|
|
|
// STUB: LGEO1 0x10031030
|
|
|
|
MxLong Isle::HandleType17Notification(MxParam& p_param)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x100315f0
|
|
|
|
MxLong Isle::HandleType19Notification(MxParam& p_param)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2024-03-16 14:20:44 -04:00
|
|
|
// FUNCTION: LEGO1 0x10031820
|
2024-02-02 12:18:46 -05:00
|
|
|
void Isle::Enable(MxBool p_enable)
|
2023-12-15 18:11:34 -05:00
|
|
|
{
|
2024-02-02 12:18:46 -05:00
|
|
|
if (m_set0xd0.empty() == p_enable) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
LegoWorld::Enable(p_enable);
|
|
|
|
m_radio.Initialize(p_enable);
|
|
|
|
|
|
|
|
if (p_enable) {
|
2024-03-16 14:20:44 -04:00
|
|
|
FUN_100330e0();
|
|
|
|
|
|
|
|
VideoManager()->ResetPalette(FALSE);
|
|
|
|
m_act1state->FUN_10034d00();
|
|
|
|
|
|
|
|
if (CurrentActor() != NULL && CurrentActor()->GetActorId() != 0) {
|
|
|
|
// TODO: Match, most likely an inline function
|
|
|
|
MxS32 targetEntityId = (CurrentActor()->GetActorId() == 1) + 250;
|
|
|
|
|
|
|
|
if (targetEntityId != -1) {
|
|
|
|
InvokeAction(Extra::e_start, *g_isleScript, targetEntityId, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
InputManager()->SetWorld(this);
|
|
|
|
GameState()->StopArea(LegoGameState::e_previousArea);
|
|
|
|
GameState()->m_previousArea = GameState()->m_currentArea;
|
|
|
|
|
|
|
|
FUN_1003ef00(TRUE);
|
|
|
|
|
|
|
|
if (m_act1state->m_unk0x018 == 0) {
|
|
|
|
MxU32 und[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
|
|
|
|
|
|
|
|
for (MxU32 i = 0; i < 5; i++) {
|
|
|
|
MxS32 und2 = rand() % 5;
|
|
|
|
|
|
|
|
for (MxU32 j = 0; j < _countof(und); j++) {
|
|
|
|
if (und[j] != 0 && und2-- == 0) {
|
|
|
|
AnimationManager()->FUN_100629b0(und[j], TRUE);
|
|
|
|
und[j] = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (CurrentActor() != NULL && CurrentActor()->IsA("Jetski")) {
|
|
|
|
IslePathActor* actor = CurrentActor();
|
|
|
|
actor->VTable0xe8(0x2d, FALSE, 7);
|
|
|
|
actor->SetUnknownDC(0);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_10032620();
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (GameState()->m_currentArea) {
|
|
|
|
case LegoGameState::e_elevride:
|
|
|
|
m_unk0x13c = LegoGameState::e_elevride;
|
|
|
|
|
|
|
|
#ifdef COMPAT_MODE
|
|
|
|
{
|
|
|
|
MxNotificationParam param(c_notificationTransitioned, NULL);
|
|
|
|
NotificationManager()->Send(this, ¶m);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
NotificationManager()->Send(this, &MxNotificationParam(c_notificationTransitioned, NULL));
|
|
|
|
#endif
|
|
|
|
|
|
|
|
SetIsWorldActive(FALSE);
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_jetrace2:
|
|
|
|
if (((JetskiRaceState*) GameState()->GetState("JetskiRaceState"))->GetUnknown0x28() == 2) {
|
|
|
|
m_act1state->m_unk0x018 = 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
FUN_1001fa70(CurrentActor());
|
|
|
|
SetIsWorldActive(TRUE);
|
|
|
|
|
|
|
|
#ifdef COMPAT_MODE
|
|
|
|
{
|
|
|
|
LegoEventNotificationParam param(c_notificationType11, NULL, 0, 0, 0, 0);
|
|
|
|
m_jetski->Notify(param);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
m_jetski->Notify(LegoEventNotificationParam(c_notificationType11, NULL, 0, 0, 0, 0));
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_garadoor:
|
|
|
|
m_unk0x13c = LegoGameState::e_garadoor;
|
|
|
|
|
|
|
|
#ifdef COMPAT_MODE
|
|
|
|
{
|
|
|
|
MxNotificationParam param(c_notificationTransitioned, NULL);
|
|
|
|
NotificationManager()->Send(this, ¶m);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
NotificationManager()->Send(this, &MxNotificationParam(c_notificationTransitioned, NULL));
|
|
|
|
#endif
|
|
|
|
|
|
|
|
SetIsWorldActive(FALSE);
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_polidoor:
|
|
|
|
m_unk0x13c = LegoGameState::e_polidoor;
|
|
|
|
|
|
|
|
#ifdef COMPAT_MODE
|
|
|
|
{
|
|
|
|
MxNotificationParam param(c_notificationTransitioned, NULL);
|
|
|
|
NotificationManager()->Send(this, ¶m);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
NotificationManager()->Send(this, &MxNotificationParam(c_notificationTransitioned, NULL));
|
|
|
|
#endif
|
|
|
|
|
|
|
|
SetIsWorldActive(FALSE);
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_unk57:
|
|
|
|
FUN_1001fa70(CurrentActor());
|
|
|
|
SetIsWorldActive(TRUE);
|
|
|
|
|
|
|
|
#ifdef COMPAT_MODE
|
|
|
|
{
|
|
|
|
LegoEventNotificationParam param(c_notificationType11, NULL, 0, 0, 0, 0);
|
|
|
|
m_bike->Notify(param);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
m_bike->Notify(LegoEventNotificationParam(c_notificationType11, NULL, 0, 0, 0, 0));
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_unk58:
|
|
|
|
FUN_1001fa70(CurrentActor());
|
|
|
|
SetIsWorldActive(TRUE);
|
|
|
|
|
|
|
|
#ifdef COMPAT_MODE
|
|
|
|
{
|
|
|
|
LegoEventNotificationParam param(c_notificationType11, NULL, 0, 0, 0, 0);
|
|
|
|
m_dunebuggy->Notify(param);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
m_dunebuggy->Notify(LegoEventNotificationParam(c_notificationType11, NULL, 0, 0, 0, 0));
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_unk59:
|
|
|
|
FUN_1001fa70(CurrentActor());
|
|
|
|
SetIsWorldActive(TRUE);
|
|
|
|
|
|
|
|
#ifdef COMPAT_MODE
|
|
|
|
{
|
|
|
|
LegoEventNotificationParam param(c_notificationType11, NULL, 0, 0, 0, 0);
|
|
|
|
m_motocycle->Notify(param);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
m_motocycle->Notify(LegoEventNotificationParam(c_notificationType11, NULL, 0, 0, 0, 0));
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_unk60:
|
|
|
|
FUN_1001fa70(CurrentActor());
|
|
|
|
SetIsWorldActive(TRUE);
|
|
|
|
|
|
|
|
#ifdef COMPAT_MODE
|
|
|
|
{
|
|
|
|
LegoEventNotificationParam param(c_notificationType11, NULL, 0, 0, 0, 0);
|
|
|
|
m_helicopter->Notify(param);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
m_helicopter->Notify(LegoEventNotificationParam(c_notificationType11, NULL, 0, 0, 0, 0));
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_unk61:
|
|
|
|
FUN_1001fa70(CurrentActor());
|
|
|
|
SetIsWorldActive(TRUE);
|
|
|
|
|
|
|
|
#ifdef COMPAT_MODE
|
|
|
|
{
|
|
|
|
LegoEventNotificationParam param(c_notificationType11, NULL, 0, 0, 0, 0);
|
|
|
|
m_skateboard->Notify(param);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
m_skateboard->Notify(LegoEventNotificationParam(c_notificationType11, NULL, 0, 0, 0, 0));
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_unk64:
|
|
|
|
FUN_1001fa70(CurrentActor());
|
|
|
|
SetIsWorldActive(TRUE);
|
|
|
|
|
|
|
|
#ifdef COMPAT_MODE
|
|
|
|
{
|
|
|
|
LegoEventNotificationParam param(c_notificationType11, NULL, 0, 0, 0, 0);
|
|
|
|
m_jetski->Notify(param);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
m_jetski->Notify(LegoEventNotificationParam(c_notificationType11, NULL, 0, 0, 0, 0));
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
InputManager()->SetCamera(m_cameraController);
|
|
|
|
SetIsWorldActive(TRUE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (m_act1state->m_unk0x018) {
|
|
|
|
case 0:
|
|
|
|
case 1:
|
|
|
|
m_act1state->m_unk0x018 = 0;
|
|
|
|
|
|
|
|
if (GameState()->m_currentArea == LegoGameState::e_pizzeriaExterior) {
|
|
|
|
AnimationManager()->FUN_10064740(FALSE);
|
|
|
|
}
|
|
|
|
else if (GameState()->m_currentArea == LegoGameState::e_unk66) {
|
|
|
|
Mx3DPointFloat position(CurrentActor()->GetROI()->GetWorldPosition());
|
|
|
|
|
|
|
|
Mx3DPointFloat sub(-21.375f, 0.0f, -41.75f);
|
|
|
|
sub.Sub(&position);
|
|
|
|
if (NORMSQRD3(sub) < 1024.0f) {
|
|
|
|
AnimationManager()->FUN_10064740(FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
Mx3DPointFloat sub2(98.874992f, 0.0f, -46.156292f);
|
|
|
|
sub2.Sub(&position);
|
|
|
|
if (NORMSQRD3(sub2) < 1024.0f) {
|
|
|
|
AnimationManager()->FUN_10064670(FALSE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 5: {
|
|
|
|
CurrentActor()->VTable0xe8(0xf, FALSE, 7);
|
|
|
|
JetskiRaceState* raceState = (JetskiRaceState*) GameState()->GetState("JetskiRaceState");
|
|
|
|
|
|
|
|
if (raceState->GetUnknown0x28() == 2) {
|
|
|
|
undefined4 und = -1;
|
|
|
|
|
|
|
|
switch (raceState->GetState(GameState()->GetActorId())->GetUnknown0x02()) {
|
|
|
|
case 1:
|
|
|
|
und = 0x35e;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
und = 0x35d;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
und = 0x35c;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
AnimationManager()->FUN_10060dc0(und, 0, 1, 1, 0, 0, 0, 1, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
m_act1state->m_unk0x018 = 0;
|
|
|
|
FUN_1003ef00(FALSE);
|
|
|
|
AnimationManager()->FUN_10064670(FALSE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 6: {
|
|
|
|
GameState()->m_currentArea = LegoGameState::e_carraceExterior;
|
|
|
|
CurrentActor()->VTable0xe8(0x15, FALSE, 7);
|
|
|
|
|
|
|
|
CarRaceState* raceState = (CarRaceState*) GameState()->GetState("CarRaceState");
|
|
|
|
|
|
|
|
if (raceState->GetUnknown0x28() == 2) {
|
|
|
|
undefined4 und = -1;
|
|
|
|
|
|
|
|
switch (raceState->GetState(GameState()->GetActorId())->GetUnknown0x02()) {
|
|
|
|
case 1:
|
|
|
|
und = 0x362;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
und = 0x361;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
und = 0x360;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
AnimationManager()->FUN_10060dc0(und, 0, 1, 1, 0, 0, 0, 1, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
m_act1state->m_unk0x018 = 0;
|
|
|
|
FUN_1003ef00(TRUE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 7:
|
|
|
|
m_act1state->m_unk0x018 = 8;
|
|
|
|
|
|
|
|
AnimationManager()->FUN_1005f6d0(FALSE);
|
|
|
|
AnimationManager()->FUN_1005f700(FALSE);
|
|
|
|
|
|
|
|
g_unk0x100f1198 &= ~c_bit7;
|
|
|
|
m_towtrack->FUN_1004dab0();
|
|
|
|
break;
|
|
|
|
case 9:
|
|
|
|
m_act1state->m_unk0x018 = 10;
|
|
|
|
|
|
|
|
AnimationManager()->FUN_1005f6d0(FALSE);
|
|
|
|
AnimationManager()->FUN_1005f700(FALSE);
|
|
|
|
|
|
|
|
g_unk0x100f1198 &= ~c_bit7;
|
|
|
|
m_ambulance->FUN_10036e60();
|
|
|
|
break;
|
|
|
|
case 11:
|
|
|
|
m_act1state->m_unk0x018 = 0;
|
|
|
|
CurrentActor()->VTable0xe8(0x36, TRUE, 7);
|
|
|
|
GameState()->m_currentArea = LegoGameState::e_unk66;
|
|
|
|
FUN_1003ef00(TRUE);
|
|
|
|
m_jukebox->StartAction();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
SetAppCursor(0);
|
|
|
|
|
|
|
|
if (m_act1state->m_unk0x018 != 8 &&
|
|
|
|
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_elevride) &&
|
|
|
|
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_polidoor) &&
|
|
|
|
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_garadoor) &&
|
|
|
|
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_unk57) &&
|
|
|
|
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_unk58) &&
|
|
|
|
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_unk59) &&
|
|
|
|
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_unk60) &&
|
|
|
|
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_unk64) &&
|
|
|
|
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_unk61) &&
|
|
|
|
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_jetrace2)) {
|
|
|
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
|
|
|
}
|
|
|
|
|
|
|
|
SetROIUnknown0x0c("stretch", 0);
|
|
|
|
SetROIUnknown0x0c("bird", 0);
|
|
|
|
SetROIUnknown0x0c("rcred", 0);
|
|
|
|
SetROIUnknown0x0c("towtk", 0);
|
|
|
|
SetROIUnknown0x0c("pizpie", 0);
|
2024-02-02 12:18:46 -05:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (InputManager()->GetWorld() == this) {
|
|
|
|
InputManager()->ClearWorld();
|
|
|
|
}
|
2024-03-16 14:20:44 -04:00
|
|
|
|
|
|
|
m_act1state->FUN_10034b60();
|
2024-02-02 12:18:46 -05:00
|
|
|
}
|
2023-12-15 18:11:34 -05:00
|
|
|
}
|
|
|
|
|
2024-01-13 15:42:09 -05:00
|
|
|
// STUB: LEGO1 0x10032620
|
|
|
|
void Isle::FUN_10032620()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
2023-12-17 17:45:33 -05:00
|
|
|
// STUB: LEGO1 0x100327a0
|
2023-12-16 11:01:22 -05:00
|
|
|
MxLong Isle::HandleTransitionEnd()
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2023-12-15 18:11:34 -05:00
|
|
|
// FUNCTION: LEGO1 0x10032f10
|
2024-01-26 16:00:02 -05:00
|
|
|
void Isle::Add(MxCore* p_object)
|
2023-12-15 18:11:34 -05:00
|
|
|
{
|
2024-01-26 16:00:02 -05:00
|
|
|
LegoWorld::Add(p_object);
|
2023-12-15 18:11:34 -05:00
|
|
|
|
|
|
|
if (p_object->IsA("Pizza")) {
|
|
|
|
m_pizza = (Pizza*) p_object;
|
|
|
|
}
|
|
|
|
else if (p_object->IsA("Pizzeria")) {
|
|
|
|
m_pizzeria = (Pizzeria*) p_object;
|
|
|
|
}
|
|
|
|
else if (p_object->IsA("TowTrack")) {
|
|
|
|
m_towtrack = (TowTrack*) p_object;
|
|
|
|
}
|
|
|
|
else if (p_object->IsA("Ambulance")) {
|
|
|
|
m_ambulance = (Ambulance*) p_object;
|
|
|
|
}
|
|
|
|
else if (p_object->IsA("JukeBoxEntity")) {
|
|
|
|
m_jukebox = (JukeBoxEntity*) p_object;
|
|
|
|
}
|
|
|
|
else if (p_object->IsA("Helicopter")) {
|
|
|
|
m_helicopter = (Helicopter*) p_object;
|
|
|
|
}
|
|
|
|
else if (p_object->IsA("Bike")) {
|
|
|
|
m_bike = (Bike*) p_object;
|
|
|
|
}
|
|
|
|
else if (p_object->IsA("DuneBuggy")) {
|
|
|
|
m_dunebuggy = (DuneBuggy*) p_object;
|
|
|
|
}
|
|
|
|
else if (p_object->IsA("Motorcycle")) {
|
2024-01-14 17:00:03 -05:00
|
|
|
m_motocycle = (Motocycle*) p_object;
|
2023-12-15 18:11:34 -05:00
|
|
|
}
|
|
|
|
else if (p_object->IsA("SkateBoard")) {
|
|
|
|
m_skateboard = (SkateBoard*) p_object;
|
|
|
|
}
|
|
|
|
else if (p_object->IsA("Jetski")) {
|
|
|
|
m_jetski = (Jetski*) p_object;
|
|
|
|
}
|
|
|
|
else if (p_object->IsA("RaceCar")) {
|
|
|
|
m_racecar = (RaceCar*) p_object;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10033050
|
2023-12-15 17:29:32 -05:00
|
|
|
void Isle::VTable0x6c(IslePathActor* p_actor)
|
2023-12-15 18:11:34 -05:00
|
|
|
{
|
2024-01-26 16:00:02 -05:00
|
|
|
LegoWorld::Remove(p_actor);
|
2023-12-15 18:11:34 -05:00
|
|
|
|
2023-12-15 17:29:32 -05:00
|
|
|
if (p_actor->IsA("Helicopter")) {
|
2023-12-15 18:11:34 -05:00
|
|
|
m_helicopter = NULL;
|
|
|
|
}
|
2023-12-15 17:29:32 -05:00
|
|
|
else if (p_actor->IsA("DuneBuggy")) {
|
2023-12-15 18:11:34 -05:00
|
|
|
m_dunebuggy = NULL;
|
|
|
|
}
|
2023-12-15 17:29:32 -05:00
|
|
|
else if (p_actor->IsA("Jetski")) {
|
|
|
|
m_jetski = NULL;
|
2023-12-15 18:11:34 -05:00
|
|
|
}
|
2023-12-15 17:29:32 -05:00
|
|
|
else if (p_actor->IsA("RaceCar")) {
|
|
|
|
m_racecar = NULL;
|
2023-12-15 18:11:34 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-16 14:20:44 -04:00
|
|
|
// STUB: LEGO1 0x100330e0
|
|
|
|
void Isle::FUN_100330e0()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
2023-12-15 18:11:34 -05:00
|
|
|
// STUB: LEGO1 0x10033180
|
|
|
|
MxBool Isle::VTable0x64()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
return FALSE;
|
|
|
|
}
|