mirror of
https://github.com/isledecomp/isle.git
synced 2026-02-02 18:38:57 +00:00
Clear unknowns in legoracers.h (#1729)
This commit is contained in:
@@ -6,9 +6,11 @@
|
||||
// clang-format on
|
||||
#include "legoracemap.h"
|
||||
|
||||
#define LEGORACECAR_UNKNOWN_0 0
|
||||
#define LEGORACECAR_UNKNOWN_1 1
|
||||
#define LEGORACECAR_NONE 0
|
||||
#define LEGORACECAR_NEAR_SKELETON 1
|
||||
// kick to the left
|
||||
#define LEGORACECAR_KICK1 2 // name guessed
|
||||
// kick to the right
|
||||
#define LEGORACECAR_KICK2 4 // name validated by BETA10 0x100cb659
|
||||
|
||||
// SIZE 0x08
|
||||
@@ -23,7 +25,7 @@ struct SkeletonKickPhase {
|
||||
EdgeReference* m_edgeRef; // 0x00
|
||||
float m_lower; // 0x04
|
||||
float m_upper; // 0x08
|
||||
MxU8 m_userState; // 0x0c
|
||||
MxU8 m_kickState; // 0x0c
|
||||
};
|
||||
|
||||
// VTABLE: LEGO1 0x100d5a08 LegoCarRaceActor
|
||||
@@ -80,7 +82,7 @@ public:
|
||||
// FUNCTION: LEGO1 0x10014210
|
||||
MxResult VTable0x9c() override { return LegoJetskiRaceActor::VTable0x9c(); } // vtable+0x9c
|
||||
|
||||
virtual void FUN_100136f0(float p_worldSpeed);
|
||||
virtual void SetMaxLinearVelocity(float p_worldSpeed);
|
||||
|
||||
static void InitSoundIndices();
|
||||
|
||||
@@ -154,7 +156,7 @@ public:
|
||||
// LegoRaceCar::`scalar deleting destructor'
|
||||
|
||||
private:
|
||||
undefined m_userState; // 0x54
|
||||
MxU8 m_kickState; // 0x54
|
||||
float m_kickStart; // 0x58
|
||||
Mx3DPointFloat m_unk0x5c; // 0x5c
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ MxLong g_timeLastJetskiSoundPlayed = 0;
|
||||
// FUNCTION: BETA10 0x100cad10
|
||||
LegoRaceCar::LegoRaceCar()
|
||||
{
|
||||
m_userState = 0;
|
||||
m_kickState = LEGORACECAR_NONE;
|
||||
m_skelKick1Anim = 0;
|
||||
m_skelKick2Anim = 0;
|
||||
m_unk0x5c.Clear();
|
||||
@@ -301,11 +301,11 @@ void LegoRaceCar::KickCamera(float p_param)
|
||||
LegoAnimActorStruct* a; // called `a` in BETA10
|
||||
float deltaTime;
|
||||
|
||||
if (m_userState == LEGORACECAR_KICK1) {
|
||||
if (m_kickState == LEGORACECAR_KICK1) {
|
||||
a = m_skelKick1Anim;
|
||||
}
|
||||
else {
|
||||
assert(m_userState == LEGORACECAR_KICK2);
|
||||
assert(m_kickState == LEGORACECAR_KICK2);
|
||||
a = m_skelKick2Anim;
|
||||
}
|
||||
|
||||
@@ -315,7 +315,7 @@ void LegoRaceCar::KickCamera(float p_param)
|
||||
deltaTime = p_param - m_kickStart;
|
||||
|
||||
if (a->GetDuration() <= deltaTime || deltaTime < 0.0) {
|
||||
if (m_userState == LEGORACECAR_KICK1) {
|
||||
if (m_kickState == LEGORACECAR_KICK1) {
|
||||
LegoOrientedEdge** edges = m_kick1B->GetEdges();
|
||||
m_destEdge = edges[2];
|
||||
m_boundary = m_kick1B;
|
||||
@@ -326,7 +326,7 @@ void LegoRaceCar::KickCamera(float p_param)
|
||||
m_boundary = m_kick2B;
|
||||
}
|
||||
|
||||
m_userState = LEGORACECAR_UNKNOWN_0;
|
||||
m_kickState = LEGORACECAR_NONE;
|
||||
}
|
||||
else if (a->GetAnimTreePtr()->GetCamAnim()) {
|
||||
MxMatrix transformationMatrix;
|
||||
@@ -370,12 +370,12 @@ MxU32 LegoRaceCar::HandleSkeletonKicks(float p_param1)
|
||||
for (MxS32 i = 0; i < sizeOfArray(g_skeletonKickPhases); i++) {
|
||||
if (m_boundary == current->m_edgeRef->m_b && current->m_lower <= skeletonCurAnimPhase &&
|
||||
skeletonCurAnimPhase <= current->m_upper) {
|
||||
m_userState = current->m_userState;
|
||||
m_kickState = current->m_kickState;
|
||||
}
|
||||
current = ¤t[1];
|
||||
}
|
||||
|
||||
if (m_userState != LEGORACECAR_KICK1 && m_userState != LEGORACECAR_KICK2) {
|
||||
if (m_kickState != LEGORACECAR_KICK1 && m_kickState != LEGORACECAR_KICK2) {
|
||||
MxTrace(
|
||||
// STRING: BETA10 0x101f64c8
|
||||
"Got kicked in boundary %s %d %g:%g %g\n",
|
||||
@@ -397,14 +397,14 @@ MxU32 LegoRaceCar::HandleSkeletonKicks(float p_param1)
|
||||
// FUNCTION: BETA10 0x100cb88a
|
||||
void LegoRaceCar::Animate(float p_time)
|
||||
{
|
||||
if (m_userNavFlag && (m_userState == LEGORACECAR_KICK1 || m_userState == LEGORACECAR_KICK2)) {
|
||||
if (m_userNavFlag && (m_kickState == LEGORACECAR_KICK1 || m_kickState == LEGORACECAR_KICK2)) {
|
||||
KickCamera(p_time);
|
||||
return;
|
||||
}
|
||||
|
||||
LegoCarRaceActor::Animate(p_time);
|
||||
|
||||
if (m_userNavFlag && m_userState == LEGORACECAR_UNKNOWN_1) {
|
||||
if (m_userNavFlag && m_kickState == LEGORACECAR_NEAR_SKELETON) {
|
||||
if (HandleSkeletonKicks(p_time)) {
|
||||
return;
|
||||
}
|
||||
@@ -539,23 +539,23 @@ MxResult LegoRaceCar::VTable0x9c()
|
||||
result = LegoCarRaceActor::VTable0x9c();
|
||||
|
||||
if (m_boundary) {
|
||||
MxS32 bVar2 = 0;
|
||||
MxS32 onSkeletonBoundary = FALSE;
|
||||
|
||||
for (MxS32 i = 0; i < sizeOfArray(g_skBMap); i++) {
|
||||
assert(g_skBMap[i].m_b);
|
||||
if (m_boundary == g_skBMap[i].m_b) {
|
||||
bVar2 = 1;
|
||||
onSkeletonBoundary = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_userState == LEGORACECAR_UNKNOWN_1) {
|
||||
if (!bVar2) {
|
||||
m_userState = LEGORACECAR_UNKNOWN_0;
|
||||
if (m_kickState == LEGORACECAR_NEAR_SKELETON) {
|
||||
if (!onSkeletonBoundary) {
|
||||
m_kickState = LEGORACECAR_NONE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_userState = LEGORACECAR_UNKNOWN_1;
|
||||
m_kickState = LEGORACECAR_NEAR_SKELETON;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -591,7 +591,7 @@ void LegoJetski::SetWorldSpeed(MxFloat p_worldSpeed)
|
||||
|
||||
// FUNCTION: LEGO1 0x100136f0
|
||||
// FUNCTION: BETA10 0x100cc01a
|
||||
void LegoJetski::FUN_100136f0(float p_worldSpeed)
|
||||
void LegoJetski::SetMaxLinearVelocity(float p_worldSpeed)
|
||||
{
|
||||
if (p_worldSpeed < 0) {
|
||||
LegoCarRaceActor::m_animState = 2;
|
||||
|
||||
Reference in New Issue
Block a user