mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-18 05:51:15 +00:00
Clear unknowns in LegoExtraActor (#1718)
Some checks are pending
Analyze / ${{ matrix.who }} annotations (CONFIG) (push) Waiting to run
Analyze / ${{ matrix.who }} annotations (ISLE) (push) Waiting to run
Analyze / ${{ matrix.who }} annotations (LEGO1) (push) Waiting to run
Build / Download original binaries (push) Waiting to run
Build / Current ${{ matrix.toolchain.name }} (map[clang-tidy:true msys-env:mingw-w64-i686 msystem:mingw32 name:msys2 mingw32 shell:msys2 {0} werror:true]) (push) Waiting to run
Build / Current ${{ matrix.toolchain.name }} (map[name:MSVC setup-cmake:true setup-msvc:true setup-ninja:true shell:sh]) (push) Waiting to run
Build / MSVC 4.20 (push) Waiting to run
Build / MSVC 4.20 (BETA10) (push) Waiting to run
Build / Verify decomp (push) Blocked by required conditions
Build / Upload artifacts (push) Blocked by required conditions
Format / C++ (push) Waiting to run
Naming / C++ (push) Waiting to run
Some checks are pending
Analyze / ${{ matrix.who }} annotations (CONFIG) (push) Waiting to run
Analyze / ${{ matrix.who }} annotations (ISLE) (push) Waiting to run
Analyze / ${{ matrix.who }} annotations (LEGO1) (push) Waiting to run
Build / Download original binaries (push) Waiting to run
Build / Current ${{ matrix.toolchain.name }} (map[clang-tidy:true msys-env:mingw-w64-i686 msystem:mingw32 name:msys2 mingw32 shell:msys2 {0} werror:true]) (push) Waiting to run
Build / Current ${{ matrix.toolchain.name }} (map[name:MSVC setup-cmake:true setup-msvc:true setup-ninja:true shell:sh]) (push) Waiting to run
Build / MSVC 4.20 (push) Waiting to run
Build / MSVC 4.20 (BETA10) (push) Waiting to run
Build / Verify decomp (push) Blocked by required conditions
Build / Upload artifacts (push) Blocked by required conditions
Format / C++ (push) Waiting to run
Naming / C++ (push) Waiting to run
This commit is contained in:
parent
faa4e45e48
commit
dace101b85
@ -54,10 +54,10 @@ class LegoExtraActor : public virtual LegoAnimActor {
|
|||||||
void VTable0xa4(MxBool& p_und1, MxS32& p_und2) override; // vtable+0xa4
|
void VTable0xa4(MxBool& p_und1, MxS32& p_und2) override; // vtable+0xa4
|
||||||
void VTable0xc4() override; // vtable+0xc4
|
void VTable0xc4() override; // vtable+0xc4
|
||||||
|
|
||||||
virtual MxResult FUN_1002aae0();
|
virtual MxResult SwitchDirection();
|
||||||
|
|
||||||
void Restart();
|
void Restart();
|
||||||
inline void FUN_1002ad8a();
|
inline void InitializeReassemblyAnim();
|
||||||
|
|
||||||
void SetUnknown0x0c(undefined p_unk0x0c) { m_unk0x0c = p_unk0x0c; }
|
void SetUnknown0x0c(undefined p_unk0x0c) { m_unk0x0c = p_unk0x0c; }
|
||||||
|
|
||||||
@ -65,16 +65,22 @@ class LegoExtraActor : public virtual LegoAnimActor {
|
|||||||
// LegoExtraActor::`scalar deleting destructor'
|
// LegoExtraActor::`scalar deleting destructor'
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MxFloat m_scheduledTime; // 0x08
|
enum {
|
||||||
undefined m_unk0x0c; // 0x0c
|
e_none = 0,
|
||||||
MxU8 m_axis; // 0x0d
|
e_disassemble = 1,
|
||||||
undefined m_unk0x0e; // 0x0e
|
e_assemble = 2,
|
||||||
MxFloat m_prevWorldSpeed; // 0x10
|
};
|
||||||
MxU8 m_whichAnim; // 0x14
|
|
||||||
MxU8 m_unk0x15; // 0x15
|
MxFloat m_scheduledTime; // 0x08
|
||||||
MxMatrix m_unk0x18; // 0x18
|
undefined m_unk0x0c; // 0x0c
|
||||||
LegoAnimActorStruct* m_assAnim; // 0x60
|
MxU8 m_axis; // 0x0d
|
||||||
LegoAnimActorStruct* m_disAnim; // 0x64
|
MxBool m_animationAtCurrentBoundary; // 0x0e
|
||||||
|
MxFloat m_prevWorldSpeed; // 0x10
|
||||||
|
MxU8 m_reassemblyAnimation; // 0x14
|
||||||
|
MxU8 m_hitBlockCounter; // 0x15
|
||||||
|
MxMatrix m_localBeforeHit; // 0x18
|
||||||
|
LegoAnimActorStruct* m_assAnim; // 0x60
|
||||||
|
LegoAnimActorStruct* m_disAnim; // 0x64
|
||||||
};
|
};
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100d6be8
|
// GLOBAL: LEGO1 0x100d6be8
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
DECOMP_SIZE_ASSERT(LegoExtraActor, 0x1dc)
|
DECOMP_SIZE_ASSERT(LegoExtraActor, 0x1dc)
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f31d0
|
// GLOBAL: LEGO1 0x100f31d0
|
||||||
LegoWorld* g_unk0x100f31d0 = NULL;
|
LegoWorld* g_reassemblyAnimWorld = NULL;
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f31d4
|
// GLOBAL: LEGO1 0x100f31d4
|
||||||
LegoLocomotionAnimPresenter* m_assAnimP = NULL;
|
LegoLocomotionAnimPresenter* m_assAnimP = NULL;
|
||||||
@ -21,7 +21,7 @@ LegoLocomotionAnimPresenter* m_assAnimP = NULL;
|
|||||||
LegoLocomotionAnimPresenter* m_disAnimP = NULL;
|
LegoLocomotionAnimPresenter* m_disAnimP = NULL;
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f31dc
|
// GLOBAL: LEGO1 0x100f31dc
|
||||||
MxS32 g_unk0x100f31dc = 0;
|
MxS32 g_hitCounter = 0;
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x10104c18
|
// GLOBAL: LEGO1 0x10104c18
|
||||||
Mx3DPointFloat g_unk0x10104c18 = Mx3DPointFloat(0.0f, 2.5f, 0.0f);
|
Mx3DPointFloat g_unk0x10104c18 = Mx3DPointFloat(0.0f, 2.5f, 0.0f);
|
||||||
@ -33,11 +33,11 @@ LegoExtraActor::LegoExtraActor()
|
|||||||
m_lastPathStruct = 0.0f;
|
m_lastPathStruct = 0.0f;
|
||||||
m_scheduledTime = 0;
|
m_scheduledTime = 0;
|
||||||
m_unk0x0c = 0;
|
m_unk0x0c = 0;
|
||||||
m_unk0x0e = 0;
|
m_animationAtCurrentBoundary = FALSE;
|
||||||
m_whichAnim = 0;
|
m_reassemblyAnimation = e_none;
|
||||||
m_assAnim = NULL;
|
m_assAnim = NULL;
|
||||||
m_disAnim = NULL;
|
m_disAnim = NULL;
|
||||||
m_unk0x15 = 0;
|
m_hitBlockCounter = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002a6b0
|
// FUNCTION: LEGO1 0x1002a6b0
|
||||||
@ -128,7 +128,7 @@ void LegoExtraActor::VTable0xa4(MxBool& p_und1, MxS32& p_und2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002aae0
|
// FUNCTION: LEGO1 0x1002aae0
|
||||||
MxResult LegoExtraActor::FUN_1002aae0()
|
MxResult LegoExtraActor::SwitchDirection()
|
||||||
{
|
{
|
||||||
LegoPathBoundary* oldEdge = m_boundary;
|
LegoPathBoundary* oldEdge = m_boundary;
|
||||||
Vector3 rightRef(m_unk0xec[0]);
|
Vector3 rightRef(m_unk0xec[0]);
|
||||||
@ -154,12 +154,12 @@ MxResult LegoExtraActor::FUN_1002aae0()
|
|||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void LegoExtraActor::FUN_1002ad8a()
|
inline void LegoExtraActor::InitializeReassemblyAnim()
|
||||||
{
|
{
|
||||||
LegoWorld* w = CurrentWorld();
|
LegoWorld* w = CurrentWorld();
|
||||||
|
|
||||||
if (g_unk0x100f31d0 != w) {
|
if (g_reassemblyAnimWorld != w) {
|
||||||
g_unk0x100f31d0 = w;
|
g_reassemblyAnimWorld = w;
|
||||||
m_assAnimP = (LegoLocomotionAnimPresenter*) w->Find("LegoAnimPresenter", "BNsAss01");
|
m_assAnimP = (LegoLocomotionAnimPresenter*) w->Find("LegoAnimPresenter", "BNsAss01");
|
||||||
m_disAnimP = (LegoLocomotionAnimPresenter*) w->Find("LegoAnimPresenter", "BNsDis01");
|
m_disAnimP = (LegoLocomotionAnimPresenter*) w->Find("LegoAnimPresenter", "BNsDis01");
|
||||||
}
|
}
|
||||||
@ -198,26 +198,26 @@ MxResult LegoExtraActor::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (p_bool) {
|
if (p_bool) {
|
||||||
if (m_unk0x15 != 0) {
|
if (m_hitBlockCounter != 0) {
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_unk0x15 = 100;
|
m_hitBlockCounter = 100;
|
||||||
FUN_1002aae0();
|
SwitchDirection();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
MxU32 b = FALSE;
|
MxU32 b = FALSE;
|
||||||
|
|
||||||
if (++g_unk0x100f31dc % 2 == 0) {
|
if (++g_hitCounter % 2 == 0) {
|
||||||
MxMatrix matrix(p_actor->GetROI()->GetLocal2World());
|
MxMatrix otherActorLocal(p_actor->GetROI()->GetLocal2World());
|
||||||
MxMatrix matrix2(m_roi->GetLocal2World());
|
MxMatrix local(m_roi->GetLocal2World());
|
||||||
|
|
||||||
m_unk0x18 = matrix2;
|
m_localBeforeHit = local;
|
||||||
Vector3 positionRef(matrix2[3]);
|
Vector3 positionRef(local[3]);
|
||||||
Mx3DPointFloat dir(matrix[2]);
|
Mx3DPointFloat otherActorDir(otherActorLocal[2]);
|
||||||
|
|
||||||
dir *= 2.0f;
|
otherActorDir *= 2.0f;
|
||||||
positionRef += dir;
|
positionRef += otherActorDir;
|
||||||
|
|
||||||
for (MxS32 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);
|
||||||
@ -229,9 +229,9 @@ MxResult LegoExtraActor::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!b) {
|
if (!b) {
|
||||||
m_roi->SetLocal2World(matrix2);
|
m_roi->SetLocal2World(local);
|
||||||
m_roi->WrappedUpdateWorldData();
|
m_roi->WrappedUpdateWorldData();
|
||||||
FUN_1002ad8a();
|
InitializeReassemblyAnim();
|
||||||
assert(m_roi);
|
assert(m_roi);
|
||||||
assert(SoundManager()->GetCacheSoundManager());
|
assert(SoundManager()->GetCacheSoundManager());
|
||||||
SoundManager()->GetCacheSoundManager()->Play("crash5", m_roi->GetName(), FALSE);
|
SoundManager()->GetCacheSoundManager()->Play("crash5", m_roi->GetName(), FALSE);
|
||||||
@ -239,7 +239,7 @@ MxResult LegoExtraActor::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
|||||||
m_prevWorldSpeed = GetWorldSpeed();
|
m_prevWorldSpeed = GetWorldSpeed();
|
||||||
VTable0xc4();
|
VTable0xc4();
|
||||||
SetWorldSpeed(0);
|
SetWorldSpeed(0);
|
||||||
m_whichAnim = 1;
|
m_reassemblyAnimation = e_disassemble;
|
||||||
SetActorState(c_one | c_noCollide);
|
SetActorState(c_one | c_noCollide);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -278,19 +278,19 @@ MxResult LegoExtraActor::VTable0x9c()
|
|||||||
MxResult result = LegoPathActor::VTable0x9c();
|
MxResult result = LegoPathActor::VTable0x9c();
|
||||||
|
|
||||||
if (m_boundary != oldBoundary) {
|
if (m_boundary != oldBoundary) {
|
||||||
MxU32 b = FALSE;
|
MxU32 foundAnimation = FALSE;
|
||||||
LegoAnimPresenterSet& presenters = m_boundary->GetPresenters();
|
LegoAnimPresenterSet& presenters = m_boundary->GetPresenters();
|
||||||
|
|
||||||
for (LegoAnimPresenterSet::iterator it = presenters.begin(); it != presenters.end(); it++) {
|
for (LegoAnimPresenterSet::iterator it = presenters.begin(); it != presenters.end(); it++) {
|
||||||
MxU32 roiMapSize;
|
MxU32 roiMapSize;
|
||||||
if ((*it)->GetROIMap(roiMapSize)) {
|
if ((*it)->GetROIMap(roiMapSize)) {
|
||||||
b = TRUE;
|
foundAnimation = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (b) {
|
if (foundAnimation) {
|
||||||
m_unk0x0e = 1;
|
m_animationAtCurrentBoundary = TRUE;
|
||||||
m_prevWorldSpeed = GetWorldSpeed();
|
m_prevWorldSpeed = GetWorldSpeed();
|
||||||
SetWorldSpeed(0);
|
SetWorldSpeed(0);
|
||||||
}
|
}
|
||||||
@ -302,21 +302,21 @@ MxResult LegoExtraActor::VTable0x9c()
|
|||||||
// FUNCTION: LEGO1 0x1002b370
|
// FUNCTION: LEGO1 0x1002b370
|
||||||
void LegoExtraActor::Restart()
|
void LegoExtraActor::Restart()
|
||||||
{
|
{
|
||||||
if (m_unk0x0e != 0) {
|
if (m_animationAtCurrentBoundary != 0) {
|
||||||
MxU32 b = FALSE;
|
MxU32 foundAnimation = FALSE;
|
||||||
LegoAnimPresenterSet& presenters = m_boundary->GetPresenters();
|
LegoAnimPresenterSet& presenters = m_boundary->GetPresenters();
|
||||||
|
|
||||||
for (LegoAnimPresenterSet::iterator it = presenters.begin(); it != presenters.end(); it++) {
|
for (LegoAnimPresenterSet::iterator it = presenters.begin(); it != presenters.end(); it++) {
|
||||||
MxU32 roiMapSize;
|
MxU32 roiMapSize;
|
||||||
if ((*it)->GetROIMap(roiMapSize)) {
|
if ((*it)->GetROIMap(roiMapSize)) {
|
||||||
b = TRUE;
|
foundAnimation = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!b) {
|
if (!foundAnimation) {
|
||||||
SetWorldSpeed(m_prevWorldSpeed);
|
SetWorldSpeed(m_prevWorldSpeed);
|
||||||
m_unk0x0e = 0;
|
m_animationAtCurrentBoundary = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -326,13 +326,13 @@ void LegoExtraActor::Animate(float p_time)
|
|||||||
{
|
{
|
||||||
LegoAnimActorStruct* laas = NULL;
|
LegoAnimActorStruct* laas = NULL;
|
||||||
|
|
||||||
switch (m_whichAnim) {
|
switch (m_reassemblyAnimation) {
|
||||||
case 0:
|
case e_none:
|
||||||
LegoAnimActor::Animate(p_time);
|
LegoAnimActor::Animate(p_time);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case e_disassemble:
|
||||||
if (m_scheduledTime < p_time) {
|
if (m_scheduledTime < p_time) {
|
||||||
m_whichAnim = 2;
|
m_reassemblyAnimation = e_assemble;
|
||||||
m_actorState = c_one | c_noCollide;
|
m_actorState = c_one | c_noCollide;
|
||||||
m_scheduledTime = m_assAnim->GetDuration() + p_time;
|
m_scheduledTime = m_assAnim->GetDuration() + p_time;
|
||||||
break;
|
break;
|
||||||
@ -341,12 +341,12 @@ void LegoExtraActor::Animate(float p_time)
|
|||||||
laas = m_disAnim;
|
laas = m_disAnim;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2:
|
case e_assemble:
|
||||||
if (m_scheduledTime < p_time) {
|
if (m_scheduledTime < p_time) {
|
||||||
m_whichAnim = 0;
|
m_reassemblyAnimation = e_none;
|
||||||
m_actorState = c_initial;
|
m_actorState = c_initial;
|
||||||
SetWorldSpeed(m_prevWorldSpeed);
|
SetWorldSpeed(m_prevWorldSpeed);
|
||||||
m_roi->SetLocal2World(m_unk0x18);
|
m_roi->SetLocal2World(m_localBeforeHit);
|
||||||
m_lastTime = p_time;
|
m_lastTime = p_time;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -381,7 +381,7 @@ void LegoExtraActor::Animate(float p_time)
|
|||||||
// FUNCTION: LEGO1 0x1002b5d0
|
// FUNCTION: LEGO1 0x1002b5d0
|
||||||
void LegoExtraActor::VTable0x74(Matrix4& p_transform)
|
void LegoExtraActor::VTable0x74(Matrix4& p_transform)
|
||||||
{
|
{
|
||||||
if (m_whichAnim == 0) {
|
if (m_reassemblyAnimation == e_none) {
|
||||||
LegoAnimActor::VTable0x74(p_transform);
|
LegoAnimActor::VTable0x74(p_transform);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -460,7 +460,7 @@ inline MxU32 LegoExtraActor::VTable0x6c(
|
|||||||
float local24 = p_v2.Dot(p_v2, local54) * 2.0f;
|
float local24 = p_v2.Dot(p_v2, local54) * 2.0f;
|
||||||
float local20 = local54.Dot(local54, local54);
|
float local20 = local54.Dot(local54, local54);
|
||||||
|
|
||||||
if (m_unk0x15 != 0 && local20 < 10.0f) {
|
if (m_hitBlockCounter != 0 && local20 < 10.0f) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -516,8 +516,8 @@ inline MxU32 LegoExtraActor::VTable0x6c(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_unk0x15 != 0) {
|
if (m_hitBlockCounter != 0) {
|
||||||
m_unk0x15--;
|
m_hitBlockCounter--;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user