Implement/match several functions in Act3, refactor (#1197)

* Implement/match several functions in Act3, refactor

* Fix naming

* Rename

* Add comment

* Add annotation

* Add BETA assert
This commit is contained in:
Christian Semmler 2024-12-08 10:00:57 -07:00 committed by GitHub
parent 97fb6e4f15
commit 1aff40dd94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 244 additions and 112 deletions

View file

@ -22,7 +22,7 @@ class Act2Actor : public LegoAnimActor {
void SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2) override; // vtable+0x24
void SetWorldSpeed(MxFloat p_worldSpeed) override; // vtable+0x30
MxS32 VTable0x68(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3) override; // vtable+0x68
void VTable0x70(float p_und) override; // vtable+0x70
void VTable0x70(float p_time) override; // vtable+0x70
MxResult VTable0x94(LegoPathActor*, MxBool) override; // vtable+0x94
MxResult VTable0x9c() override; // vtable+0x9c
MxS32 VTable0xa0() override; // vtable+0xa0

View file

@ -6,8 +6,15 @@
#include "legostate.h"
#include "legoworld.h"
class Act3Brickster;
class Act3Cop;
class Act3Shark;
class Helicopter;
// Macros confirmed by BETA10
#define MAX_PIZZAS 20
#define MAX_DONUTS 20
// SIZE 0x0c
struct Act3ListElement {
undefined4 m_unk0x00[3]; // 0x00
@ -89,7 +96,7 @@ class Act3 : public LegoWorld {
MxBool Escape() override; // vtable+0x64
void Enable(MxBool p_enable) override; // vtable+0x68
void SetHelicopter(Helicopter* p_helicopter) { m_helicopter = p_helicopter; }
void SetHelicopter(Helicopter* p_copter) { m_copter = p_copter; }
void SetDestLocation(LegoGameState::Area p_destLocation) { m_destLocation = p_destLocation; }
// SYNTHETIC: LEGO1 0x10072630
@ -101,15 +108,15 @@ class Act3 : public LegoWorld {
void FUN_10073430();
protected:
undefined4 m_unk0xf8; // 0xf8
Act3Ammo m_unk0xfc[20]; // 0xfc
Act3Ammo m_unk0x217c[20]; // 0x217c
Act3State* m_state; // 0xf8
Act3Ammo m_pizzas[MAX_PIZZAS]; // 0xfc
Act3Ammo m_donuts[MAX_DONUTS]; // 0x217c
undefined m_unk0x41fc; // 0x41fc
undefined4 m_unk0x4200; // 0x4200
undefined4 m_unk0x4204; // 0x4204
undefined4 m_unk0x4208; // 0x4208
Helicopter* m_helicopter; // 0x420c
undefined4 m_unk0x4210; // 0x4210
Act3Cop* m_cop1; // 0x4200
Act3Cop* m_cop2; // 0x4204
Act3Brickster* m_brickster; // 0x4208
Helicopter* m_copter; // 0x420c
Act3Shark* m_shark; // 0x4210
MxFloat m_unk0x4214; // 0x4214
undefined4 m_unk0x4218; // 0x4218
undefined m_unk0x421c; // 0x421c
@ -117,7 +124,7 @@ class Act3 : public LegoWorld {
undefined m_unk0x421e; // 0x421e
Act3List m_unk0x4220; // 0x4220
undefined4 m_unk0x4230[15]; // 0x4230
undefined4 m_unk0x426c; // 0x426c
Act3Script::Script m_unk0x426c; // 0x426c
LegoGameState::Area m_destLocation; // 0x4270
};

View file

@ -20,7 +20,7 @@ class Act3Actor : public LegoAnimActor {
return "Act3Actor";
}
MxU32 VTable0x90(float p_float, Matrix4& p_transform) override; // vtable+0x90
MxU32 VTable0x90(float p_time, Matrix4& p_transform) override; // vtable+0x90
MxResult VTable0x94(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
// SYNTHETIC: LEGO1 0x10043330

View file

@ -12,7 +12,7 @@ class Act3Brickster : public Act3Actor {
~Act3Brickster() override;
void ParseAction(char* p_extra) override; // vtable+0x20
void VTable0x70(float p_und) override; // vtable+0x70
void VTable0x70(float p_time) override; // vtable+0x70
MxResult VTable0x94(LegoPathActor*, MxBool) override; // vtable+0x94
void SwitchBoundary(
LegoPathBoundary*& p_boundary,

View file

@ -11,7 +11,7 @@ class Act3Cop : public Act3Actor {
Act3Cop();
void ParseAction(char* p_extra) override; // vtable+0x20
void VTable0x70(float p_und) override; // vtable+0x70
void VTable0x70(float p_time) override; // vtable+0x70
MxResult VTable0x94(LegoPathActor*, MxBool) override; // vtable+0x94
MxResult VTable0x9c() override; // vtable+0x9c

View file

@ -18,7 +18,7 @@ class Act3Shark : public LegoAnimActor {
}
void ParseAction(char*) override; // vtable+0x20
void VTable0x70(float p_float) override; // vtable+0x70
void VTable0x70(float p_time) override; // vtable+0x70
// LegoAnimActor vtable
virtual MxResult FUN_10042ce0(void*); // vtable+0x10

View file

@ -25,9 +25,9 @@ class Doors : public LegoPathActor {
}
void ParseAction(char* p_extra) override; // vtable+0x20
void VTable0x70(float p_float) override; // vtable+0x70
void VTable0x70(float p_time) override; // vtable+0x70
MxResult VTable0x94(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
virtual MxFloat VTable0xcc(float p_float); // vtable+0xcc
virtual MxFloat VTable0xcc(float p_time); // vtable+0xcc
// SYNTHETIC: LEGO1 0x1000e580
// Doors::`scalar deleting destructor'

View file

@ -66,7 +66,7 @@ class Helicopter : public IslePathActor {
}
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void VTable0x70(float p_float) override; // vtable+0x70
void VTable0x70(float p_time) override; // vtable+0x70
void VTable0x74(Matrix4& p_transform) override; // vtable+0x74
MxLong HandleClick() override; // vtable+0xcc
MxLong HandleControl(LegoControlManagerNotificationParam& p_param) override; // vtable+0xd4

View file

@ -55,7 +55,7 @@ class LegoAnimActor : public virtual LegoPathActor {
void ParseAction(char* p_extra) override; // vtable+0x20
void SetWorldSpeed(MxFloat p_worldSpeed) override; // vtable+0x30
void VTable0x70(float p_und) override; // vtable+0x70
void VTable0x70(float p_time) override; // vtable+0x70
void VTable0x74(Matrix4& p_transform) override; // vtable+0x74
virtual MxResult FUN_1001c1f0(float& p_und);

View file

@ -87,8 +87,8 @@ class LegoBuildingManager : public MxCore {
MxResult FUN_10030630();
LegoBuildingInfo* GetInfoArray(MxS32& p_length);
void FUN_100307b0(LegoEntity* p_entity, MxS32 p_adjust);
void FUN_10030800();
static void FUN_10030800();
static const char* GetCustomizeAnimFile() { return g_customizeAnimFile; }
// SYNTHETIC: LEGO1 0x1002f940

View file

@ -43,9 +43,9 @@ class LegoExtraActor : public virtual LegoAnimActor {
float p_f2,
Vector3& p_v3
) override; // vtable+0x6c
void VTable0x70(float) override; // vtable+0x70
void VTable0x70(float p_time) override; // vtable+0x70
void VTable0x74(Matrix4& p_transform) override; // vtable+0x74
MxU32 VTable0x90(float p_float, Matrix4& p_matrix) override; // vtable+0x90
MxU32 VTable0x90(float p_time, Matrix4& p_matrix) override; // vtable+0x90
MxResult VTable0x94(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
MxResult VTable0x9c() override; // vtable+0x9c
void VTable0xa4(MxBool& p_und1, MxS32& p_und2) override; // vtable+0xa4

View file

@ -40,7 +40,7 @@ class LegoJetski : public LegoJetskiRaceActor, public LegoRaceMap {
float p_f2,
Vector3& p_v3
) override; // vtable+0x6c
void VTable0x70(float p_float) override; // vtable+0x70
void VTable0x70(float p_time) override; // vtable+0x70
MxResult VTable0x94(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
void SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
override; // vtable+0x98

View file

@ -39,7 +39,7 @@ class LegoJetskiRaceActor : public virtual LegoCarRaceActor {
float p_f2,
Vector3& p_v3
) override; // vtable+0x6c
void VTable0x70(float p_float) override; // vtable+0x70
void VTable0x70(float p_time) override; // vtable+0x70
MxS32 VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_edge) override; // vtable+0x1c
// SYNTHETIC: LEGO1 0x10013a80

View file

@ -38,7 +38,6 @@ class LegoNavController : public MxCore {
void SetTargets(int p_hPos, int p_vPos, MxBool p_accel);
void SetControlMax(int p_hMax, int p_vMax);
void SetTrackDefaultParams(MxBool p_state) { m_trackDefault = p_state; }
void SetToDefaultParams();
MxBool CalculateNewPosDir(
const Vector3& p_curPos,
@ -88,6 +87,13 @@ class LegoNavController : public MxCore {
// FUNCTION: BETA10 0x100c7880
void SetTrackDefault(MxS32 p_trackDefault) { m_trackDefault = p_trackDefault; }
// FUNCTION: BETA10 0x100178a0
void Reset()
{
m_trackDefault = TRUE;
SetToDefaultParams();
}
MxFloat GetLinearVel() { return m_linearVel; }
MxFloat GetRotationalVel() { return m_rotationalVel; }
MxFloat GetMaxLinearVel() { return m_maxLinearVel; }
@ -96,17 +102,17 @@ class LegoNavController : public MxCore {
void ResetMaxLinearVel(MxFloat p_maxLinearVel)
{
m_maxLinearVel = p_maxLinearVel;
m_trackDefault = 0;
m_trackDefault = FALSE;
}
void ResetMaxLinearAccel(MxFloat p_maxLinearAccel)
{
m_maxLinearAccel = p_maxLinearAccel;
m_trackDefault = 0;
m_trackDefault = FALSE;
}
void ResetMaxLinearDeccel(MxFloat p_maxLinearDeccel)
{
m_maxLinearDeccel = p_maxLinearDeccel;
m_trackDefault = 0;
m_trackDefault = FALSE;
}
// FUNCTION: BETA10 0x100c9a10

View file

@ -49,6 +49,7 @@ class LegoPlantManager : public MxCore {
MxBool FUN_10026c50(LegoEntity* p_entity);
void ScheduleAnimation(LegoEntity* p_entity, MxLong p_length);
void FUN_10027120();
void FUN_10027200();
static void SetCustomizeAnimFile(const char* p_value);
static const char* GetCustomizeAnimFile() { return g_customizeAnimFile; }

View file

@ -31,7 +31,7 @@ class LegoRaceActor : public virtual LegoAnimActor {
}
MxS32 VTable0x68(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3) override; // vtable+0x68
MxU32 VTable0x90(float p_float, Matrix4& p_matrix) override; // vtable+0x90
MxU32 VTable0x90(float p_time, Matrix4& p_matrix) override; // vtable+0x90
MxResult VTable0x94(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
// FUNCTION: LEGO1 0x10014aa0

View file

@ -23,7 +23,7 @@ class LegoRaceMap : public virtual LegoRaceActor {
// LegoPathActor vtable
MxLong Notify(MxParam& p_param) override; // vtable+0x04
void ParseAction(char* p_extra) override; // vtable+0x20
void VTable0x70(float p_und) override = 0; // vtable+0x70
void VTable0x70(float p_time) override = 0; // vtable+0x70
// LegoRaceMap vtable
virtual void FUN_1005d4b0(); // vtable+0x00

View file

@ -66,7 +66,7 @@ class LegoRaceCar : public LegoCarRaceActor, public LegoRaceMap {
float p_f2,
Vector3& p_v3
) override; // vtable+0x6c
void VTable0x70(float p_float) override; // vtable+0x70
void VTable0x70(float p_time) override; // vtable+0x70
MxResult VTable0x94(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
void SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
override; // vtable+0x98

View file

@ -43,12 +43,12 @@ class LegoCarRaceActor : public virtual LegoRaceActor {
float p_f2,
Vector3& p_v3
) override; // vtable+0x6c
void VTable0x70(float p_float) override; // vtable+0x70
void VTable0x70(float p_time) override; // vtable+0x70
void SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
override; // vtable+0x98
MxResult VTable0x9c() override; // vtable+0x9c
virtual void FUN_10080590(float p_float);
virtual void FUN_10080590(float p_time);
// FUNCTION: LEGO1 0x10012bb0
virtual void FUN_10012bb0(float p_unk0x14) { m_unk0x14 = p_unk0x14; }

View file

@ -117,7 +117,7 @@ MxResult Act2Actor::VTable0x9c()
// STUB: LEGO1 0x10018c30
// STUB: BETA10 0x1000cb52
void Act2Actor::VTable0x70(float p_und)
void Act2Actor::VTable0x70(float p_time)
{
// TODO
}

View file

@ -15,7 +15,7 @@ Act3Actor::Act3Actor()
}
// FUNCTION: LEGO1 0x1003fb70
MxU32 Act3Actor::VTable0x90(float p_float, Matrix4& p_transform)
MxU32 Act3Actor::VTable0x90(float p_time, Matrix4& p_transform)
{
// Note: Code duplication with LegoExtraActor::VTable0x90
switch (m_state & 0xff) {
@ -23,10 +23,10 @@ MxU32 Act3Actor::VTable0x90(float p_float, Matrix4& p_transform)
case 1:
return TRUE;
case 2:
m_unk0x1c = p_float + 2000.0f;
m_unk0x1c = p_time + 2000.0f;
m_state = 3;
m_actorTime += (p_float - m_lastTime) * m_worldSpeed;
m_lastTime = p_float;
m_actorTime += (p_time - m_lastTime) * m_worldSpeed;
m_lastTime = p_time;
return FALSE;
case 3:
assert(!m_userNavFlag);
@ -34,7 +34,7 @@ MxU32 Act3Actor::VTable0x90(float p_float, Matrix4& p_transform)
p_transform = m_roi->GetLocal2World();
if (m_unk0x1c > p_float) {
if (m_unk0x1c > p_time) {
Mx3DPointFloat position;
position = positionRef;
@ -42,8 +42,8 @@ MxU32 Act3Actor::VTable0x90(float p_float, Matrix4& p_transform)
p_transform.RotateX(0.6);
positionRef = position;
m_actorTime += (p_float - m_lastTime) * m_worldSpeed;
m_lastTime = p_float;
m_actorTime += (p_time - m_lastTime) * m_worldSpeed;
m_lastTime = p_time;
VTable0x74(p_transform);
return FALSE;

View file

@ -21,7 +21,7 @@ void Act3Brickster::ParseAction(char* p_extra)
}
// STUB: LEGO1 0x10041050
void Act3Brickster::VTable0x70(float p_und)
void Act3Brickster::VTable0x70(float p_time)
{
// TODO
}

View file

@ -22,7 +22,7 @@ void Act3Cop::ParseAction(char* p_extra)
}
// STUB: LEGO1 0x100401f0
void Act3Cop::VTable0x70(float p_und)
void Act3Cop::VTable0x70(float p_time)
{
// TODO
}

View file

@ -16,7 +16,7 @@ MxResult Act3Shark::FUN_10042ce0(void*)
}
// STUB: LEGO1 0x10042d40
void Act3Shark::VTable0x70(float p_float)
void Act3Shark::VTable0x70(float p_time)
{
// TODO
}

View file

@ -40,11 +40,11 @@ MxResult Doors::VTable0x94(LegoPathActor* p_actor, MxBool p_bool)
// FUNCTION: LEGO1 0x10066190
// FUNCTION: BETA10 0x1002696b
MxFloat Doors::VTable0xcc(float p_float)
MxFloat Doors::VTable0xcc(float p_time)
{
MxFloat fVar1;
fVar1 = p_float - m_unk0x158;
fVar1 = p_time - m_unk0x158;
if (fVar1 <= 0.0f) {
return 0.0f;
@ -65,7 +65,7 @@ MxFloat Doors::VTable0xcc(float p_float)
// FUNCTION: LEGO1 0x10066250
// FUNCTION: BETA10 0x10026a45
void Doors::VTable0x70(float p_float)
void Doors::VTable0x70(float p_time)
{
assert(m_ltDoor && m_rtDoor);
@ -80,7 +80,7 @@ void Doors::VTable0x70(float p_float)
case 1:
break;
case 2:
float local8 = VTable0xcc(p_float);
float local8 = VTable0xcc(p_time);
if (local8 > 0.0f) {
MxMatrix local58(m_ltDoorLocal);
@ -102,7 +102,7 @@ void Doors::VTable0x70(float p_float)
m_unk0x1f4 = local8;
}
if (m_unk0x158 + g_unk0x100d8e84 < p_float) {
if (m_unk0x158 + g_unk0x100d8e84 < p_time) {
m_ltDoor->FUN_100a58f0(m_ltDoorLocal);
m_rtDoor->FUN_100a58f0(m_rtDoorLocal);
m_ltDoor->VTable0x14();

View file

@ -354,16 +354,16 @@ void Helicopter::VTable0x74(Matrix4& p_transform)
}
// FUNCTION: LEGO1 0x10003ee0
void Helicopter::VTable0x70(float p_float)
void Helicopter::VTable0x70(float p_time)
{
MxU32 state = m_state->GetUnkown8();
switch (state) {
default:
LegoPathActor::VTable0x70(p_float);
LegoPathActor::VTable0x70(p_time);
return;
case 4:
case 5:
float f = m_unk0x1f0 - p_float + 3000;
float f = m_unk0x1f0 - p_time + 3000;
if (f >= 0) {
float f2 = f / 3000 + 1;
if (f2 < 0) {

View file

@ -889,7 +889,7 @@ void LegoBuildingManager::FUN_100307b0(LegoEntity* p_entity, MxS32 p_adjust)
// FUNCTION: LEGO1 0x10030800
void LegoBuildingManager::FUN_10030800()
{
for (MxS32 i = 0; i < sizeOfArray(g_buildingInfo); i++) {
for (MxU32 i = 0; i < sizeOfArray(g_buildingInfo); i++) {
g_buildingInfo[i].m_initialUnk0x11 = g_buildingInfo[i].m_unk0x11;
}
}

View file

@ -633,3 +633,11 @@ void LegoPlantManager::FUN_100271b0(LegoEntity* p_entity, MxS32 p_adjust)
}
}
}
// FUNCTION: LEGO1 0x10027200
void LegoPlantManager::FUN_10027200()
{
for (MxU32 i = 0; i < sizeOfArray(g_plantInfo); i++) {
g_plantInfo[i].m_initialUnk0x16 = g_plantInfo[i].m_unk0x16;
}
}

View file

@ -25,7 +25,7 @@ void LegoJetski::FUN_100136f0(float p_worldSpeed)
}
// STUB: LEGO1 0x10013740
void LegoJetski::VTable0x70(float p_float)
void LegoJetski::VTable0x70(float p_time)
{
// TODO
}

View file

@ -119,14 +119,14 @@ MxS32 LegoJetskiRaceActor::VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_
}
// FUNCTION: LEGO1 0x10081550
void LegoJetskiRaceActor::VTable0x70(float p_float)
void LegoJetskiRaceActor::VTable0x70(float p_time)
{
if (m_unk0x0c == 0) {
const LegoChar* raceState = VariableTable()->GetVariable(g_raceState);
if (!stricmp(raceState, g_racing)) {
m_unk0x0c = 1;
m_lastTime = p_float - 1.0f;
m_unk0x1c = p_float;
m_lastTime = p_time - 1.0f;
m_unk0x1c = p_time;
}
else if (!m_userNavFlag) {
LegoAnimActor::VTable0x70(m_lastTime + 1.0f);
@ -134,7 +134,7 @@ void LegoJetskiRaceActor::VTable0x70(float p_float)
}
if (m_unk0x0c == 1) {
LegoAnimActor::VTable0x70(p_float);
LegoAnimActor::VTable0x70(p_time);
}
}

View file

@ -142,6 +142,7 @@ void LegoNavController::SetControlMax(int p_hMax, int p_vMax)
}
// FUNCTION: LEGO1 0x10054cd0
// FUNCTION: BETA10 0x1009ad76
void LegoNavController::SetToDefaultParams()
{
m_deadZone = g_defdeadZone;

View file

@ -106,7 +106,7 @@ MxResult LegoPointOfViewController::Create(Lego3DView* p_lego3DView)
m_lego3DView = p_lego3DView;
m_nav = new LegoNavController();
LegoOmni::GetInstance()->SetNavController(m_nav);
m_nav->SetTrackDefaultParams(TRUE);
m_nav->SetTrackDefault(TRUE);
TickleManager()->RegisterClient(this, 10);
return SUCCESS;
}

View file

@ -70,10 +70,10 @@ void LegoAnimActor::VTable0x74(Matrix4& p_transform)
}
// FUNCTION: LEGO1 0x1001c290
void LegoAnimActor::VTable0x70(float p_float)
void LegoAnimActor::VTable0x70(float p_time)
{
if (m_lastTime == 0) {
m_lastTime = p_float - 1.0f;
m_lastTime = p_time - 1.0f;
}
if (m_state == 0 && !m_userNavFlag && m_worldSpeed <= 0) {
@ -84,10 +84,10 @@ void LegoAnimActor::VTable0x70(float p_float)
FUN_1001c360(f, matrix);
}
m_lastTime = m_actorTime = p_float;
m_lastTime = m_actorTime = p_time;
}
else {
LegoPathActor::VTable0x70(p_float);
LegoPathActor::VTable0x70(p_time);
}
}

View file

@ -45,7 +45,7 @@ MxS32 LegoRaceActor::VTable0x68(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3)
// FUNCTION: LEGO1 0x100147f0
// FUNCTION: BETA10 0x100c9c93
MxU32 LegoRaceActor::VTable0x90(float p_float, Matrix4& p_transform)
MxU32 LegoRaceActor::VTable0x90(float p_time, Matrix4& p_transform)
{
// Note: Code duplication with LegoExtraActor::VTable0x90
switch (m_state) {
@ -54,10 +54,10 @@ MxU32 LegoRaceActor::VTable0x90(float p_float, Matrix4& p_transform)
return 1;
case 2:
m_unk0x08 = p_float + 2000.0f;
m_unk0x08 = p_time + 2000.0f;
m_state = 3;
m_actorTime += (p_float - m_lastTime) * m_worldSpeed;
m_lastTime = p_float;
m_actorTime += (p_time - m_lastTime) * m_worldSpeed;
m_lastTime = p_time;
return 0;
case 3:
@ -66,7 +66,7 @@ MxU32 LegoRaceActor::VTable0x90(float p_float, Matrix4& p_transform)
p_transform = m_roi->GetLocal2World();
if (m_unk0x08 > p_float) {
if (m_unk0x08 > p_time) {
Mx3DPointFloat position;
position = positionRef;
@ -74,8 +74,8 @@ MxU32 LegoRaceActor::VTable0x90(float p_float, Matrix4& p_transform)
p_transform.RotateX(0.6);
positionRef = position;
m_actorTime += (p_float - m_lastTime) * m_worldSpeed;
m_lastTime = p_float;
m_actorTime += (p_time - m_lastTime) * m_worldSpeed;
m_lastTime = p_time;
VTable0x74(p_transform);
return 0;

View file

@ -371,17 +371,17 @@ MxU32 LegoRaceCar::HandleSkeletonKicks(float p_param1)
// FUNCTION: LEGO1 0x100131f0
// FUNCTION: BETA10 0x100cb88a
void LegoRaceCar::VTable0x70(float p_float)
void LegoRaceCar::VTable0x70(float p_time)
{
if (m_userNavFlag && (m_userState == LEGORACECAR_KICK1 || m_userState == LEGORACECAR_KICK2)) {
FUN_10012ff0(p_float);
FUN_10012ff0(p_time);
return;
}
LegoCarRaceActor::VTable0x70(p_float);
LegoCarRaceActor::VTable0x70(p_time);
if (m_userNavFlag && m_userState == LEGORACECAR_UNKNOWN_1) {
if (HandleSkeletonKicks(p_float)) {
if (HandleSkeletonKicks(p_time)) {
return;
}
}
@ -390,7 +390,7 @@ void LegoRaceCar::VTable0x70(float p_float)
FUN_1005d4b0();
if (!m_userNavFlag) {
FUN_10080590(p_float);
FUN_10080590(p_time);
return;
}
@ -415,11 +415,11 @@ void LegoRaceCar::VTable0x70(float p_float)
}
if (absoluteSpeed != 0.0f) {
g_unk0x100f0b88 = p_float;
g_unk0x100f0b88 = p_time;
g_unk0x100f0b8c = FALSE;
}
if (p_float - g_unk0x100f0b88 > 5000.0f && !g_unk0x100f0b8c) {
if (p_time - g_unk0x100f0b88 > 5000.0f && !g_unk0x100f0b8c) {
SoundManager()->GetCacheSoundManager()->Play(g_srt001ra, NULL, 0);
g_unk0x100f0b8c = TRUE;
}

View file

@ -54,7 +54,7 @@ LegoCarRaceActor::LegoCarRaceActor()
// FUNCTION: LEGO1 0x10080590
// FUNCTION: BETA10 0x100cd8cf
void LegoCarRaceActor::FUN_10080590(float p_float)
void LegoCarRaceActor::FUN_10080590(float p_time)
{
MxFloat maxSpeed = m_maxLinearVel;
Mx3DPointFloat destEdgeUnknownVector;
@ -89,8 +89,8 @@ void LegoCarRaceActor::FUN_10080590(float p_float)
}
MxFloat deltaSpeed = maxSpeed - m_worldSpeed;
MxFloat changeInSpeed = (p_float - m_unk0x1c) * m_unk0x14;
m_unk0x1c = p_float;
MxFloat changeInSpeed = (p_time - m_unk0x1c) * m_unk0x14;
m_unk0x1c = p_time;
if (deltaSpeed < 0.0f) {
changeInSpeed = -changeInSpeed;
@ -214,7 +214,7 @@ void LegoCarRaceActor::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown
// FUNCTION: LEGO1 0x10080b70
// FUNCTION: BETA10 0x100cdbae
void LegoCarRaceActor::VTable0x70(float p_float)
void LegoCarRaceActor::VTable0x70(float p_time)
{
// m_unk0x0c is not an MxBool, there are places where it is set to 2 or higher
if (m_unk0x0c == 0) {
@ -222,13 +222,13 @@ void LegoCarRaceActor::VTable0x70(float p_float)
if (strcmpi(value, g_racing) == 0) {
m_unk0x0c = 1;
m_lastTime = p_float - 1.0f;
m_unk0x1c = p_float;
m_lastTime = p_time - 1.0f;
m_unk0x1c = p_time;
}
}
if (m_unk0x0c == 1) {
LegoAnimActor::VTable0x70(p_float);
LegoAnimActor::VTable0x70(p_time);
}
}

View file

@ -1,26 +1,42 @@
#include "act3.h"
#include "3dmanager/lego3dmanager.h"
#include "act3_actions.h"
#include "helicopter.h"
#include "legoanimationmanager.h"
#include "legobuildingmanager.h"
#include "legocontrolmanager.h"
#include "legomain.h"
#include "legonavcontroller.h"
#include "legoplantmanager.h"
#include "legovideomanager.h"
#include "misc.h"
#include "mxbackgroundaudiomanager.h"
#include "mxmisc.h"
#include "mxnotificationmanager.h"
#include "mxticklemanager.h"
#include "mxtransitionmanager.h"
DECOMP_SIZE_ASSERT(Act3, 0x4274)
DECOMP_SIZE_ASSERT(Act3State, 0x0c)
DECOMP_SIZE_ASSERT(Act3ListElement, 0x0c)
DECOMP_SIZE_ASSERT(Act3List, 0x10)
// GLOBAL: LEGO1 0x100d95e8
Act3Script::Script g_unk0x100d95e8[] =
{Act3Script::c_tlp053in_RunAnim, Act3Script::c_tlp064la_RunAnim, Act3Script::c_tlp068in_RunAnim};
// FUNCTION: LEGO1 0x10072270
// FUNCTION: BETA10 0x10015470
Act3::Act3()
{
m_unk0xf8 = 0;
m_state = NULL;
m_unk0x41fc = 0;
m_unk0x4200 = 0;
m_unk0x4204 = 0;
m_unk0x4208 = 0;
m_helicopter = NULL;
m_unk0x4210 = 0;
m_cop1 = NULL;
m_cop2 = NULL;
m_brickster = NULL;
m_copter = NULL;
m_shark = NULL;
m_unk0x4214 = -1;
m_unk0x421e = 0;
@ -37,10 +53,13 @@ MxBool Act3::VTable0x5c()
return TRUE;
}
// STUB: LEGO1 0x100726a0
// FUNCTION: LEGO1 0x100726a0
// FUNCTION: BETA10 0x100155da
Act3::~Act3()
{
// TODO
Destroy(TRUE);
NotificationManager()->Unregister(this);
TickleManager()->UnregisterClient(this);
}
// STUB: LEGO1 0x100727e0
@ -55,47 +74,134 @@ MxBool Act3::FUN_10072980(LegoPathController*, Mx3DPointFloat& p_loc, Mx3DPointF
return FALSE;
}
// STUB: LEGO1 0x10072c30
// FUNCTION: LEGO1 0x10072c30
// FUNCTION: BETA10 0x100160fb
MxResult Act3::Create(MxDSAction& p_dsAction)
{
// TODO
return SUCCESS;
GameState()->FindLoadedAct();
MxResult result = LegoWorld::Create(p_dsAction);
if (result == SUCCESS) {
ControlManager()->Register(this);
InputManager()->SetWorld(this);
InputManager()->Register(this);
switch (GameState()->GetLoadedAct()) {
case LegoGameState::e_act2:
GameState()->StopArea(LegoGameState::e_infomain);
GameState()->StopArea(LegoGameState::e_act2main);
break;
case LegoGameState::e_act3:
GameState()->StopArea(LegoGameState::e_infomain);
GameState()->StopArea(LegoGameState::e_act3script);
break;
case LegoGameState::e_act1:
case LegoGameState::e_actNotFound:
GameState()->StopArea(LegoGameState::e_undefined);
if (GameState()->GetPreviousArea() == LegoGameState::e_infomain) {
GameState()->StopArea(LegoGameState::e_isle);
}
}
// STUB: LEGO1 0x10072d50
LegoGameState* gameState = GameState();
Act3State* state = (Act3State*) gameState->GetState("Act3State");
if (state == NULL) {
state = (Act3State*) gameState->CreateState("Act3State");
}
m_state = state;
assert(m_state);
GameState()->m_currentArea = LegoGameState::e_act3script;
GameState()->SetCurrentAct(LegoGameState::e_act3);
GameState()->SetDirty(TRUE);
}
return result;
}
// FUNCTION: LEGO1 0x10072d50
// FUNCTION: BETA10 0x1001627f
void Act3::Destroy(MxBool p_fromDestructor)
{
// TODO
NavController()->Reset();
ControlManager()->Unregister(this);
if (InputManager()->GetWorld() == this) {
InputManager()->ClearWorld();
}
InputManager()->UnRegister(this);
if (UserActor() != NULL) {
if ((IslePathActor*) UserActor() == m_copter) {
((IslePathActor*) UserActor())->Exit();
}
Remove(UserActor());
}
if (!p_fromDestructor) {
LegoWorld::Destroy(FALSE);
}
}
// STUB: LEGO1 0x10072de0
// STUB: BETA10 0x10016322
MxLong Act3::Notify(MxParam& p_param)
{
// TODO
return 0;
}
// STUB: LEGO1 0x10073270
// FUNCTION: LEGO1 0x10073270
void Act3::ReadyWorld()
{
// TODO
PlantManager()->FUN_10027200();
BuildingManager()->FUN_10030800();
AnimationManager()->FUN_1005f6d0(FALSE);
VideoManager()->Get3DManager()->SetFrustrum(90.0f, 0.1f, 125.0f);
m_unk0x426c = g_unk0x100d95e8[rand() % 3];
AnimationManager()->FUN_10060dc0(m_unk0x426c, NULL, TRUE, FALSE, NULL, TRUE, FALSE, FALSE, FALSE);
m_state->m_unk0x08 = 1;
}
// STUB: LEGO1 0x10073300
// FUNCTION: LEGO1 0x10073300
MxResult Act3::Tickle()
{
// TODO
if (!m_worldStarted) {
LegoWorld::Tickle();
return SUCCESS;
}
// STUB: LEGO1 0x10073400
void Act3::FUN_10073400()
{
if (m_unk0x426c != (Act3Script::Script) 0) {
if (AnimationManager()->FUN_10064ee0(m_unk0x426c)) {
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
TickleManager()->UnregisterClient(this);
m_unk0x426c = (Act3Script::Script) 0;
}
}
// STUB: LEGO1 0x10073430
return SUCCESS;
}
// FUNCTION: LEGO1 0x10073400
void Act3::FUN_10073400()
{
m_state->m_unk0x08 = 2;
m_destLocation = LegoGameState::e_infomain;
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
}
// FUNCTION: LEGO1 0x10073430
void Act3::FUN_10073430()
{
m_state->m_unk0x08 = 3;
m_destLocation = LegoGameState::e_infomain;
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
}
// STUB: LEGO1 0x10073a90
@ -104,15 +210,18 @@ void Act3::Enable(MxBool p_enable)
// TODO
}
// STUB: LEGO1 0x10073e40
// FUNCTION: LEGO1 0x10073e40
void Act3::VTable0x60()
{
// TODO
// empty
}
// STUB: LEGO1 0x10073e50
// FUNCTION: LEGO1 0x10073e50
MxBool Act3::Escape()
{
// TODO
return FALSE;
BackgroundAudioManager()->Stop();
AnimationManager()->FUN_10061010(FALSE);
DeleteObjects(&m_atomId, Act3Script::c_tlp053in_RunAnim, 999);
m_destLocation = LegoGameState::e_infomain;
return TRUE;
}