implement LegoInputManager::Create

This commit is contained in:
Misha 2024-01-27 16:02:24 -05:00
parent 19c771b85d
commit ebbef2c42f
No known key found for this signature in database
GPG Key ID: 8441D12AEF33FED8
4 changed files with 101 additions and 34 deletions

View File

@ -32,6 +32,9 @@ class LegoControlManager : public MxCore {
// SYNTHETIC: LEGO1 0x10028d40
// LegoControlManager::`scalar deleting destructor'
private:
undefined m_padding0x08[0x58]; // 0x08
};
#endif // LEGOCONTROLMANAGER_H

View File

@ -25,6 +25,29 @@ class LegoControlManager;
// SIZE 0x18
class LegoEventQueue : public MxQueue<LegoEventNotificationParam> {};
// 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: LGEO1 0x10028830
virtual MxS8 Compare(MxCore* p_element1, MxCore* p_element2)
{
return p_element1 == p_element2 ? 0 : p_element1 < p_element2 ? -1 : 1;
}
public:
LegoNotifyList(MxBool p_ownership = FALSE) : MxPtrList<MxCore>(p_ownership) {}
};
// VTABLE: LEGO1 0x100d8760
// SIZE 0x338
class LegoInputManager : public MxPresenter {
@ -78,47 +101,59 @@ class LegoInputManager : public MxPresenter {
// LegoInputManager::`scalar deleting destructor'
private:
MxCriticalSection m_criticalSection;
MxList<undefined4>* m_unk0x5c; // list or hash table
LegoCameraController* m_camera;
LegoWorld* m_world;
LegoEventQueue* m_eventQueue; // +0x68
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;
MxCriticalSection m_criticalSection; // 0x58
LegoNotifyList* m_notifyList; // 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
UINT m_timer; // 0x78
UINT m_timeout; // 0x7c
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
};
// TEMPLATE: LEGO1 0x1005bb80
// MxCollection<LegoEventNotificationParam>::Compare
// TEMPLATE: LEGO1 0x100288b0
// MxCollection<MxCore *>::Destroy
// TEMPLATE: LEGO1 0x10028850
// MxCollection<MxCore *>::Compare
// TEMPLATE: LEGO1 0x1005bbe0
// MxCollection<LegoEventNotificationParam>::~MxCollection<LegoEventNotificationParam>
// TEMPLATE: LEGO1 0x10028860
// MxCollection<MxCore *>::~MxCollection<MxCore *>
// TEMPLATE: LEGO1 0x1005bc30
// MxCollection<LegoEventNotificationParam>::Destroy
// TEMPLATE: LEGO1 0x1005bc80
// MxList<LegoEventNotificationParam>::~MxList<LegoEventNotificationParam>
// TEMPLATE: LEGO1 0x100288c0
// MxList<MxCore *>::~MxList<MxCore *>
// SYNTHETIC: LEGO1 0x1005bd50
// MxCollection<LegoEventNotificationParam>::`scalar deleting destructor'
@ -128,9 +163,24 @@ class LegoInputManager : public MxPresenter {
// SYNTHETIC: LEGO1 0x1005beb0
// LegoEventQueue::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x10028a10
// MxCollection<MxCore *>::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x10028a80
// MxList<MxCore *>::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x10028b30
// MxPtrList<MxCore>::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x10028950
// LegoNotifyList::`scalar deleting destructor'
// TEMPLATE: LEGO1 0x1005bf20
// MxQueue<LegoEventNotificationParam>::~MxQueue<LegoEventNotificationParam>
// TEMPLATE: LEGO1 0x100289c0
// MxPtrList<MxCore>::~MxPtrList<MxCore>
// SYNTHETIC: LEGO1 0x1005bf70
// MxQueue<LegoEventNotificationParam>::`scalar deleting destructor'

View File

@ -1,5 +1,7 @@
#include "legocontrolmanager.h"
DECOMP_SIZE_ASSERT(LegoControlManager, 0x60);
// STUB: LEGO1 0x10028520
LegoControlManager::LegoControlManager()
{

View File

@ -16,7 +16,7 @@ MxS32 g_unk0x100f31b4 = 0;
// FUNCTION: LEGO1 0x1005b790
LegoInputManager::LegoInputManager()
{
m_unk0x5c = NULL;
m_notifyList = NULL;
m_world = NULL;
m_camera = NULL;
m_eventQueue = NULL;
@ -40,7 +40,7 @@ LegoInputManager::LegoInputManager()
m_timeout = 1000;
}
// STUB: LEGO1 0x1005b8b0
// FUNCTION: LEGO1 0x1005b8b0
MxResult LegoInputManager::Tickle()
{
ProcessEvents();
@ -56,10 +56,22 @@ LegoInputManager::~LegoInputManager()
// FUNCTION: LEGO1 0x1005b960
MxResult LegoInputManager::Create(HWND p_hwnd)
{
// TODO
MxResult result = SUCCESS;
m_controlManager = new LegoControlManager();
if (m_notifyList == NULL)
m_notifyList = new LegoNotifyList();
if (m_eventQueue == NULL)
m_eventQueue = new LegoEventQueue();
return SUCCESS;
CreateAndAcquireKeyboard(p_hwnd);
GetJoystickId();
if (m_notifyList == NULL || m_eventQueue == NULL || m_directInputDevice == NULL) {
Destroy();
result = FAILURE;
}
return result;
}
// FUNCTION: LEGO1 0x1005bfe0
@ -67,9 +79,9 @@ void LegoInputManager::Destroy()
{
ReleaseDX();
if (m_unk0x5c)
delete m_unk0x5c;
m_unk0x5c = NULL;
if (m_notifyList)
delete m_notifyList;
m_notifyList = NULL;
if (m_eventQueue)
delete m_eventQueue;