1
0
Fork 0
mirror of https://github.com/isledecomp/isle.git synced 2025-04-11 22:24:24 -04:00

Implement/match IslePathActor::Exit ()

* Implement/match IslePathActor::Exit

* Name

* Name

* Partially fix vector interface

* Revert "Partially fix vector interface"

This reverts commit 6e7a1e2b08.

* Revert "Revert "Partially fix vector interface""

This reverts commit e3860e3c9f.

* Fix

* Remove some COMPAT_MODE
This commit is contained in:
Christian Semmler 2024-06-06 11:45:37 -04:00 committed by GitHub
parent 9b22642f0c
commit 9a9bccda0e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 196 additions and 153 deletions

View file

@ -89,7 +89,7 @@ public:
MxU32 HandleClick() override; // vtable+0xcc
MxU32 HandleControl(LegoControlManagerEvent& p_param) override; // vtable+0xd4
MxU32 VTable0xdc(MxType19NotificationParam&) override; // vtable+0xdc
void VTable0xe4() override; // vtable+0xe4
void Exit() override; // vtable+0xe4
void CreateState();
void FUN_10036e60();

View file

@ -26,7 +26,7 @@ public:
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
MxU32 HandleClick() override; // vtable+0xcc
MxU32 HandleControl(LegoControlManagerEvent& p_param) override; // vtable+0xd4
void VTable0xe4() override; // vtable+0xe4
void Exit() override; // vtable+0xe4
void FUN_10076b60();

View file

@ -28,7 +28,7 @@ public:
MxU32 HandleClick() override; // vtable+0xcc
MxU32 HandleControl(LegoControlManagerEvent& p_param) override; // vtable+0xd4
MxU32 VTable0xdc(MxType19NotificationParam& p_param) override; // vtable+0xdc
void VTable0xe4() override; // vtable+0xe4
void Exit() override; // vtable+0xe4
void FUN_10068350();

View file

@ -69,7 +69,7 @@ public:
MxU32 HandleClick() override; // vtable+0xcc
MxU32 HandleControl(LegoControlManagerEvent& p_param) override; // vtable+0xd4
MxU32 VTable0xd8(LegoEndAnimNotificationParam& p_param) override; // vtable+0xd8
void VTable0xe4() override; // vtable+0xe4
void Exit() override; // vtable+0xe4
// SYNTHETIC: LEGO1 0x10003210
// Helicopter::`scalar deleting destructor'

View file

@ -4,6 +4,7 @@
#include "legogamestate.h"
#include "legopathactor.h"
#include "mxtypes.h"
#include "roi/legoroi.h"
class LegoControlManagerEvent;
class LegoEndAnimNotificationParam;
@ -120,8 +121,8 @@ public:
// FUNCTION: LEGO1 0x10002e00
virtual MxU32 VTable0xdc(MxType19NotificationParam&) { return 0; } // vtable+0xdc
virtual void VTable0xe0(); // vtable+0xe0
virtual void VTable0xe4(); // vtable+0xe4
virtual void Enter(); // vtable+0xe0
virtual void Exit(); // vtable+0xe4
virtual void SpawnPlayer(LegoGameState::Area p_area, MxBool p_und, MxU8 p_flags); // vtable+0xe8
virtual void VTable0xec(MxMatrix p_transform, LegoPathBoundary* p_boundary, MxBool p_reset); // vtable+0xec
@ -130,12 +131,18 @@ public:
void FUN_1001b660();
void Reset()
{
m_roi->SetVisibility(TRUE);
SetState(0);
}
static void RegisterSpawnLocations();
protected:
LegoWorld* m_world; // 0x154
LegoPathActor* m_unk0x158; // 0x158
MxFloat m_unk0x15c; // 0x15c
LegoWorld* m_world; // 0x154
LegoPathActor* m_previousActor; // 0x158
MxFloat m_previousVel; // 0x15c
};
#endif // ISLEPATHACTOR_H

View file

@ -29,7 +29,7 @@ public:
void VTable0x70(float p_float) override; // vtable+0x70
MxU32 HandleClick() override; // vtable+0xcc
MxU32 HandleControl(LegoControlManagerEvent&) override; // vtable+0xd4
void VTable0xe4() override; // vtable+0xe4
void Exit() override; // vtable+0xe4
void FUN_1007e990();

View file

