2023-04-27 22:19:39 -04:00
|
|
|
#ifndef LEGOINPUTMANAGER_H
|
|
|
|
#define LEGOINPUTMANAGER_H
|
|
|
|
|
2023-07-02 03:00:28 -04:00
|
|
|
#include "decomp.h"
|
2023-10-25 16:51:59 -04:00
|
|
|
#include "legoeventnotificationparam.h"
|
2023-10-23 07:16:21 -04:00
|
|
|
#include "legoworld.h"
|
2023-10-03 13:53:22 -04:00
|
|
|
#include "mxlist.h"
|
2023-10-24 19:38:27 -04:00
|
|
|
#include "mxpresenter.h"
|
2023-11-07 03:30:26 -05:00
|
|
|
#include "mxqueue.h"
|
2023-10-03 13:53:22 -04:00
|
|
|
|
|
|
|
#include <dinput.h>
|
2023-06-19 01:36:07 -04:00
|
|
|
|
2023-10-03 13:53:22 -04:00
|
|
|
class LegoControlManager;
|
2023-11-07 03:30:26 -05:00
|
|
|
|
|
|
|
// VTABLE 0x100d8800
|
|
|
|
class LegoEventQueue : public MxQueue<LegoEventNotificationParam> {};
|
2023-10-03 13:53:22 -04:00
|
|
|
|
2023-06-29 04:10:08 -04:00
|
|
|
// VTABLE 0x100d8760
|
|
|
|
// SIZE 0x338
|
2023-10-24 19:38:27 -04:00
|
|
|
class LegoInputManager : public MxPresenter {
|
2023-04-27 22:19:39 -04:00
|
|
|
public:
|
2023-10-24 19:38:27 -04:00
|
|
|
LegoInputManager();
|
|
|
|
virtual ~LegoInputManager() override;
|
2023-06-29 04:10:08 -04:00
|
|
|
|
2023-11-07 03:30:26 -05:00
|
|
|
__declspec(dllexport) void QueueEvent(NotificationId p_id, MxU8 p_modifier, MxLong p_x, MxLong p_y, MxU8 p_key);
|
2023-10-24 19:38:27 -04:00
|
|
|
__declspec(dllexport) void Register(MxCore*);
|
|
|
|
__declspec(dllexport) void UnRegister(MxCore*);
|
2023-04-27 22:19:39 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
virtual MxResult Tickle() override; // vtable+0x8
|
2023-06-29 04:10:08 -04:00
|
|
|
|
2023-11-06 04:00:24 -05:00
|
|
|
MxResult Create(HWND p_hwnd);
|
2023-10-24 19:38:27 -04:00
|
|
|
void Destroy();
|
|
|
|
void CreateAndAcquireKeyboard(HWND hwnd);
|
|
|
|
void ReleaseDX();
|
|
|
|
MxResult GetJoystickId();
|
|
|
|
MxResult GetJoystickState(MxU32* joystick_x, MxU32* joystick_y, DWORD* buttons_state, MxU32* pov_position);
|
|
|
|
void SetTimer();
|
|
|
|
void KillTimer();
|
|
|
|
void SetCamera(LegoCameraController* p_camera);
|
|
|
|
void ClearCamera();
|
|
|
|
void SetWorld(LegoWorld* p_world);
|
|
|
|
void ClearWorld();
|
2023-10-23 07:16:21 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
inline void SetUnknown88(MxBool p_unk0x88) { m_unk0x88 = p_unk0x88; }
|
|
|
|
inline void SetUnknown336(MxBool p_unk0x336) { m_unk0x336 = p_unk0x336; }
|
2023-09-29 12:09:46 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
inline LegoControlManager* GetControlManager() { return m_controlManager; }
|
|
|
|
inline LegoWorld* GetWorld() { return m_world; }
|
2023-10-18 16:12:28 -04:00
|
|
|
|
2023-11-07 03:30:26 -05:00
|
|
|
void ProcessEvents();
|
|
|
|
MxBool ProcessOneEvent(LegoEventNotificationParam& p_param);
|
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
// private:
|
|
|
|
MxCriticalSection m_criticalSection;
|
2023-11-07 03:30:26 -05:00
|
|
|
MxList<undefined4>* m_unk0x5c; // list or hash table
|
2023-10-24 19:38:27 -04:00
|
|
|
LegoCameraController* m_camera;
|
|
|
|
LegoWorld* m_world;
|
2023-11-07 03:30:26 -05:00
|
|
|
LegoEventQueue* m_eventQueue; // +0x68
|
2023-10-24 19:38:27 -04:00
|
|
|
undefined4 m_unk0x6c;
|
|
|
|
undefined4 m_unk0x70;
|
|
|
|
undefined4 m_unk0x74;
|
|
|
|
UINT m_timer;
|
|
|
|
UINT m_timeout;
|
|
|
|
undefined m_unk0x80;
|
|
|
|
undefined m_unk0x81;
|
|
|
|
LegoControlManager* m_controlManager;
|
|
|
|
MxBool m_unk0x88;
|
|
|
|
IDirectInput* m_directInput;
|
|
|
|
IDirectInputDevice* m_directInputDevice;
|
|
|
|
undefined m_unk0x94;
|
|
|
|
undefined4 m_unk0x98;
|
|
|
|
undefined m_unk0x9c[0xF8];
|
|
|
|
undefined m_unk0x194;
|
|
|
|
MxBool m_unk0x195;
|
|
|
|
MxS32 m_joyid;
|
|
|
|
MxS32 m_joystickIndex;
|
|
|
|
JOYCAPS m_joyCaps;
|
|
|
|
MxBool m_useJoystick;
|
|
|
|
MxBool m_unk0x335;
|
|
|
|
MxBool m_unk0x336;
|
2023-04-27 22:19:39 -04:00
|
|
|
};
|
|
|
|
|
2023-11-07 03:30:26 -05:00
|
|
|
// OFFSET: LEGO1 0x1005bb80 TEMPLATE
|
|
|
|
// MxListParent<LegoEventNotificationParam>::Compare
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x1005bc30 TEMPLATE
|
|
|
|
// MxListParent<LegoEventNotificationParam>::Destroy
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x1005bc80 TEMPLATE
|
|
|
|
// MxList<LegoEventNotificationParam>::~MxList<LegoEventNotificationParam>
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x1005bd50 TEMPLATE
|
|
|
|
// MxListParent<LegoEventNotificationParam>::`scalar deleting destructor'
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x1005bdc0 TEMPLATE
|
|
|
|
// MxList<LegoEventNotificationParam>::`scalar deleting destructor'
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x1005beb0 TEMPLATE
|
|
|
|
// LegoEventQueue::`scalar deleting destructor'
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x1005bf70 TEMPLATE
|
|
|
|
// MxQueue<LegoEventNotificationParam>::`scalar deleting destructor'
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x1005d010 TEMPLATE
|
|
|
|
// MxListEntry<LegoEventNotificationParam>::GetValue
|
|
|
|
|
|
|
|
// VTABLE 0x100d87e8 TEMPLATE
|
|
|
|
// class MxQueue<LegoEventNotificationParam>
|
|
|
|
|
|
|
|
// VTABLE 0x100d87d0 TEMPLATE
|
|
|
|
// class MxList<LegoEventNotificationParam>
|
|
|
|
|
|
|
|
// VTABLE 0x100d87b8 TEMPLATE
|
|
|
|
// class MxListParent<LegoEventNotificationParam>
|
|
|
|
|
2023-04-27 22:19:39 -04:00
|
|
|
#endif // LEGOINPUTMANAGER_H
|