mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-27 02:14:18 +00:00
Implement/match IslePathActor::Exit (#997)
* Implement/match IslePathActor::Exit * Name * Name * Partially fix vector interface * Revert "Partially fix vector interface" This reverts commit6e7a1e2b08. * Revert "Revert "Partially fix vector interface"" This reverts commite3860e3c9f. * Fix * Remove some COMPAT_MODE
This commit is contained in:
committed by
GitHub
parent
9b22642f0c
commit
9a9bccda0e
@@ -27,7 +27,7 @@ Ambulance::Ambulance()
|
||||
m_unk0x178 = -1;
|
||||
m_unk0x170 = 0;
|
||||
m_unk0x172 = 0;
|
||||
m_unk0x13c = 40.0;
|
||||
m_maxLinearVel = 40.0;
|
||||
m_unk0x17c = 1.0;
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ void Ambulance::FUN_10036e60()
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10036e90
|
||||
void Ambulance::VTable0xe4()
|
||||
void Ambulance::Exit()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ DECOMP_SIZE_ASSERT(Bike, 0x164)
|
||||
// FUNCTION: LEGO1 0x10076670
|
||||
Bike::Bike()
|
||||
{
|
||||
this->m_unk0x13c = 20.0;
|
||||
this->m_maxLinearVel = 20.0;
|
||||
this->m_unk0x150 = 3.0;
|
||||
this->m_unk0x148 = 1;
|
||||
}
|
||||
@@ -32,9 +32,9 @@ MxResult Bike::Create(MxDSAction& p_dsAction)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10076920
|
||||
void Bike::VTable0xe4()
|
||||
void Bike::Exit()
|
||||
{
|
||||
IslePathActor::VTable0xe4();
|
||||
IslePathActor::Exit();
|
||||
GameState()->SetCurrentArea(LegoGameState::Area::e_bike);
|
||||
RemoveFromCurrentWorld(*g_isleScript, IsleScript::c_BikeDashboard_Bitmap);
|
||||
RemoveFromCurrentWorld(*g_isleScript, IsleScript::c_BikeArms_Ctl);
|
||||
|
||||
@@ -29,7 +29,7 @@ MxLong InfoCenterEntity::VTable0x50(MxParam& p_param)
|
||||
switch (GameState()->GetCurrentAct()) {
|
||||
case LegoGameState::Act::e_act1: {
|
||||
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) CurrentActor())->VTable0xe4();
|
||||
((IslePathActor*) CurrentActor())->Exit();
|
||||
}
|
||||
|
||||
Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle);
|
||||
@@ -71,7 +71,7 @@ MxLong GasStationEntity::VTable0x50(MxParam& p_param)
|
||||
state->SetUnknown18(0);
|
||||
|
||||
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) CurrentActor())->VTable0xe4();
|
||||
((IslePathActor*) CurrentActor())->Exit();
|
||||
}
|
||||
|
||||
Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle);
|
||||
@@ -95,7 +95,7 @@ MxLong HospitalEntity::VTable0x50(MxParam& p_param)
|
||||
act1State->SetUnknown18(0);
|
||||
|
||||
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) CurrentActor())->VTable0xe4();
|
||||
((IslePathActor*) CurrentActor())->Exit();
|
||||
}
|
||||
|
||||
Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle);
|
||||
@@ -119,7 +119,7 @@ MxLong PoliceEntity::VTable0x50(MxParam& p_param)
|
||||
state->SetUnknown18(0);
|
||||
|
||||
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) CurrentActor())->VTable0xe4();
|
||||
((IslePathActor*) CurrentActor())->Exit();
|
||||
}
|
||||
|
||||
Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle);
|
||||
@@ -141,7 +141,7 @@ MxLong BeachHouseEntity::VTable0x50(MxParam& p_param)
|
||||
state->SetUnknown18(0);
|
||||
|
||||
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) CurrentActor())->VTable0xe4();
|
||||
((IslePathActor*) CurrentActor())->Exit();
|
||||
}
|
||||
|
||||
Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle);
|
||||
@@ -162,7 +162,7 @@ MxLong RaceStandsEntity::VTable0x50(MxParam& p_param)
|
||||
state->SetUnknown18(0);
|
||||
|
||||
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) CurrentActor())->VTable0xe4();
|
||||
((IslePathActor*) CurrentActor())->Exit();
|
||||
}
|
||||
|
||||
Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle);
|
||||
|
||||
@@ -7,7 +7,7 @@ DECOMP_SIZE_ASSERT(DuneBuggy, 0x16c)
|
||||
// FUNCTION: LEGO1 0x10067bb0
|
||||
DuneBuggy::DuneBuggy()
|
||||
{
|
||||
this->m_unk0x13c = 25.0;
|
||||
this->m_maxLinearVel = 25.0;
|
||||
this->m_unk0x164 = 1.0;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ void DuneBuggy::VTable0x70(float p_float)
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10067fa0
|
||||
void DuneBuggy::VTable0xe4()
|
||||
void DuneBuggy::Exit()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ DECOMP_SIZE_ASSERT(MxMatrix, 0x48)
|
||||
// FUNCTION: LEGO1 0x10001e60
|
||||
Helicopter::Helicopter()
|
||||
{
|
||||
m_unk0x13c = 60;
|
||||
m_maxLinearVel = 60;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10003230
|
||||
@@ -63,7 +63,7 @@ void Helicopter::CreateState()
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10003360
|
||||
void Helicopter::VTable0xe4()
|
||||
void Helicopter::Exit()
|
||||
{
|
||||
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
|
||||
SpawnPlayer(
|
||||
@@ -73,7 +73,7 @@ void Helicopter::VTable0xe4()
|
||||
);
|
||||
}
|
||||
|
||||
IslePathActor::VTable0xe4();
|
||||
IslePathActor::Exit();
|
||||
|
||||
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
|
||||
GameState()->SetCurrentArea(LegoGameState::e_copter);
|
||||
@@ -117,7 +117,7 @@ MxU32 Helicopter::HandleClick()
|
||||
|
||||
if (CurrentActor()) {
|
||||
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) CurrentActor())->VTable0xe4();
|
||||
((IslePathActor*) CurrentActor())->Exit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ MxU32 Helicopter::HandleClick()
|
||||
break;
|
||||
}
|
||||
|
||||
VTable0xe0();
|
||||
Enter();
|
||||
InvokeAction(Extra::ActionType::e_start, m_script, IsleScript::c_HelicopterDashboard, NULL);
|
||||
GetCurrentAction().SetObjectId(-1);
|
||||
ControlManager()->Register(this);
|
||||
@@ -179,7 +179,7 @@ MxU32 Helicopter::HandleControl(LegoControlManagerEvent& p_param)
|
||||
else if (m_state->GetUnkown8() != 0) {
|
||||
break;
|
||||
}
|
||||
VTable0xe4();
|
||||
Exit();
|
||||
GameState()->SetCurrentArea(LegoGameState::e_unk66);
|
||||
ret = 1;
|
||||
break;
|
||||
@@ -227,7 +227,7 @@ MxU32 Helicopter::HandleControl(LegoControlManagerEvent& p_param)
|
||||
lookat = dir;
|
||||
float scale = 3;
|
||||
lookat.Mul(scale);
|
||||
lookat.Add(&loc);
|
||||
lookat.Add(loc);
|
||||
Mx3DPointFloat v68, v7c, v90(0, 1, 0), va4;
|
||||
v68 = m_world->GetCamera()->GetWorldUp();
|
||||
va4.EqualsCross(&v68, &dir);
|
||||
@@ -248,7 +248,7 @@ MxU32 Helicopter::HandleControl(LegoControlManagerEvent& p_param)
|
||||
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
|
||||
((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::e_infomain);
|
||||
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
||||
VTable0xe4();
|
||||
Exit();
|
||||
}
|
||||
ret = 1;
|
||||
break;
|
||||
@@ -379,9 +379,9 @@ void Helicopter::VTable0x70(float p_float)
|
||||
mat.SetIdentity();
|
||||
m_unk0x1f4.Unknown6(mat, f2);
|
||||
v2.SetVector(loc);
|
||||
v2.Sub(&v);
|
||||
v2.Sub(v);
|
||||
v2.Mul(f2);
|
||||
v2.Add(&v);
|
||||
v2.Add(v);
|
||||
m_world->GetCamera()->FUN_100123e0(mat, 0);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "mxbackgroundaudiomanager.h"
|
||||
#include "mxnotificationparam.h"
|
||||
#include "scripts.h"
|
||||
#include "viewmanager/viewmanager.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(IslePathActor, 0x160)
|
||||
DECOMP_SIZE_ASSERT(IslePathActor::SpawnLocation, 0x38)
|
||||
@@ -25,9 +26,9 @@ IslePathActor::SpawnLocation g_spawnLocations[IslePathActor::c_LOCATIONS_NUM];
|
||||
IslePathActor::IslePathActor()
|
||||
{
|
||||
m_world = NULL;
|
||||
m_unk0x13c = 6.0;
|
||||
m_unk0x15c = 1.0;
|
||||
m_unk0x158 = NULL;
|
||||
m_maxLinearVel = 6.0;
|
||||
m_previousVel = 1.0;
|
||||
m_previousActor = NULL;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1001a280
|
||||
@@ -71,15 +72,15 @@ MxLong IslePathActor::Notify(MxParam& p_param)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1001a350
|
||||
void IslePathActor::VTable0xe0()
|
||||
void IslePathActor::Enter()
|
||||
{
|
||||
m_roi->SetVisibility(FALSE);
|
||||
if (CurrentActor() != this) {
|
||||
m_unk0x15c = NavController()->GetMaxLinearVel();
|
||||
m_unk0x158 = CurrentActor();
|
||||
if (m_unk0x158) {
|
||||
m_unk0x158->ResetWorldTransform(FALSE);
|
||||
m_unk0x158->SetUserNavFlag(FALSE);
|
||||
m_previousVel = NavController()->GetMaxLinearVel();
|
||||
m_previousActor = CurrentActor();
|
||||
if (m_previousActor) {
|
||||
m_previousActor->ResetWorldTransform(FALSE);
|
||||
m_previousActor->SetUserNavFlag(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +89,7 @@ void IslePathActor::VTable0xe0()
|
||||
ResetWorldTransform(TRUE);
|
||||
SetUserNavFlag(TRUE);
|
||||
|
||||
NavController()->ResetLinearVel(m_unk0x13c);
|
||||
NavController()->ResetMaxLinearVel(m_maxLinearVel);
|
||||
|
||||
SetCurrentActor(this);
|
||||
FUN_1001b660();
|
||||
@@ -96,10 +97,62 @@ void IslePathActor::VTable0xe0()
|
||||
}
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1001a3f0
|
||||
void IslePathActor::VTable0xe4()
|
||||
// FUNCTION: LEGO1 0x1001a3f0
|
||||
// FUNCTION: BETA10 0x1003669f
|
||||
void IslePathActor::Exit()
|
||||
{
|
||||
// TODO
|
||||
Reset();
|
||||
|
||||
GetViewManager()->Remove(m_roi);
|
||||
GetViewManager()->Add(m_roi);
|
||||
|
||||
ResetWorldTransform(FALSE);
|
||||
SetUserNavFlag(FALSE);
|
||||
|
||||
if (m_previousActor != NULL) {
|
||||
SetCurrentActor(m_previousActor);
|
||||
NavController()->ResetMaxLinearVel(m_previousVel);
|
||||
m_previousActor->ResetWorldTransform(TRUE);
|
||||
m_previousActor->SetUserNavFlag(TRUE);
|
||||
m_previousActor->SetBoundary(m_boundary);
|
||||
|
||||
MxS32 i;
|
||||
for (i = 0; i < m_boundary->GetNumEdges(); i++) {
|
||||
LegoUnknown100db7f4* e = (LegoUnknown100db7f4*) m_boundary->GetEdges()[i];
|
||||
assert(e);
|
||||
|
||||
Mx3DPointFloat local20;
|
||||
e->FUN_1002ddc0(*m_boundary, local20);
|
||||
|
||||
((Vector3&) local20).Mul(m_roi->GetWorldBoundingSphere().Radius());
|
||||
((Vector3&) local20).Add(GetWorldPosition());
|
||||
|
||||
MxS32 j;
|
||||
for (j = 0; j < m_boundary->GetNumEdges(); j++) {
|
||||
Mx4DPointFloat& normal = *m_boundary->GetEdgeNormal(j);
|
||||
|
||||
if (local20.Dot(&normal, &local20) + normal[3] < -0.001) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_boundary->GetNumEdges() == j) {
|
||||
m_previousActor->SetLocation(local20, GetWorldDirection(), GetWorldUp(), TRUE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_boundary->GetNumEdges() == i) {
|
||||
m_previousActor->SetLocation(GetWorldPosition(), GetWorldDirection(), GetWorldUp(), TRUE);
|
||||
}
|
||||
|
||||
m_previousActor->SetState(0);
|
||||
GameState()->m_currentArea = LegoGameState::Area::e_unk66;
|
||||
}
|
||||
|
||||
FUN_1001b660();
|
||||
FUN_10010c30();
|
||||
FUN_1003eda0();
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1001a700
|
||||
@@ -479,7 +532,7 @@ void IslePathActor::SpawnPlayer(LegoGameState::Area p_area, MxBool p_und, MxU8 p
|
||||
m_world = world;
|
||||
|
||||
if (p_und) {
|
||||
VTable0xe0();
|
||||
Enter();
|
||||
}
|
||||
|
||||
m_world->PlaceActor(
|
||||
@@ -563,7 +616,7 @@ void IslePathActor::VTable0xec(MxMatrix p_transform, LegoPathBoundary* p_boundar
|
||||
|
||||
m_world = CurrentWorld();
|
||||
if (p_reset) {
|
||||
VTable0xe0();
|
||||
Enter();
|
||||
}
|
||||
|
||||
m_world->PlaceActor(this);
|
||||
|
||||
@@ -5,7 +5,7 @@ DECOMP_SIZE_ASSERT(Jetski, 0x164)
|
||||
// FUNCTION: LEGO1 0x1007e3b0
|
||||
Jetski::Jetski()
|
||||
{
|
||||
this->m_unk0x13c = 25.0;
|
||||
this->m_maxLinearVel = 25.0;
|
||||
this->m_unk0x150 = 2.0;
|
||||
this->m_unk0x148 = 1;
|
||||
}
|
||||
@@ -24,7 +24,7 @@ void Jetski::VTable0x70(float p_float)
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1007e6f0
|
||||
void Jetski::VTable0xe4()
|
||||
void Jetski::Exit()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ MxLong JukeBoxEntity::Notify(MxParam& p_param)
|
||||
}
|
||||
|
||||
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
((IslePathActor*) CurrentActor())->VTable0xe4();
|
||||
((IslePathActor*) CurrentActor())->Exit();
|
||||
}
|
||||
|
||||
((Isle*) FindWorld(*g_isleScript, 0))->SetDestLocation(LegoGameState::e_jukeboxw);
|
||||
|
||||
@@ -5,7 +5,7 @@ DECOMP_SIZE_ASSERT(Motocycle, 0x16c)
|
||||
// FUNCTION: LEGO1 0x100357b0
|
||||
Motocycle::Motocycle()
|
||||
{
|
||||
this->m_unk0x13c = 40.0;
|
||||
this->m_maxLinearVel = 40.0;
|
||||
this->m_unk0x150 = 1.75;
|
||||
this->m_unk0x148 = 1;
|
||||
this->m_unk0x164 = 1.0;
|
||||
@@ -25,7 +25,7 @@ void Motocycle::VTable0x70(float p_float)
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10035bc0
|
||||
void Motocycle::VTable0xe4()
|
||||
void Motocycle::Exit()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ undefined4 Pizzeria::HandleClick()
|
||||
if (FUN_1003ef60() && m_pizzaMissionState->m_unk0x0c == 0) {
|
||||
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
if (!CurrentActor()->IsA("SkateBoard")) {
|
||||
((IslePathActor*) CurrentActor())->VTable0xe4();
|
||||
((IslePathActor*) CurrentActor())->Exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,14 +8,14 @@ DECOMP_SIZE_ASSERT(RaceCar, 0x164)
|
||||
// FUNCTION: LEGO1 0x10028200
|
||||
RaceCar::RaceCar()
|
||||
{
|
||||
m_unk0x13c = 40.0;
|
||||
m_maxLinearVel = 40.0;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10028420
|
||||
RaceCar::~RaceCar()
|
||||
{
|
||||
ControlManager()->Unregister(this);
|
||||
VTable0xe4();
|
||||
Exit();
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10028490
|
||||
|
||||
@@ -21,7 +21,7 @@ DECOMP_SIZE_ASSERT(SkateBoard, 0x168)
|
||||
SkateBoard::SkateBoard()
|
||||
{
|
||||
m_unk0x160 = FALSE;
|
||||
m_unk0x13c = 15.0;
|
||||
m_maxLinearVel = 15.0;
|
||||
m_unk0x150 = 3.5;
|
||||
m_unk0x148 = 1;
|
||||
|
||||
@@ -54,7 +54,7 @@ MxResult SkateBoard::Create(MxDSAction& p_dsAction)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10010050
|
||||
void SkateBoard::VTable0xe4()
|
||||
void SkateBoard::Exit()
|
||||
{
|
||||
if (m_act1state->m_unk0x018 == 3) {
|
||||
Pizza* pizza = (Pizza*) CurrentWorld()->Find(*g_isleScript, IsleScript::c_Pizza_Actor);
|
||||
@@ -63,7 +63,7 @@ void SkateBoard::VTable0xe4()
|
||||
m_unk0x160 = FALSE;
|
||||
}
|
||||
|
||||
IslePathActor::VTable0xe4();
|
||||
IslePathActor::Exit();
|
||||
GameState()->m_currentArea = LegoGameState::Area::e_skateboard;
|
||||
RemoveFromCurrentWorld(*g_isleScript, IsleScript::c_SkateArms_Ctl);
|
||||
RemoveFromCurrentWorld(*g_isleScript, IsleScript::c_SkatePizza_Bitmap);
|
||||
@@ -86,12 +86,12 @@ MxU32 SkateBoard::HandleClick()
|
||||
|
||||
if (GameState()->GetActorId() != CurrentActor()->GetActorId()) {
|
||||
if (!CurrentActor()->IsA("SkateBoard")) {
|
||||
((IslePathActor*) CurrentActor())->VTable0xe4();
|
||||
((IslePathActor*) CurrentActor())->Exit();
|
||||
}
|
||||
}
|
||||
|
||||
if (!CurrentActor()->IsA("SkateBoard")) {
|
||||
VTable0xe0();
|
||||
Enter();
|
||||
InvokeAction(Extra::ActionType::e_start, *g_isleScript, IsleScript::c_SkateDashboard, NULL);
|
||||
GetCurrentAction().SetObjectId(-1);
|
||||
ControlManager()->Register(this);
|
||||
@@ -111,7 +111,7 @@ MxU32 SkateBoard::HandleControl(LegoControlManagerEvent& p_param)
|
||||
MxU32 result = 0;
|
||||
|
||||
if (p_param.GetUnknown0x28() == 1 && p_param.GetClickedObjectId() == IsleScript::c_SkateArms_Ctl) {
|
||||
VTable0xe4();
|
||||
Exit();
|
||||
GameState()->m_currentArea = LegoGameState::Area::e_unk66;
|
||||
result = 1;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ TowTrack::TowTrack()
|
||||
m_unk0x170 = -1;
|
||||
m_unk0x16e = 0;
|
||||
m_unk0x174 = -1;
|
||||
m_unk0x13c = 40.0;
|
||||
m_maxLinearVel = 40.0;
|
||||
m_unk0x178 = 1.0;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ MxU32 TowTrack::HandleClick()
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1004d8f0
|
||||
void TowTrack::VTable0xe4()
|
||||
void TowTrack::Exit()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user