mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 08:24:16 +00:00
MxQueue and parts of LegoInputManager (#268)
* MxQueue and parts of LegoInputManager * Missed clang-format on mxqueue.h * Fix declarations * MxParamType -> NotificationId --------- Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
@@ -9,10 +9,10 @@ DECOMP_SIZE_ASSERT(LegoInputManager, 0x338);
|
||||
// OFFSET: LEGO1 0x1005b790
|
||||
LegoInputManager::LegoInputManager()
|
||||
{
|
||||
m_eventQueue = NULL;
|
||||
m_unk0x5c = NULL;
|
||||
m_world = NULL;
|
||||
m_camera = NULL;
|
||||
m_unk0x68 = NULL;
|
||||
m_eventQueue = NULL;
|
||||
m_unk0x80 = 0;
|
||||
m_timer = 0;
|
||||
m_unk0x6c = 0;
|
||||
@@ -36,7 +36,7 @@ LegoInputManager::LegoInputManager()
|
||||
// OFFSET: LEGO1 0x1005b8b0 STUB
|
||||
MxResult LegoInputManager::Tickle()
|
||||
{
|
||||
// TODO
|
||||
ProcessEvents();
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -46,30 +46,32 @@ LegoInputManager::~LegoInputManager()
|
||||
Destroy();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1005b960
|
||||
MxResult LegoInputManager::Create(HWND p_hwnd)
|
||||
{
|
||||
// TODO
|
||||
if (m_eventQueue == NULL)
|
||||
m_eventQueue = new LegoEventQueue();
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1005bfe0
|
||||
void LegoInputManager::Destroy()
|
||||
{
|
||||
ReleaseDX();
|
||||
|
||||
if (m_unk0x5c)
|
||||
delete m_unk0x5c;
|
||||
m_unk0x5c = NULL;
|
||||
|
||||
if (m_eventQueue)
|
||||
delete m_eventQueue;
|
||||
m_eventQueue = NULL;
|
||||
|
||||
if (m_unk0x68)
|
||||
delete m_unk0x68;
|
||||
m_unk0x68 = NULL;
|
||||
|
||||
if (m_controlManager)
|
||||
delete m_controlManager;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1005b960 STUB
|
||||
MxResult LegoInputManager::Create(HWND p_hwnd)
|
||||
{
|
||||
// TODO STUB
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1005c030
|
||||
void LegoInputManager::CreateAndAcquireKeyboard(HWND hwnd)
|
||||
{
|
||||
@@ -222,10 +224,34 @@ void LegoInputManager::ClearWorld()
|
||||
m_world = NULL;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1005c740 STUB
|
||||
void LegoInputManager::QueueEvent(NotificationId id, unsigned char p2, MxLong p3, MxLong p4, unsigned char p5)
|
||||
// OFFSET: LEGO1 0x1005c740
|
||||
void LegoInputManager::QueueEvent(NotificationId p_id, MxU8 p_modifier, MxLong p_x, MxLong p_y, MxU8 p_key)
|
||||
{
|
||||
LegoEventNotificationParam param = LegoEventNotificationParam(p_id, NULL, p_modifier, p_x, p_y, p_key);
|
||||
|
||||
if (((!m_unk0x88) || ((m_unk0x335 && (param.GetType() == c_notificationButtonDown)))) ||
|
||||
((m_unk0x336 && (p_key == ' ')))) {
|
||||
ProcessOneEvent(param);
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1005c820
|
||||
void LegoInputManager::ProcessEvents()
|
||||
{
|
||||
MxAutoLocker lock(&m_criticalSection);
|
||||
|
||||
LegoEventNotificationParam event;
|
||||
while (m_eventQueue->Dequeue(event)) {
|
||||
if (ProcessOneEvent(event))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1005c9c0 STUB
|
||||
MxBool LegoInputManager::ProcessOneEvent(LegoEventNotificationParam& p_param)
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1005cfb0
|
||||
|
Reference in New Issue
Block a user