@ -80,7 +80,7 @@ public:
inline MxFloat GetLinearVel() { return m_linearVel; }
inline MxFloat GetRotationalVel() { return m_rotationalVel; }
inline MxFloat GetMaxLinearVel() { return m_maxLinearVel; }
inline void ResetLinearVel(MxFloat p_maxLinearVel)
inline void ResetMaxLinearVel(MxFloat p_maxLinearVel)
{
m_maxLinearVel = p_maxLinearVel;
m_trackDefault = 0;

View file

@ -100,10 +100,10 @@ public:
virtual void VTable0xa8(); // vtable+0xa8
// FUNCTION: LEGO1 0x10002d70
virtual void VTable0xac(MxFloat p_unk0x13c) { m_unk0x13c = p_unk0x13c; } // vtable+0xac
virtual void SetMaxLinearVel(MxFloat p_maxLinearVel) { m_maxLinearVel = p_maxLinearVel; } // vtable+0xac
// FUNCTION: LEGO1 0x10002d80
virtual MxFloat VTable0xb0() { return m_unk0x13c; } // vtable+0xb0
virtual MxFloat GetMaxLinearVel() { return m_maxLinearVel; } // vtable+0xb0
// FUNCTION: LEGO1 0x10002d90
virtual MxFloat VTable0xb4() { return m_unk0x140; } // vtable+0xb4
@ -162,7 +162,7 @@ protected:
MxMatrix m_unk0xec; // 0xec
LegoPathEdgeContainer* m_grec; // 0x134
LegoPathController* m_controller; // 0x138
MxFloat m_unk0x13c; // 0x13c
MxFloat m_maxLinearVel; // 0x13c
MxFloat m_unk0x140; // 0x140
MxFloat m_unk0x144; // 0x144
MxU8 m_unk0x148; // 0x148

View file

@ -28,7 +28,7 @@ public:
MxU32 HandleClick() override; // vtable+0xcc
MxU32 HandleControl(LegoControlManagerEvent& p_param) override; // vtable+0xd4
MxU32 VTable0xdc(MxType19NotificationParam&) override; // vtable+0xdc
void VTable0xe4() override; // vtable+0xe4
void Exit() override; // vtable+0xe4
void FUN_10035e10();

View file

@ -30,7 +30,7 @@ public:
MxU32 HandleClick() override; // vtable+0xcc
MxU32 VTable0xd0() override; // vtable+0xd0
MxU32 HandleControl(LegoControlManagerEvent& p_param) override; // vtable+0xd4
void VTable0xe4() override; // vtable+0xe4
void Exit() override; // vtable+0xe4
inline void SetUnknown0x160(MxBool p_unk0x160) { m_unk0x160 = p_unk0x160; }

View file

@ -88,7 +88,7 @@ public:
MxU32 HandleControl(LegoControlManagerEvent& p_param) override; // vtable+0xd4
MxU32 VTable0xd8(LegoEndAnimNotificationParam& p_param) override; // vtable+0xd8
MxU32 VTable0xdc(MxType19NotificationParam& p_param) override; // vtable+0xdc
void VTable0xe4() override; // vtable+0xe4
void Exit() override; // vtable+0xe4
void CreateState();
void FUN_1004dab0();

View file

@ -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
}

View file

@ -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);

View file

@ -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);

View file

@ -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
}

View file

@ -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 {

View file

@ -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);

View file

@ -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
}

View file

@ -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);

View file

@ -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
}

View file

@ -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();
}
}

View file

@ -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

View file

@ -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;
}

View file

@ -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
}

View file

