Address review comments

This commit is contained in:
jonschz 2024-04-28 06:35:07 +02:00
parent b063c861e1
commit 3bc43ed121
4 changed files with 25 additions and 29 deletions

View File

@ -26,13 +26,10 @@ class LegoControlManagerEvent : public LegoEventNotificationParam {
inline void SetClickedAtom(const char* p_clickedAtom) { m_clickedAtom = p_clickedAtom; }
inline void SetUnknown0x28(MxS16 p_unk0x28) { m_unk0x28 = p_unk0x28; }
MxS32 m_clickedObjectId; // 0x20
private:
MxS32 m_clickedObjectId; // 0x20
const char* m_clickedAtom; // 0x24
public:
MxS16 m_unk0x28; // 0x28
MxS16 m_unk0x28; // 0x28
};
// SYNTHETIC: LEGO1 0x10028bf0

View File

@ -34,17 +34,15 @@ class Pizza : public IsleActor {
void FUN_100382b0();
void FUN_10038380();
inline void SetUnknown0x84(undefined* p_unk0x84) { m_unk0x84 = p_unk0x84; }
// SYNTHETIC: LEGO1 0x100380e0
// Pizza::`scalar deleting destructor'
private:
undefined4 m_unk0x7c; // 0x7c
undefined4 m_unk0x80; // 0x80
public:
undefined* m_unk0x84; // 0x84
private:
undefined4 m_unk0x88; // 0x88
undefined4 m_unk0x8c; // 0x8c
undefined4 m_unk0x90; // 0x90

View File

@ -36,12 +36,8 @@ class SkateBoard : public IslePathActor {
// SkateBoard::`scalar deleting destructor'
private:
// TODO: SkateBoard types
undefined m_unk0x160;
undefined m_unk0x161;
undefined m_unk0x162;
undefined m_unk0x163;
undefined* m_unk0x164;
undefined m_unk0x160; // 0x160
undefined* m_unk0x164; // 0x164
};
#endif // SKATEBOARD_H

View File

@ -1,6 +1,7 @@
#include "skateboard.h"
#include "decomp.h"
#include "isle_actions.h"
#include "legoutils.h"
#include "misc.h"
#include "mxmisc.h"
@ -12,10 +13,10 @@ DECOMP_SIZE_ASSERT(SkateBoard, 0x168)
// FUNCTION: LEGO1 0x1000fd40
SkateBoard::SkateBoard()
{
this->m_unk0x160 = 0;
this->m_unk0x13c = 15.0;
this->m_unk0x150 = 3.5;
this->m_unk0x148 = 1;
m_unk0x160 = 0;
m_unk0x13c = 15.0;
m_unk0x150 = 3.5;
m_unk0x148 = 1;
NotificationManager()->Register(this);
}
@ -31,15 +32,17 @@ SkateBoard::~SkateBoard()
MxResult SkateBoard::Create(MxDSAction& p_dsAction)
{
MxResult result = IslePathActor::Create(p_dsAction);
if (result == SUCCESS) {
this->m_world = CurrentWorld();
this->m_world->Add(this);
m_world = CurrentWorld();
m_world->Add(this);
// The type `Pizza` is an educated guesss, inferred from VTable0xe4() below
Pizza* findResult = (Pizza*) CurrentWorld()->Find(*g_isleScript, 0x49d);
Pizza* findResult = (Pizza*) CurrentWorld()->Find(*g_isleScript, IsleScript::c_Pizza_Actor);
if (findResult) {
findResult->m_unk0x84 = (undefined*) this;
findResult->SetUnknown0x84((undefined*) this);
}
}
return result;
}
@ -47,16 +50,16 @@ MxResult SkateBoard::Create(MxDSAction& p_dsAction)
void SkateBoard::VTable0xe4()
{
// TODO: Work out what kind of structure this points to
if (*(int*) (this->m_unk0x164 + 0x18) == 3) {
Pizza* pizza = (Pizza*) CurrentWorld()->Find(*g_isleScript, 0x49d);
if (*(int*) (m_unk0x164 + 0x18) == 3) {
Pizza* pizza = (Pizza*) CurrentWorld()->Find(*g_isleScript, IsleScript::c_Pizza_Actor);
pizza->FUN_10038380();
pizza->FUN_100382b0();
this->m_unk0x160 = 0;
m_unk0x160 = 0;
}
IslePathActor::VTable0xe4();
GameState()->m_currentArea = LegoGameState::Area::e_skateboard;
RemoveFromCurrentWorld(*g_isleScript, 0xc3);
RemoveFromCurrentWorld(*g_isleScript, 0xc2);
RemoveFromCurrentWorld(*g_isleScript, IsleScript::c_SkateArms_Ctl);
RemoveFromCurrentWorld(*g_isleScript, IsleScript::c_SkatePizza_Bitmap);
ControlManager()->Unregister(this);
}
@ -71,11 +74,13 @@ MxU32 SkateBoard::VTable0xcc()
MxU32 SkateBoard::VTable0xd4(LegoControlManagerEvent& p_param)
{
MxU32 result = 0;
if (p_param.m_unk0x28 == 1 && p_param.m_clickedObjectId == 0xc3) {
if (p_param.GetUnknown0x28() == 1 && p_param.GetClickedObjectId() == 0xc3) {
VTable0xe4();
GameState()->m_currentArea = LegoGameState::Area::e_unk66;
result = 1;
}
return result;
}