Implement/match Act3Shark functions (#1208)

* Implement/match `Act3Shark` functions

* Naming
This commit is contained in:
Christian Semmler 2024-12-11 13:13:34 -07:00 committed by GitHub
parent a2b2b5d734
commit ac19539d0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 77 additions and 19 deletions

View file

@ -110,6 +110,7 @@ class Act3 : public LegoWorld {
void Enable(MxBool p_enable) override; // vtable+0x68
void SetHelicopter(Helicopter* p_copter) { m_copter = p_copter; }
void SetShark(Act3Shark* p_shark) { m_shark = p_shark; }
void SetDestLocation(LegoGameState::Area p_destLocation) { m_destLocation = p_destLocation; }
// SYNTHETIC: LEGO1 0x10072630

View file

@ -14,7 +14,8 @@ class Act3Ammo : public LegoPathActor {
c_pizza = 0x01,
c_donut = 0x02,
c_valid = 0x04,
c_bit4 = 0x08
c_bit4 = 0x08,
c_bit5 = 0x10
};
Act3Ammo();
@ -57,6 +58,16 @@ class Act3Ammo : public LegoPathActor {
}
}
void SetBit5(MxBool p_bit5)
{
if (p_bit5) {
m_ammoFlag |= c_bit5;
}
else {
m_ammoFlag &= ~c_bit5;
}
}
MxFloat GetUnknown0x158() { return m_unk0x158; }
void SetUnknown0x158(MxFloat p_unk0x158) { m_unk0x158 = p_unk0x158; }

View file

@ -3,6 +3,9 @@
#include "legoanimactor.h"
class Act3;
class Act3Ammo;
// VTABLE: LEGO1 0x100d7920 LegoPathActor
// VTABLE: LEGO1 0x100d79f0 LegoAnimActor
// SIZE 0x1a8
@ -21,7 +24,7 @@ class Act3Shark : public LegoAnimActor {
void VTable0x70(float p_time) override; // vtable+0x70
// LegoAnimActor vtable
virtual MxResult FUN_10042ce0(void*); // vtable+0x10
virtual MxResult FUN_10042ce0(Act3Ammo* p_ammo); // vtable+0x10
MxFloat GetUnknown0x2c() { return m_unk0x2c; }
@ -31,16 +34,22 @@ class Act3Shark : public LegoAnimActor {
// Act3Shark::`scalar deleting destructor'
private:
list<void*> m_unk0x1c; // 0x1c
list<Act3Ammo*> m_unk0x1c; // 0x1c
undefined4 m_unk0x28; // 0x28
MxFloat m_unk0x2c; // 0x2c
undefined m_unk0x30[0x0c]; // 0x30
Act3* m_a3; // 0x30
LegoAnimActorStruct* m_unk0x34; // 0x34
LegoROI* m_unk0x38; // 0x38
Mx3DPointFloat m_unk0x3c; // 0x3c
};
// STUB: LEGO1 0x10042c90
// List<void *>::~List<void *>
// TODO: Update once type is known.
// STUB to resolve diff in scalar dtor and not create a new one.
// TEMPLATE: LEGO1 0x10042c20
// list<Act3Ammo *,allocator<Act3Ammo *> >::~list<Act3Ammo *,allocator<Act3Ammo *> >
// TEMPLATE: LEGO1 0x10042c90
// List<Act3Ammo *>::~List<Act3Ammo *>
// GLOBAL: LEGO1 0x100d7918
// Act3Shark::`vbtable'
#endif // ACT3SHARK_H

View file

@ -1,17 +1,26 @@
#include "act3shark.h"
#include "act3.h"
#include "act3ammo.h"
#include "define.h"
#include "legolocomotionanimpresenter.h"
#include "misc.h"
#include "mxutilities.h"
DECOMP_SIZE_ASSERT(Act3Shark, 0x1a8)
// STUB: LEGO1 0x10042ab0
// FUNCTION: LEGO1 0x10042ab0
Act3Shark::Act3Shark()
{
// TODO
m_unk0x2c = 0.0f;
m_unk0x28 = 0;
}
// STUB: LEGO1 0x10042ce0
MxResult Act3Shark::FUN_10042ce0(void*)
// FUNCTION: LEGO1 0x10042ce0
MxResult Act3Shark::FUN_10042ce0(Act3Ammo* p_ammo)
{
// TODO
p_ammo->SetBit5(TRUE);
m_unk0x1c.push_back(p_ammo);
return SUCCESS;
}
@ -21,8 +30,36 @@ void Act3Shark::VTable0x70(float p_time)
// TODO
}
// STUB: LEGO1 0x10042f30
void Act3Shark::ParseAction(char*)
// FUNCTION: LEGO1 0x10042f30
void Act3Shark::ParseAction(char* p_extra)
{
// TODO
LegoPathActor::ParseAction(p_extra);
m_a3 = (Act3*) CurrentWorld();
char value[256];
if (KeyValueStringParse(value, g_strANIMATION, p_extra)) {
char* token = strtok(value, g_parseExtraTokens);
while (token != NULL) {
LegoLocomotionAnimPresenter* presenter =
(LegoLocomotionAnimPresenter*) m_a3->Find("LegoAnimPresenter", token);
if (presenter != NULL) {
token = strtok(NULL, g_parseExtraTokens);
if (token != NULL) {
presenter->FUN_1006d680(this, atof(token));
}
}
token = strtok(NULL, g_parseExtraTokens);
}
}
m_a3->SetShark(this);
m_unk0x34 = m_animMaps[0];
m_unk0x38 = m_unk0x34->m_roiMap[1];
m_unk0x38->SetVisibility(FALSE);
m_a3->PlaceActor(this);
}