Implement Police::HandleKeyPress, Enable, VTable0x64 (#529)

* Implement Police::HandleKeyPress, Enable, VTable0x64

* fix return type

* Style

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
Joshua Peisach 2024-02-04 17:40:51 -05:00 committed by GitHub
parent 8cc79ad4de
commit 0497ef13fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 7 deletions

View file

@ -29,6 +29,9 @@ class PoliceState : public LegoState {
// SYNTHETIC: LEGO1 0x1005e920 // SYNTHETIC: LEGO1 0x1005e920
// PoliceState::`scalar deleting destructor' // PoliceState::`scalar deleting destructor'
inline undefined4 GetUnknown0x0c() { return m_unk0x0c; }
inline void SetUnknown0x0c(undefined4 p_unk0x0c) { m_unk0x0c = p_unk0x0c; }
private: private:
undefined4 m_unk0x08; // 0x08 undefined4 m_unk0x08; // 0x08
undefined4 m_unk0x0c; // 0x0c undefined4 m_unk0x0c; // 0x0c

View file

@ -107,22 +107,40 @@ MxLong Police::HandleEndAction(MxEndActionNotificationParam& p_param)
return 0; return 0;
} }
// STUB: LEGO1 0x1005e6f0 // FUNCTION: LEGO1 0x1005e6f0
MxLong Police::HandleKeyPress(LegoEventNotificationParam& p_param) MxLong Police::HandleKeyPress(LegoEventNotificationParam& p_param)
{ {
// TODO MxLong result = 0;
if (p_param.GetKey() == ' ' && m_policeState->GetUnknown0x0c() == 1) {
DeleteObjects(&m_atom, 500, 501);
m_policeState->SetUnknown0x0c(0);
return 1;
}
return 0; return 0;
} }
// STUB: LEGO1 0x1005e740 // FUNCTION: LEGO1 0x1005e740
void Police::Enable(MxBool p_enable) void Police::Enable(MxBool p_enable)
{ {
// TODO LegoWorld::Enable(p_enable);
if (p_enable) {
InputManager()->SetWorld(this);
SetIsWorldActive(FALSE);
}
else {
if (InputManager()->GetWorld() == this) {
InputManager()->ClearWorld();
}
}
} }
// STUB: LEGO1 0x1005e790 // FUNCTION: LEGO1 0x1005e790
MxBool Police::VTable0x64() MxBool Police::VTable0x64()
{ {
// TODO DeleteObjects(&m_atom, 500, 510);
return FALSE; m_transitionDestination = 2;
return TRUE;
} }