Begin work on Police class

This commit is contained in:
Joshua Peisach 2024-01-20 14:38:28 -05:00
parent 961282e3c6
commit bf027b8930
No known key found for this signature in database
GPG Key ID: 41C3D4189AFEDB5A
2 changed files with 64 additions and 4 deletions

View File

@ -1,7 +1,11 @@
#ifndef POLICE_H #ifndef POLICE_H
#define POLICE_H #define POLICE_H
#include "decomp.h"
#include "legoworld.h" #include "legoworld.h"
#include "mxdsaction.h"
#include "policestate.h"
#include "radio.h"
// VTABLE: LEGO1 0x100d8a80 // VTABLE: LEGO1 0x100d8a80
// SIZE 0x110 // SIZE 0x110
@ -28,6 +32,14 @@ class Police : public LegoWorld {
// SYNTHETIC: LEGO1 0x1005e300 // SYNTHETIC: LEGO1 0x1005e300
// Police::`scalar deleting destructor' // Police::`scalar deleting destructor'
virtual MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual void VTable0x50() override;
private:
Radio m_radio; // 0xf8
PoliceState* m_policeState; // 0x108
undefined4 m_unk0x10c; // 0x10c
}; };
#endif // POLICE_H #endif // POLICE_H

View File

@ -1,15 +1,55 @@
#include "police.h" #include "police.h"
// STUB: LEGO1 0x1005e130 #include "legocontrolmanager.h"
#include "legogamestate.h"
#include "legoinputmanager.h"
#include "legoomni.h"
#include "mxnotificationmanager.h"
#include "mxomni.h"
DECOMP_SIZE_ASSERT(Police, 0x110)
// FUNCTION: LEGO1 0x1005e130
Police::Police() Police::Police()
{ {
// TODO this->m_policeState = NULL;
this->m_unk0x10c = 0;
NotificationManager()->Register(this);
} }
// STUB: LEGO1 0x1005e320 // FUNCTION: LEGO1 0x1005e320
Police::~Police() Police::~Police()
{ {
// TODO if (InputManager()->GetWorld() == this) {
InputManager()->ClearWorld();
}
ControlManager()->Unregister(this);
InputManager()->UnRegister(this);
NotificationManager()->Unregister(this);
}
// FUNCTION: LEGO1 0x1005e3e0
MxResult Police::Create(MxDSAction& p_dsAction)
{
MxResult ret = LegoWorld::Create(p_dsAction);
if (ret == SUCCESS) {
InputManager()->SetWorld(this);
ControlManager()->Register(this);
}
SetIsWorldActive(FALSE);
InputManager()->Register(this);
LegoGameState* gs = GameState();
PoliceState* p = (PoliceState*) gs->GetState("PoliceState");
if (!p) {
p = (PoliceState*) gs->CreateState("PoliceState");
}
this->m_policeState = p;
GameState()->SetUnknown424(0x22);
GameState()->FUN_1003a720(0);
return ret;
} }
// STUB: LEGO1 0x1005e480 // STUB: LEGO1 0x1005e480
@ -19,3 +59,11 @@ MxLong Police::Notify(MxParam& p_param)
return 0; return 0;
} }
// FUNCTION: LEGO1 0x1005e530
void Police::VTable0x50()
{
LegoWorld::VTable0x50();
PlayMusic(0xc);
FUN_10015820(0, 7);
}