Implement Police::Notify (#524)

* Implement Police::Notify

* Fix HandleKeyPress

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
Joshua Peisach 2024-02-03 16:30:00 -05:00 committed by GitHub
parent e68e25275f
commit 724cdeb86f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 52 additions and 10 deletions

View file

@ -40,9 +40,13 @@ public:
// Police::`scalar deleting destructor' // Police::`scalar deleting destructor'
private: private:
MxLong HandleNotification11(MxNotificationParam& p_param);
MxLong HandleEndAction(MxEndActionNotificationParam& p_param);
MxLong HandleKeyPress(LegoEventNotificationParam& p_param);
Radio m_radio; // 0xf8 Radio m_radio; // 0xf8
PoliceState* m_policeState; // 0x108 PoliceState* m_policeState; // 0x108
undefined4 m_unk0x10c; // 0x10c undefined4 m_transitionDestination; // 0x10c
}; };
#endif // POLICE_H #endif // POLICE_H

View file

@ -13,15 +13,14 @@ DECOMP_SIZE_ASSERT(Police, 0x110)
Police::Police() Police::Police()
{ {
m_policeState = NULL; m_policeState = NULL;
m_unk0x10c = 0; m_transitionDestination = 0;
NotificationManager()->Register(this); NotificationManager()->Register(this);
} }
// STUB: LEGO1 0x1005e1d0 // FUNCTION: LEGO1 0x1005e1d0
MxBool Police::VTable0x5c() MxBool Police::VTable0x5c()
{ {
// TODO return TRUE;
return FALSE;
} }
// FUNCTION: LEGO1 0x1005e320 // FUNCTION: LEGO1 0x1005e320
@ -60,12 +59,30 @@ MxResult Police::Create(MxDSAction& p_dsAction)
return ret; return ret;
} }
// STUB: LEGO1 0x1005e480 // FUNCTION: LEGO1 0x1005e480
MxLong Police::Notify(MxParam& p_param) MxLong Police::Notify(MxParam& p_param)
{ {
// TODO MxLong result = 0;
LegoWorld::Notify(p_param);
return 0; if (m_worldStarted) {
switch (((MxNotificationParam&) p_param).GetNotification()) {
case c_notificationEndAction:
result = HandleEndAction((MxEndActionNotificationParam&) p_param);
break;
case c_notificationKeyPress:
result = HandleKeyPress(((LegoEventNotificationParam&) p_param));
break;
case c_notificationType11:
result = HandleNotification11((MxNotificationParam&) p_param);
break;
case c_notificationTransitioned:
GameState()->SwitchArea(m_transitionDestination);
break;
}
}
return result;
} }
// FUNCTION: LEGO1 0x1005e530 // FUNCTION: LEGO1 0x1005e530
@ -76,6 +93,27 @@ void Police::ReadyWorld()
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
} }
// STUB: LEGO1 0x1005e550
MxLong Police::HandleNotification11(MxNotificationParam& p_param)
{
// TODO
return 0;
}
// STUB: LEGO1 0x1005e6a0
MxLong Police::HandleEndAction(MxEndActionNotificationParam& p_param)
{
// TODO
return 0;
}
// STUB: LEGO1 0x1005e6f0
MxLong Police::HandleKeyPress(LegoEventNotificationParam& p_param)
{
// TODO
return 0;
}
// STUB: LEGO1 0x1005e740 // STUB: LEGO1 0x1005e740
void Police::Enable(MxBool p_enable) void Police::Enable(MxBool p_enable)
{ {