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
|
|
|
|
2024-01-28 16:09:33 -05:00
|
|
|
extern MxS32 g_unk0x100f31b0;
|
|
|
|
extern const char* g_unk0x100f31b4;
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// VTABLE: LEGO1 0x100d87b8
|
2023-11-19 07:23:30 -05:00
|
|
|
// class MxCollection<LegoEventNotificationParam>
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// VTABLE: LEGO1 0x100d87d0
|
2023-11-19 07:23:30 -05:00
|
|
|
// class MxList<LegoEventNotificationParam>
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// VTABLE: LEGO1 0x100d87e8
|
2023-11-19 07:23:30 -05:00
|
|
|
// class MxQueue<LegoEventNotificationParam>
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// VTABLE: LEGO1 0x100d8800
|
2023-11-19 07:23:30 -05:00
|
|
|
// SIZE 0x18
|
2023-11-07 03:30:26 -05:00
|
|
|
class LegoEventQueue : public MxQueue<LegoEventNotificationParam> {};
|
2023-10-03 13:53:22 -04:00
|
|
|
|
2024-01-27 16:55:59 -05:00
|
|
|
// VTABLE: LEGO1 0x100d6a20
|
|
|
|
// class MxCollection<MxCore*>
|
|
|
|
|
|
|
|
// VTABLE: LEGO1 0x100d6a38
|
|
|
|
// class MxList<MxCore*>
|
|
|
|
|
|
|
|
// VTABLE: LEGO1 0x100d6a50
|
|
|
|
// class MxPtrList<MxCore>
|
|
|
|
|
|
|
|
// VTABLE: LEGO1 0x100d6a68
|
|
|
|
// SIZE 0x18
|
|
|
|
class LegoNotifyList : public MxPtrList<MxCore> {
|
|
|
|
protected:
|
|
|
|
// FUNCTION: LEGO1 0x10028830
|
|
|
|
virtual MxS8 Compare(MxCore* p_element1, MxCore* p_element2) override
|
|
|
|
{
|
|
|
|
return p_element1 == p_element2 ? 0 : p_element1 < p_element2 ? -1 : 1;
|
|
|
|
} // vtable+0x14
|
|
|
|
|
|
|
|
public:
|
|
|
|
LegoNotifyList(MxBool p_ownership = FALSE) : MxPtrList<MxCore>(p_ownership) {}
|
|
|
|
};
|
|
|
|
|
2024-01-27 17:15:12 -05:00
|
|
|
// VTABLE: LEGO1 0x100d6ac0
|
|
|
|
// class MxListCursor<MxCore *>
|
|
|
|
|
|
|
|
// VTABLE: LEGO1 0x100d6ad8
|
|
|
|
// class MxPtrListCursor<MxCore>
|
|
|
|
|
|
|
|
// VTABLE: LEGO1 0x100d6aa8
|
|
|
|
// SIZE 0x10
|
|
|
|
class LegoNotifyListCursor : public MxPtrListCursor<MxCore> {
|
|
|
|
public:
|
|
|
|
LegoNotifyListCursor(LegoNotifyList* p_list) : MxPtrListCursor<MxCore>(p_list) {}
|
|
|
|
};
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// VTABLE: LEGO1 0x100d8760
|
2023-06-29 04:10:08 -04:00
|
|
|
// 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
|
|
|
|
2024-01-24 21:16:29 -05:00
|
|
|
void QueueEvent(NotificationId p_id, MxU8 p_modifier, MxLong p_x, MxLong p_y, MxU8 p_key);
|
|
|
|
void Register(MxCore*);
|
|
|
|
void UnRegister(MxCore*);
|
2023-04-27 22:19:39 -04:00
|
|
|
|
2024-01-29 16:17:17 -05:00
|
|
|
virtual MxResult Tickle() override; // vtable+0x08
|
2023-06-29 04:10:08 -04:00
|
|
|
|
2024-01-20 18:04:46 -05:00
|
|
|
// FUNCTION: LEGO1 0x1005b8c0
|
2024-01-29 17:30:20 -05:00
|
|
|
virtual MxResult PutData() override { return SUCCESS; } // vtable+0x4c
|
2024-01-20 18:04:46 -05:00
|
|
|
|
2023-11-06 04:00:24 -05:00
|
|
|
MxResult Create(HWND p_hwnd);
|
2023-10-24 19:38:27 -04:00
|
|
|
void Destroy();
|
2023-12-13 05:48:14 -05:00
|
|
|
void CreateAndAcquireKeyboard(HWND p_hwnd);
|
2023-10-24 19:38:27 -04:00
|
|
|
void ReleaseDX();
|
|
|
|
MxResult GetJoystickId();
|
2023-12-13 05:48:14 -05:00
|
|
|
MxResult GetJoystickState(MxU32* p_joystickX, MxU32* p_joystickY, DWORD* p_buttonsState, MxU32* p_povPosition);
|
2024-01-28 09:20:21 -05:00
|
|
|
void StartAutoDragTimer();
|
|
|
|
void StopAutoDragTimer();
|
2024-01-17 15:48:48 -05:00
|
|
|
void EnableInputProcessing();
|
2023-10-24 19:38:27 -04:00
|
|
|
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; }
|
2024-01-17 11:53:53 -05:00
|
|
|
inline void SetUnknown335(MxBool p_unk0x335) { m_unk0x335 = p_unk0x335; }
|
2023-10-24 19:38:27 -04:00
|
|
|
inline void SetUnknown336(MxBool p_unk0x336) { m_unk0x336 = p_unk0x336; }
|
2024-01-14 16:58:00 -05:00
|
|
|
inline void SetUseJoystick(MxBool p_useJoystick) { m_useJoystick = p_useJoystick; }
|
|
|
|
inline void SetJoystickIndex(MxS32 p_joystickIndex) { m_joystickIndex = p_joystickIndex; }
|
2023-09-29 12:09:46 -04:00
|
|
|
|
2024-01-17 15:48:48 -05:00
|
|
|
inline void DisableInputProcessing()
|
|
|
|
{
|
|
|
|
m_unk0x88 = TRUE;
|
|
|
|
m_unk0x336 = FALSE;
|
|
|
|
}
|
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
inline LegoControlManager* GetControlManager() { return m_controlManager; }
|
|
|
|
inline LegoWorld* GetWorld() { return m_world; }
|
2024-01-09 04:43:21 -05:00
|
|
|
inline LegoCameraController* GetCamera() { return m_camera; }
|
2023-10-18 16:12:28 -04:00
|
|
|
|
2023-11-07 03:30:26 -05:00
|
|
|
void ProcessEvents();
|
|
|
|
MxBool ProcessOneEvent(LegoEventNotificationParam& p_param);
|
2024-01-28 09:20:21 -05:00
|
|
|
MxBool FUN_1005cdf0(LegoEventNotificationParam& p_param);
|
2023-11-07 03:30:26 -05:00
|
|
|
|
2024-01-18 08:34:14 -05:00
|
|
|
// SYNTHETIC: LEGO1 0x1005b8d0
|
|
|
|
// LegoInputManager::`scalar deleting destructor'
|
|
|
|
|
2024-01-14 16:58:00 -05:00
|
|
|
private:
|
2024-01-27 16:55:59 -05:00
|
|
|
MxCriticalSection m_criticalSection; // 0x58
|
|
|
|
LegoNotifyList* m_keyboardNotifyList; // 0x5c
|
|
|
|
LegoCameraController* m_camera; // 0x60
|
|
|
|
LegoWorld* m_world; // 0x64
|
|
|
|
LegoEventQueue* m_eventQueue; // 0x68
|
|
|
|
undefined4 m_unk0x6c; // 0x6c
|
|
|
|
undefined4 m_unk0x70; // 0x70
|
|
|
|
undefined4 m_unk0x74; // 0x74
|
2024-01-28 09:20:21 -05:00
|
|
|
UINT m_autoDragTimerID; // 0x78
|
|
|
|
UINT m_autoDragTime; // 0x7c
|
2024-01-27 16:55:59 -05:00
|
|
|
undefined m_unk0x80; // 0x80
|
|
|
|
undefined m_unk0x81; // 0x81
|
|
|
|
LegoControlManager* m_controlManager; // 0x84
|
|
|
|
MxBool m_unk0x88; // 0x88
|
|
|
|
IDirectInput* m_directInput; // 0x8c
|
|
|
|
IDirectInputDevice* m_directInputDevice; // 0x90
|
|
|
|
undefined m_unk0x94; // 0x94
|
|
|
|
undefined4 m_unk0x98; // 0x98
|
|
|
|
undefined m_unk0x9c[0xf8]; // 0x9c
|
|
|
|
undefined m_unk0x194; // 0x194
|
|
|
|
MxBool m_unk0x195; // 0x195
|
|
|
|
MxS32 m_joyid; // 0x198
|
|
|
|
MxS32 m_joystickIndex; // 0x19c
|
|
|
|
JOYCAPS m_joyCaps; // 0x200
|
|
|
|
MxBool m_useJoystick; // 0x334
|
|
|
|
MxBool m_unk0x335; // 0x335
|
|
|
|
MxBool m_unk0x336; // 0x336
|
2023-04-27 22:19:39 -04:00
|
|
|
};
|
|
|
|
|
2024-01-26 05:37:50 -05:00
|
|
|
// TEMPLATE: LEGO1 0x10028850
|
|
|
|
// MxCollection<MxCore *>::Compare
|
|
|
|
|
|
|
|
// TEMPLATE: LEGO1 0x10028860
|
|
|
|
// MxCollection<MxCore *>::~MxCollection<MxCore *>
|
2023-12-12 14:27:17 -05:00
|
|
|
|
2024-01-27 16:55:59 -05:00
|
|
|
// TEMPLATE: LEGO1 0x100288b0
|
|
|
|
// MxCollection<MxCore *>::Destroy
|
|
|
|
|
2024-01-26 05:37:50 -05:00
|
|
|
// TEMPLATE: LEGO1 0x100288c0
|
|
|
|
// MxList<MxCore *>::~MxList<MxCore *>
|
|
|
|
|
|
|
|
// SYNTHETIC: LEGO1 0x10028950
|
|
|
|
// LegoNotifyList::`scalar deleting destructor'
|
|
|
|
|
|
|
|
// TEMPLATE: LEGO1 0x100289c0
|
|
|
|
// MxPtrList<MxCore>::~MxPtrList<MxCore>
|
|
|
|
|
|
|
|
// SYNTHETIC: LEGO1 0x10028a10
|
|
|
|
// MxCollection<MxCore *>::`scalar deleting destructor'
|
|
|
|
|
|
|
|
// SYNTHETIC: LEGO1 0x10028a80
|
|
|
|
// MxList<MxCore *>::`scalar deleting destructor'
|
|
|
|
|
|
|
|
// SYNTHETIC: LEGO1 0x10028b30
|
|
|
|
// MxPtrList<MxCore>::`scalar deleting destructor'
|
|
|
|
|
2024-01-28 16:09:33 -05:00
|
|
|
// FUNCTION: LEGO1 0x10028ba0
|
|
|
|
// LegoNotifyList::~LegoNotifyList
|
|
|
|
|
2024-01-27 17:15:12 -05:00
|
|
|
// SYNTHETIC: LEGO1 0x10028fd0
|
|
|
|
// LegoNotifyListCursor::`scalar deleting destructor'
|
|
|
|
|
|
|
|
// TEMPLATE: LEGO1 0x10029040
|
|
|
|
// MxPtrListCursor<MxCore>::~MxPtrListCursor<MxCore>
|
|
|
|
|
|
|
|
// SYNTHETIC: LEGO1 0x10029090
|
|
|
|
// MxListCursor<MxCore *>::`scalar deleting destructor'
|
|
|
|
|
|
|
|
// SYNTHETIC: LEGO1 0x10029100
|
|
|
|
// MxPtrListCursor<MxCore>::`scalar deleting destructor'
|
|
|
|
|
|
|
|
// TEMPLATE: LEGO1 0x10029170
|
|
|
|
// MxListCursor<MxCore *>::~MxListCursor<MxCore *>
|
|
|
|
|
|
|
|
// TEMPLATE: LEGO1 0x100291c0
|
|
|
|
// LegoNotifyListCursor::~LegoNotifyListCursor
|
|
|
|
|
2024-01-26 05:37:50 -05:00
|
|
|
// TEMPLATE: LEGO1 0x1005bb80
|
|
|
|
// MxCollection<LegoEventNotificationParam>::Compare
|
2024-01-27 16:55:59 -05:00
|
|
|
|
2024-01-14 16:28:46 -05:00
|
|
|
// TEMPLATE: LEGO1 0x1005bbe0
|
|
|
|
// MxCollection<LegoEventNotificationParam>::~MxCollection<LegoEventNotificationParam>
|
|
|
|
|
2023-12-12 14:27:17 -05:00
|
|
|
// TEMPLATE: LEGO1 0x1005bc30
|
|
|
|
// MxCollection<LegoEventNotificationParam>::Destroy
|
|
|
|
|
|
|
|
// TEMPLATE: LEGO1 0x1005bc80
|
|
|
|
// MxList<LegoEventNotificationParam>::~MxList<LegoEventNotificationParam>
|
|
|
|
|
|
|
|
// SYNTHETIC: LEGO1 0x1005bd50
|
|
|
|
// MxCollection<LegoEventNotificationParam>::`scalar deleting destructor'
|
|
|
|
|
|
|
|
// SYNTHETIC: LEGO1 0x1005bdc0
|
|
|
|
// MxList<LegoEventNotificationParam>::`scalar deleting destructor'
|
|
|
|
|
|
|
|
// SYNTHETIC: LEGO1 0x1005beb0
|
|
|
|
// LegoEventQueue::`scalar deleting destructor'
|
|
|
|
|
2024-01-14 16:28:46 -05:00
|
|
|
// TEMPLATE: LEGO1 0x1005bf20
|
|
|
|
// MxQueue<LegoEventNotificationParam>::~MxQueue<LegoEventNotificationParam>
|
|
|
|
|
2023-12-12 14:27:17 -05:00
|
|
|
// SYNTHETIC: LEGO1 0x1005bf70
|
|
|
|
// MxQueue<LegoEventNotificationParam>::`scalar deleting destructor'
|
|
|
|
|
|
|
|
// TEMPLATE: LEGO1 0x1005d010
|
|
|
|
// MxListEntry<LegoEventNotificationParam>::GetValue
|
|
|
|
|
2023-04-27 22:19:39 -04:00
|
|
|
#endif // LEGOINPUTMANAGER_H
|