WIP fixes

This commit is contained in:
Christian Semmler 2024-03-30 09:26:47 -04:00
parent c06b98c86d
commit 33601a2818
5 changed files with 31 additions and 16 deletions

View File

@ -34,7 +34,7 @@ class LegoCacheSound : public MxCore {
inline const undefined GetUnk0x58() const { return m_unk0x58; } inline const undefined GetUnk0x58() const { return m_unk0x58; }
LegoCacheSound* FUN_10006960(); LegoCacheSound* FUN_10006960();
MxResult FUN_10006a30(char* p_str, MxBool); MxResult FUN_10006a30(const char* p_str, MxBool);
void FUN_10006b80(); void FUN_10006b80();
void FUN_10006be0(); void FUN_10006be0();

View File

@ -54,8 +54,8 @@ class LegoUnknown100d6b4c {
LegoCacheSound* FUN_1003d170(const char* p_key); LegoCacheSound* FUN_1003d170(const char* p_key);
LegoCacheSound* FUN_1003d290(LegoCacheSound* p_sound); LegoCacheSound* FUN_1003d290(LegoCacheSound* p_sound);
void FUN_1003dae0(char* p_one, char* p_two, MxBool p_three); void FUN_1003dae0(const char* p_one, const char* p_two, MxBool p_three);
LegoCacheSound* FUN_1003db10(LegoCacheSound* p_one, char* p_two, MxBool p_three); LegoCacheSound* FUN_1003db10(LegoCacheSound* p_one, const char* p_two, MxBool p_three);
void FUN_1003dc40(LegoCacheSound** p_und); void FUN_1003dc40(LegoCacheSound** p_und);
private: private:

View File

@ -76,7 +76,7 @@ LegoCacheSound* LegoCacheSound::FUN_10006960()
} }
// STUB: LEGO1 0x10006a30 // STUB: LEGO1 0x10006a30
MxResult LegoCacheSound::FUN_10006a30(char* p_str, MxBool) MxResult LegoCacheSound::FUN_10006a30(const char* p_str, MxBool)
{ {
// TODO // TODO
// gets param2 from FUN_1003db10 // gets param2 from FUN_1003db10

View File

@ -104,14 +104,14 @@ LegoCacheSound* LegoUnknown100d6b4c::FUN_1003d290(LegoCacheSound* p_sound)
} }
// FUNCTION: LEGO1 0x1003dae0 // FUNCTION: LEGO1 0x1003dae0
void LegoUnknown100d6b4c::FUN_1003dae0(char* p_one, char* p_two, MxBool p_three) void LegoUnknown100d6b4c::FUN_1003dae0(const char* p_one, const char* p_two, MxBool p_three)
{ {
// DECOMP: Second parameter is 0xe4 member of LegoPathActor subclass // DECOMP: Second parameter is 0xe4 member of LegoPathActor subclass
FUN_1003db10(FUN_1003d170(p_one), p_two, p_three); FUN_1003db10(FUN_1003d170(p_one), p_two, p_three);
} }
// FUNCTION: LEGO1 0x1003db10 // FUNCTION: LEGO1 0x1003db10
LegoCacheSound* LegoUnknown100d6b4c::FUN_1003db10(LegoCacheSound* p_one, char* p_two, MxBool p_three) LegoCacheSound* LegoUnknown100d6b4c::FUN_1003db10(LegoCacheSound* p_one, const char* p_two, MxBool p_three)
{ {
if (!p_one) { if (!p_one) {
return NULL; return NULL;

View File

@ -152,25 +152,30 @@ MxResult LegoExtraActor::FUN_1002aae0()
inline void LegoExtraActor::FUN_1002ad8a() inline void LegoExtraActor::FUN_1002ad8a()
{ {
LegoWorld* w = CurrentWorld(); LegoWorld* w = CurrentWorld();
if (g_unk0x100f31d0 != w) { if (g_unk0x100f31d0 != w) {
g_unk0x100f31d0 = w; g_unk0x100f31d0 = w;
m_assAnimP = (LegoAnimPresenter*) w->Find("LegoAnimPresenter", "BNsAss01"); m_assAnimP = (LegoAnimPresenter*) w->Find("LegoAnimPresenter", "BNsAss01");
m_disAnimP = (LegoAnimPresenter*) w->Find("LegoAnimPresenter", "BNsDis01"); m_disAnimP = (LegoAnimPresenter*) w->Find("LegoAnimPresenter", "BNsDis01");
} }
if (!m_assAnim) { if (!m_assAnim) {
int index = 0; MxS32 index = 0;
m_assAnimP->FUN_1006d680(this, -20.0f); m_assAnimP->FUN_1006d680(this, -20.0f);
for (int i = 0; i < m_animMaps.size(); i++) {
for (MxS32 i = 0; i < m_animMaps.size(); i++) {
if (m_animMaps[i]->GetUnknown0x00() == -20.0f) { if (m_animMaps[i]->GetUnknown0x00() == -20.0f) {
m_assAnim = new LegoAnimActorStruct(*m_animMaps[i]); m_assAnim = new LegoAnimActorStruct(*m_animMaps[i]);
break; break;
} }
} }
} }
if (!m_disAnim) { if (!m_disAnim) {
int index = 0; MxS32 index = 0;
m_disAnimP->FUN_1006d680(this, -21.0f); m_disAnimP->FUN_1006d680(this, -21.0f);
for (int i = 0; i < m_animMaps.size(); i++) {
for (MxS32 i = 0; i < m_animMaps.size(); i++) {
if (m_animMaps[i]->GetUnknown0x00() == -21.0f) { if (m_animMaps[i]->GetUnknown0x00() == -21.0f) {
m_disAnim = new LegoAnimActorStruct(*m_animMaps[i]); m_disAnim = new LegoAnimActorStruct(*m_animMaps[i]);
break; break;
@ -195,26 +200,32 @@ MxResult LegoExtraActor::VTable0x94(LegoPathActor* p_actor, MxBool p_bool)
} }
else { else {
MxU32 b = FALSE; MxU32 b = FALSE;
if (++g_unk0x100f31dc % 2 == 0) { if (++g_unk0x100f31dc % 2 == 0) {
MxMatrix matrix(p_actor->GetROI()->GetLocal2World()); MxMatrix matrix(p_actor->GetROI()->GetLocal2World());
MxMatrix matrix2(m_roi->GetLocal2World()); MxMatrix matrix2(m_roi->GetLocal2World());
m_unk0x18 = matrix2; m_unk0x18 = matrix2;
Vector3 positionRef(matrix2[3]); Vector3 positionRef(matrix2[3]);
Mx3DPointFloat dir(matrix[2]); Mx3DPointFloat dir(matrix[2]);
((Mx3DPointFloat&) dir).Mul(2.0f); ((Mx3DPointFloat&) dir).Mul(2.0f);
((Vector3&) positionRef).Add(&dir); ((Vector3&) positionRef).Add(&dir);
for (int i = 0; i < m_boundary->GetNumEdges(); i++) {
for (MxS32 i = 0; i < m_boundary->GetNumEdges(); i++) {
Mx4DPointFloat* normal = m_boundary->GetEdgeNormal(i); Mx4DPointFloat* normal = m_boundary->GetEdgeNormal(i);
if (positionRef.Dot(normal, &positionRef) + (*normal)[3] < -0.001) { if (positionRef.Dot(normal, &positionRef) + (*normal)[3] < -0.001) {
b = TRUE; b = TRUE;
break; break;
} }
} }
if (!b) { if (!b) {
m_roi->FUN_100a58f0(matrix2); m_roi->FUN_100a58f0(matrix2);
m_roi->VTable0x14(); m_roi->VTable0x14();
FUN_1002ad8a(); FUN_1002ad8a();
SoundManager()->GetUnknown0x40()->FUN_1003dae0("crash5", (char*) m_roi->GetName(), FALSE); SoundManager()->GetUnknown0x40()->FUN_1003dae0("crash5", m_roi->GetName(), FALSE);
m_scheduledTime = Timer()->GetTime() + m_disAnim->GetDuration(); m_scheduledTime = Timer()->GetTime() + m_disAnim->GetDuration();
m_unk0x10 = m_worldSpeed; m_unk0x10 = m_worldSpeed;
VTable0xc4(); VTable0xc4();
@ -223,9 +234,10 @@ MxResult LegoExtraActor::VTable0x94(LegoPathActor* p_actor, MxBool p_bool)
m_state = 0x101; m_state = 0x101;
} }
} }
if (b) { if (b) {
LegoROI* roi = m_roi; LegoROI* roi = m_roi;
SoundManager()->GetUnknown0x40()->FUN_1003dae0("crash5", (char*) m_roi->GetName(), FALSE); SoundManager()->GetUnknown0x40()->FUN_1003dae0("crash5", m_roi->GetName(), FALSE);
VTable0xc4(); VTable0xc4();
m_state = 0x102; m_state = 0x102;
Mx3DPointFloat dir = p_actor->GetWorldDirection(); Mx3DPointFloat dir = p_actor->GetWorldDirection();
@ -233,27 +245,30 @@ MxResult LegoExtraActor::VTable0x94(LegoPathActor* p_actor, MxBool p_bool)
Vector3 positionRef(matrix3[3]); Vector3 positionRef(matrix3[3]);
((Vector3&) positionRef).Add(&g_unk0x10104c18); ((Vector3&) positionRef).Add(&g_unk0x10104c18);
roi->FUN_100a58f0(matrix3); roi->FUN_100a58f0(matrix3);
#ifdef COMPAT_MODE #ifdef COMPAT_MODE
float dot; float dot;
float dot2; double dot2;
{ {
Mx3DPointFloat tmp(1.0f, 0, 0); Mx3DPointFloat tmp(1.0f, 0, 0);
dot = dir.Dot(&dir, &tmp); dot = dir.Dot(&dir, &tmp);
Mx3DPointFloat tmp2(1.0f, 0, 0); Mx3DPointFloat tmp2(1.0f, 0, 0);
double dot2 = dir.Dot(&dir, &tmp2); dot2 = dir.Dot(&dir, &tmp2);
} }
#else #else
float dot = dir.Dot(&dir, &Mx3DPointFloat(1.0f, 0, 0)); float dot = dir.Dot(&dir, &Mx3DPointFloat(1.0f, 0, 0));
double dot2 = dir.Dot(&dir, &Mx3DPointFloat(0, 0, 1.0f)); double dot2 = dir.Dot(&dir, &Mx3DPointFloat(0, 0, 1.0f));
#endif #endif
double dot3 = dot; double dot3 = dot;
if (abs(dot2) < abs(dot3)) { if (abs(dot2) > abs(dot3)) {
m_axis = dot3 > 0.0 ? e_posz : e_negz; m_axis = dot3 > 0.0 ? e_posz : e_negz;
} }
else { else {
m_axis = dot2 > 0.0 ? e_posx : e_negx; m_axis = dot2 > 0.0 ? e_posx : e_negx;
} }
} }
return SUCCESS; return SUCCESS;
} }
} }