@ -1573,7 +1573,7 @@ MxU16 LegoAnimationManager::FUN_10062110(
Mx3DPointFloat position(p_roi->GetWorldPosition());
// TODO: Fix call
((Vector3&) position).Sub(&p_position);
((Vector3&) position).Sub(p_position);
float len = position.LenSquared();
float min, max;
@ -2458,17 +2458,17 @@ MxBool LegoAnimationManager::FUN_10064010(LegoPathBoundary* p_boundary, LegoUnkn
Vector3* v2 = p_edge->CCWVertex(*p_boundary);
p1 = *v2;
((Vector3&) p1).Sub(v1);
((Vector3&) p1).Sub(*v1);
((Vector3&) p1).Mul(p_destScale);
((Vector3&) p1).Add(v1);
((Vector3&) p1).Add(*v1);
BoundingBox boundingBox;
Mx3DPointFloat vec(1.0f, 1.0f, 1.0f);
boundingBox.Min() = p1;
boundingBox.Min().Sub(&vec);
boundingBox.Min().Sub(vec);
boundingBox.Max() = p1;
boundingBox.Max().Add(&vec);
boundingBox.Max().Add(vec);
return GetViewManager()->FUN_100a6150(boundingBox) == FALSE;
}
@ -2677,7 +2677,7 @@ MxResult LegoAnimationManager::FUN_10064670(Vector3* p_position)
if (p_position != NULL) {
Mx3DPointFloat vec(98.875f, 0.0f, -46.1564f);
((Vector3&) vec).Sub(p_position);
((Vector3&) vec).Sub(*p_position);
if (vec.LenSquared() < 800.0f) {
success = TRUE;
@ -2701,7 +2701,7 @@ MxResult LegoAnimationManager::FUN_10064740(Vector3* p_position)
if (p_position != NULL) {
Mx3DPointFloat vec(-21.375f, 0.0f, -41.75f);
((Vector3&) vec).Sub(p_position);
((Vector3&) vec).Sub(*p_position);
if (vec.LenSquared() < 1000.0f) {
success = TRUE;

View file

@ -467,7 +467,6 @@ MxBool FUN_1003ef60()
GameState()->m_currentArea != LegoGameState::e_elevdown &&
GameState()->m_currentArea != LegoGameState::e_garadoor &&
GameState()->m_currentArea != LegoGameState::e_polidoor) {
if (CurrentActor() == NULL || !CurrentActor()->IsA("TowTrack")) {
if (CurrentActor() == NULL || !CurrentActor()->IsA("Ambulance")) {
MxU32 unk0x18 = act1State->GetUnknown18();

View file

@ -29,7 +29,7 @@ LegoCarRaceActor::LegoCarRaceActor()
m_unk0x08 = 1.0f;
m_unk0x70 = 0.0f;
m_unk0x0c = 0;
m_unk0x13c = 0.0f;
m_maxLinearVel = 0.0f;
m_frequencyFactor = 1.0f;
m_unk0x1c = 0;
m_unk0x10 = 0.65f;

View file

@ -10,11 +10,11 @@ void LegoJetski::FUN_100136f0(float p_worldSpeed)
{
if (p_worldSpeed < 0) {
LegoCarRaceActor::m_unk0x0c = 2;
m_unk0x13c = 0;
m_maxLinearVel = 0;
SetWorldSpeed(0);
}
else {
m_unk0x13c = p_worldSpeed;
m_maxLinearVel = p_worldSpeed;
}
}

View file

@ -97,7 +97,7 @@ MxU32 LegoExtraActor::VTable0x90(float p_time, Matrix4& p_transform)
else {
m_state = 0;
m_scheduledTime = 0.0f;
((Vector3&) positionRef).Sub(&g_unk0x10104c18); // TODO: Fix call
((Vector3&) positionRef).Sub(g_unk0x10104c18); // TODO: Fix call
m_roi->FUN_100a58f0(p_transform);
return TRUE;
}
@ -218,7 +218,7 @@ MxResult LegoExtraActor::VTable0x94(LegoPathActor* p_actor, MxBool p_bool)
// TODO: Fix calls
((Mx3DPointFloat&) dir).Mul(2.0f);
((Vector3&) positionRef).Add(&dir);
((Vector3&) positionRef).Add(dir);
for (MxS32 i = 0; i < m_boundary->GetNumEdges(); i++) {
Mx4DPointFloat* normal = m_boundary->GetEdgeNormal(i);
@ -251,7 +251,7 @@ MxResult LegoExtraActor::VTable0x94(LegoPathActor* p_actor, MxBool p_bool)
Mx3DPointFloat dir = p_actor->GetWorldDirection();
MxMatrix matrix3 = MxMatrix(roi->GetLocal2World());
Vector3 positionRef(matrix3[3]);
((Vector3&) positionRef).Add(&g_unk0x10104c18);
((Vector3&) positionRef).Add(g_unk0x10104c18);
roi->FUN_100a58f0(matrix3);
#ifdef COMPAT_MODE
@ -463,7 +463,7 @@ MxU32 LegoExtraActor::VTable0x6c(
Vector3 local60(local2world[3]);
Mx3DPointFloat local54(p_v1);
((Vector3&) local54).Sub(&local60);
((Vector3&) local54).Sub(local60);
float local1c = p_v2.Dot(&p_v2, &p_v2);
float local24 = p_v2.Dot(&p_v2, &local54) * 2.0f;
float local20 = local54.Dot(&local54, &local54);

View file

@ -68,7 +68,7 @@ MxResult LegoPathActor::VTable0x80(Vector3& p_point1, Vector3& p_point2, Vector3
Mx3DPointFloat p1, p2, p3;
p1 = p_point3;
((Vector3&) p1).Sub(&p_point1);
((Vector3&) p1).Sub(p_point1);
m_BADuration = p1.LenSquared();
if (m_BADuration > 0.0f) {
@ -102,14 +102,14 @@ MxResult LegoPathActor::VTable0x88(
Mx3DPointFloat p1, p2, p3, p4, p5;
p1 = *v2;
((Vector3&) p1).Sub(v1);
((Vector3&) p1).Sub(*v1);
((Vector3&) p1).Mul(p_srcScale);
((Vector3&) p1).Add(v1);
((Vector3&) p1).Add(*v1);
p2 = *v4;
((Vector3&) p2).Sub(v3);
((Vector3&) p2).Sub(*v3);
((Vector3&) p2).Mul(p_destScale);
((Vector3&) p2).Add(v3);
((Vector3&) p2).Add(*v3);
m_boundary = p_boundary;
m_destEdge = &p_destEdge;
@ -120,7 +120,7 @@ MxResult LegoPathActor::VTable0x88(
p_destEdge.FUN_1002ddc0(*p_boundary, p3);
p4 = p2;
((Vector3&) p4).Sub(&p1);
((Vector3&) p4).Sub(p1);
p4.Unitize();
MxMatrix matrix;
@ -177,9 +177,9 @@ MxResult LegoPathActor::VTable0x84(
Mx3DPointFloat p2, p3, p5;
p2 = *v4;
((Vector3&) p2).Sub(v3);
((Vector3&) p2).Sub(*v3);
((Vector3&) p2).Mul(p_destScale);
((Vector3&) p2).Add(v3);
((Vector3&) p2).Add(*v3);
m_boundary = p_boundary;
m_destEdge = &p_destEdge;
@ -285,12 +285,12 @@ MxS32 LegoPathActor::VTable0x8c(float p_time, Matrix4& p_transform)
m_worldSpeed *= m_unk0x144;
nav->SetLinearVel(m_worldSpeed);
Mx3DPointFloat p7(p2);
((Vector3&) p7).Sub(&p6);
((Vector3&) p7).Sub(p6);
if (p7.Unitize() == 0) {
float f = sqrt(p1.LenSquared()) * m_unk0x140;
((Vector3&) p7).Mul(f);
((Vector3&) p1).Add(&p7);
((Vector3&) p1).Add(p7);
}
}
}
@ -474,7 +474,7 @@ MxU32 LegoPathActor::VTable0x6c(
MxS32 LegoPathActor::VTable0x68(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3)
{
Mx3DPointFloat v2(p_v2);
((Vector3&) v2).Sub(&p_v1);
((Vector3&) v2).Sub(p_v1);
float len = v2.LenSquared();
@ -553,7 +553,7 @@ void LegoPathActor::ParseAction(char* p_extra)
if (KeyValueStringParse(value, g_strPERMIT_NAVIGATE, p_extra)) {
SetUserNavFlag(TRUE);
NavController()->ResetLinearVel(m_worldSpeed);
NavController()->ResetMaxLinearVel(m_worldSpeed);
SetCurrentActor(this);
}
@ -650,7 +650,7 @@ MxResult LegoPathActor::VTable0x9c()
Mx3DPointFloat local84(m_unk0xec[2]);
Mx3DPointFloat local70(local34);
((Vector3&) local70).Sub(&localc0);
((Vector3&) local70).Sub(localc0);
float len = local70.LenSquared();
if (len >= 0.0f) {
len = sqrt(len);

View file

@ -53,11 +53,11 @@ void LegoPathBoundary::FUN_100575b0(Vector3& p_point1, Vector3& p_point2, LegoPa
Mx3DPointFloat v;
v = p_point1;
((Vector3&) v).Sub(ccwV);
((Vector3&) v).Sub(*ccwV);
float dot1 = v.Dot(&v, m_unk0x50);
v = p_point2;
((Vector3&) v).Sub(ccwV);
((Vector3&) v).Sub(*ccwV);
float dot2 = v.Dot(&v, m_unk0x50);
if (dot2 > dot1) {
@ -201,7 +201,7 @@ MxU32 LegoPathBoundary::Intersect(
if (local10 == 0) {
local10 = 1;
vec = p_point2;
((Vector3&) vec).Sub(&p_point1);
((Vector3&) vec).Sub(p_point1);
len = vec.LenSquared();
if (len <= 0.0f) {
@ -235,10 +235,10 @@ MxU32 LegoPathBoundary::Intersect(
p_point3 = vec;
p_point3.Mul(localc);
p_point3.Add(&p_point1);
p_point3.Add(p_point1);
local50 = p_point2;
((Vector3&) local50).Sub(local5c);
((Vector3&) local50).Sub(*local5c);
e->FUN_1002ddc0(*this, local70);
@ -258,7 +258,7 @@ MxU32 LegoPathBoundary::Intersect(
Vector3* local90 = local88->CWVertex(*this);
Mx3DPointFloat locala4(p_point3);
((Vector3&) locala4).Sub(local90);
((Vector3&) locala4).Sub(*local90);
float local8c = locala4.Dot(&locala4, &local84);
@ -285,7 +285,7 @@ MxU32 LegoPathBoundary::Intersect(
Vector3* localc4 = locala8->CWVertex(*this);
Mx3DPointFloat locald8(p_point3);
((Vector3&) locald8).Sub(localc4);
((Vector3&) locald8).Sub(*localc4);
float localc0 = locald8.Dot(&locald8, &localbc);
@ -317,7 +317,7 @@ MxU32 LegoPathBoundary::Intersect(
else if (local58 > 0.0f && e->m_unk0x3c > local58) {
p_point3 = local70;
p_point3.Mul(local58);
p_point3.Add(local5c);
p_point3.Add(*local5c);
p_edge = e;
return 1;
}
@ -345,7 +345,7 @@ MxU32 LegoPathBoundary::FUN_10057fe0(LegoAnimPresenter* p_presenter)
Mx3DPointFloat unk0x30;
unk0x30 = m_unk0x30;
((Vector3&) unk0x30).Sub(&p_presenter->m_unk0xa8);
((Vector3&) unk0x30).Sub(p_presenter->m_unk0xa8);
float len = unk0x30.LenSquared();
float local20 = p_presenter->m_unk0xa4 + m_unk0x44;

View file

@ -94,7 +94,7 @@ MxResult LegoPathController::Create(MxU8* p_data, const Vector3& p_location, con
for (i = 0; i < m_numN; i++) {
// TODO: Fix call
((Vector3&) m_unk0x10[i]).Add(&p_location);
((Vector3&) m_unk0x10[i]).Add(p_location);
}
for (i = 0; i < m_numL; i++) {
@ -756,9 +756,9 @@ MxS32 LegoPathController::FUN_1004a240(
Mx3DPointFloat vec;
p_v1 = *p_edge->CCWVertex(*p_boundary);
p_v1.Sub(p_edge->CWVertex(*p_boundary));
p_v1.Sub(*p_edge->CWVertex(*p_boundary));
p_v1.Mul(p_f1);
p_v1.Add(p_edge->CWVertex(*p_boundary));
p_v1.Add(*p_edge->CWVertex(*p_boundary));
p_edge->FUN_1002ddc0(*p_boundary, vec);
p_v2.EqualsCross(p_boundary->GetUnknown0x14(), &vec);
return 0;

View file

@ -23,11 +23,11 @@ void LegoRaceCar::FUN_10012ea0(float p_worldSpeed)
{
if (p_worldSpeed < 0) {
LegoCarRaceActor::m_unk0x0c = 2;
m_unk0x13c = 0;
m_maxLinearVel = 0;
SetWorldSpeed(0);
}
else {
m_unk0x13c = p_worldSpeed;
m_maxLinearVel = p_worldSpeed;
}
}

View file

@ -648,12 +648,7 @@ void LegoAnimPresenter::PutFrame()
up = und;
#ifdef COMPAT_MODE
Mx3DPointFloat location = m_currentWorld->GetCamera()->GetWorldLocation();
((Vector3&) up).Sub(&location);
#else
((Vector3&) up).Sub(&m_currentWorld->GetCamera()->GetWorldLocation());
#endif
((Vector3&) up).Sub(m_currentWorld->GetCamera()->GetWorldLocation());
((Vector3&) dir).Div(dirsqr);
pos.EqualsCross(&dir, &up);
pos.Unitize();
@ -1119,7 +1114,7 @@ void LegoAnimPresenter::VTable0x8c()
m_unk0xa8.Add((*m_unk0x78)[3]);
}
else {
m_unk0xa8.Add(&m_action->GetLocation());
m_unk0xa8.Add(m_action->GetLocation());
}
if (m_currentWorld == NULL) {
@ -1176,10 +1171,10 @@ MxU32 LegoAnimPresenter::VTable0x94(Vector3& p_v1, Vector3& p_v2, float p_f1, fl
b = p_v2;
((Vector3&) b).Mul(p_f1);
((Vector3&) b).Add(&p_v1);
((Vector3&) b).Add(p_v1);
a = b;
((Vector3&) a).Sub(&m_unk0xa8);
((Vector3&) a).Sub(m_unk0xa8);
float len = a.LenSquared();
if (len <= 0.0f) {

View file

@ -66,12 +66,7 @@ void LegoLoopingAnimPresenter::PutFrame()
up = und;
#ifdef COMPAT_MODE
Mx3DPointFloat location = m_currentWorld->GetCamera()->GetWorldLocation();
((Vector3&) up).Sub(&location);
#else
((Vector3&) up).Sub(&m_currentWorld->GetCamera()->GetWorldLocation());
#endif
((Vector3&) up).Sub(m_currentWorld->GetCamera()->GetWorldLocation());
((Vector3&) dir).Div(dirsqr);
pos.EqualsCross(&dir, &up);
pos.Unitize();

View file

@ -717,13 +717,13 @@ void Isle::Enable(MxBool p_enable)
Mx3DPointFloat position(CurrentActor()->GetROI()->GetWorldPosition());
Mx3DPointFloat sub(-21.375f, 0.0f, -41.75f);
((Vector3&) sub).Sub(&position);
((Vector3&) sub).Sub(position);
if (sub.LenSquared() < 1024.0f) {
AnimationManager()->FUN_10064740(NULL);
}
Mx3DPointFloat sub2(98.874992f, 0.0f, -46.156292f);
((Vector3&) sub2).Sub(&position);
((Vector3&) sub2).Sub(position);
if (sub2.LenSquared() < 1024.0f) {
AnimationManager()->FUN_10064670(NULL);
}
@ -1219,7 +1219,7 @@ MxBool Isle::Escape()
if (CurrentActor()) {
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
((IslePathActor*) CurrentActor())->VTable0xe4();
((IslePathActor*) CurrentActor())->Exit();
m_skateboard->SetUnknown0x160(FALSE);
}
}
@ -1265,7 +1265,7 @@ void Isle::FUN_10033350()
if (CurrentActor()) {
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
((IslePathActor*) CurrentActor())->VTable0xe4();
((IslePathActor*) CurrentActor())->Exit();
m_skateboard->SetUnknown0x160(FALSE);
}
}

View file

@ -42,9 +42,9 @@ LegoResult LegoUnknown::FUN_1009a1e0(float p_f1, Matrix4& p_mat, Vector3& p_v, L
}
else if (p_f1 >= 0.999) {
v1 = m_unk0x00[0];
((Vector3&) v1).Add(&m_unk0x00[1]);
((Vector3&) v1).Add(&m_unk0x00[2]);
((Vector3&) v1).Add(&m_unk0x00[3]);
((Vector3&) v1).Add(m_unk0x00[1]);
((Vector3&) v1).Add(m_unk0x00[2]);
((Vector3&) v1).Add(m_unk0x00[3]);
for (LegoS32 i = 0; i < 3; i++) {
v4[i] = m_unk0x00[1][i] + m_unk0x00[2][i] * 2.0f + m_unk0x00[3][i] * 3.0f;

View file

@ -565,7 +565,7 @@ LegoU32 LegoROI::FUN_100a9410(
if (p_collideBox) {
Mx3DPointFloat v2(p_v2);
((Vector3&) v2).Mul(p_f1);
((Vector3&) v2).Add(&p_v1);
((Vector3&) v2).Add(p_v1);
Mx4DPointFloat localc0;
Mx4DPointFloat local9c;
@ -585,7 +585,7 @@ LegoU32 LegoROI::FUN_100a9410(
localc0[3] = local9c[3] = local168[3] = 1.0f;
local38 = local58;
((Vector3&) local38).Add(&locala8);
((Vector3&) local38).Add(locala8);
((Vector3&) local38).Mul(0.5f);
local70 = localc0;
@ -624,7 +624,7 @@ LegoU32 LegoROI::FUN_100a9410(
if (local50 >= 0.0f && local50 <= p_f1) {
Mx3DPointFloat local17c(p_v2);
((Vector3&) local17c).Mul(local50);
((Vector3&) local17c).Add(&local4c);
((Vector3&) local17c).Add(local4c);
LegoS32 j;
for (j = 0; j < 6; j++) {
@ -644,7 +644,7 @@ LegoU32 LegoROI::FUN_100a9410(
}
else {
Mx3DPointFloat v1(p_v1);
((Vector3&) v1).Sub(&GetWorldBoundingSphere().Center());
((Vector3&) v1).Sub(GetWorldBoundingSphere().Center());
float local10 = GetWorldBoundingSphere().Radius();
float local8 = p_v2.Dot(&p_v2, &p_v2);
@ -681,7 +681,7 @@ LegoU32 LegoROI::FUN_100a9410(
if (local1c >= 0.0f && p_f1 >= local1c) {
p_v3 = p_v2;
p_v3.Mul(local1c);
p_v3.Add(&p_v1);
p_v3.Add(p_v1);
return 1;
}
}
@ -708,13 +708,7 @@ void TimeROI::FUN_100a9b40(Matrix4& p_matrix, LegoTime p_time)
Mx3DPointFloat targetPosition(p_matrix[3]);
// TODO: Figure out how to get type right for the call
// TODO: Fix constness of vector/matrix functions
#ifdef COMPAT_MODE
Vector3 worldPosition(m_local2world[3]);
((Vector3&) targetPosition).Sub(&worldPosition);
#else
((Vector3&) targetPosition).Sub(&Vector3(m_local2world[3]));
#endif
((Vector3&) targetPosition).Sub(Vector3(m_local2world[3]));
float division = time * 0.001;
((Vector3&) targetPosition).Div(division);

View file

@ -149,10 +149,10 @@ inline void UnknownMx4DPointFloat::Unknown7()
Mx4DPointFloat v2;
v1 = m_unk0x00;
((Vector4&) v1).Add(&m_unk0x18);
((Vector4&) v1).Add(m_unk0x18);
v2 = m_unk0x00;
((Vector4&) v2).Sub(&m_unk0x18);
((Vector4&) v2).Sub(m_unk0x18);
if (v1.Dot(&v1, &v1) < v2.Dot(&v2, &v2)) {
((Vector4&) m_unk0x18).Mul(-1.0f);

View file

@ -120,13 +120,13 @@ public:
virtual void Add(float* p_other) { AddImpl(p_other); } // vtable+0x4c
// FUNCTION: LEGO1 0x100021e0
virtual void Add(const Vector2* p_other) { AddImpl((float*) p_other->m_data); } // vtable+0x48
virtual void Add(const Vector2& p_other) { AddImpl((float*) p_other.m_data); } // vtable+0x48
// FUNCTION: LEGO1 0x100021f0
virtual void Sub(const float* p_other) { SubImpl((float*) p_other); } // vtable+0x58
// FUNCTION: LEGO1 0x10002200
virtual void Sub(const Vector2* p_other) { SubImpl((float*) p_other->m_data); } // vtable+0x54
virtual void Sub(const Vector2& p_other) { SubImpl((float*) p_other.m_data); } // vtable+0x54
// FUNCTION: LEGO1 0x10002210
virtual void Mul(float* p_other) { MulVectorImpl(p_other); } // vtable+0x64

View file

@ -428,10 +428,10 @@ void ViewManager::UpdateViewTransformations()
Vector3 u(unk0x150[i]);
x = c;
((Vector3&) x).Sub(&b); // TODO: Fix call
((Vector3&) x).Sub(b); // TODO: Fix call
y = a;
((Vector3&) y).Sub(&b); // TODO: Fix call
((Vector3&) y).Sub(b); // TODO: Fix call
u.EqualsCross(&x, &y);
u.Unitize();