More improvements

This commit is contained in:
jonschz 2024-12-21 11:55:36 +01:00
parent 35f590e7dd
commit 4278869ec9
2 changed files with 15 additions and 8 deletions

View File

@ -386,9 +386,7 @@ void Helicopter::VTable0x74(Matrix4& p_transform)
// FUNCTION: LEGO1 0x10003ee0 // FUNCTION: LEGO1 0x10003ee0
void Helicopter::Animate(float p_time) void Helicopter::Animate(float p_time)
{ {
MxU32 state = m_state->GetUnkown8(); if (m_state->m_unk0x08 == 4 || m_state->m_unk0x08 == 5) {
if (state == 4 || state == 5) {
float f = m_unk0x1f0 - p_time + 3000; float f = m_unk0x1f0 - p_time + 3000;
if (f >= 0) { if (f >= 0) {
float f2 = f / -3000.0f + 1; float f2 = f / -3000.0f + 1;
@ -398,21 +396,23 @@ void Helicopter::Animate(float p_time)
if (1.0f < f2) { if (1.0f < f2) {
f2 = 1.0f; f2 = 1.0f;
} }
MxMatrix mat; MxMatrix mat;
Vector3 v(m_unk0x160[3]); Vector3 v(m_unk0x160[3]);
Vector3 v2(m_unk0x1a8[3]); Vector3 v2(mat[3]); // likely correct according to stackcmp
float* loc = m_unk0x1a8[3]; // float* loc = m_unk0x1a8[0]; // this looks more correct, but it mixes up the registers. Re-enable later
mat.SetIdentity(); mat.SetIdentity();
m_unk0x1f4.BETA_1004aaa0(mat, f2); m_unk0x1f4.BETA_1004aaa0(mat, f2);
v2.SetVector(loc); // v2 = loc;
v2 = m_unk0x1a8[0];
v2 -= v; v2 -= v;
v2 *= f2; v2 *= f2;
v2 += v; v2 += v;
m_world->GetCamera()->FUN_100123e0(mat, 0); m_world->GetCamera()->FUN_100123e0(mat, 0);
} }
else { else {
if (state == 4) { if (m_state->m_unk0x08 == 4) {
((Act3*) m_world)->FUN_10073400(); ((Act3*) m_world)->FUN_10073400();
} }
else { else {
@ -421,7 +421,8 @@ void Helicopter::Animate(float p_time)
LegoPathActor::m_actorState = c_disabled; LegoPathActor::m_actorState = c_disabled;
} }
} else { }
else {
LegoPathActor::Animate(p_time); LegoPathActor::Animate(p_time);
} }
} }

View File

@ -183,6 +183,12 @@ class Vector2 {
return *this; return *this;
} }
Vector2& operator=(float* p_other)
{
Vector2::EqualsImpl(p_other);
return *this;
}
// FUNCTION: BETA10 0x1001d140 // FUNCTION: BETA10 0x1001d140
float& operator[](int idx) { return m_data[idx]; } float& operator[](int idx) { return m_data[idx]; }