|
| 1 | +#ifndef INPUTDEVICE_H |
| 2 | +#define INPUTDEVICE_H |
| 3 | + |
| 4 | +#include "decomp.h" |
| 5 | +#include "types.h" |
| 6 | + |
| 7 | +class OpalVault0xf0; |
| 8 | + |
| 9 | +class InputDevice; |
| 10 | + |
| 11 | +class InputCallback { |
| 12 | +public: |
| 13 | + virtual void OnKeyDown(InputDevice& p_device, undefined2 p_keyCode) = 0; // vtable+0x00 |
| 14 | + virtual void OnKeyUp(InputDevice& p_device, undefined2 p_keyCode) = 0; // vtable+0x04 |
| 15 | +}; |
| 16 | + |
| 17 | +// VTABLE: LEGORACERS 0x004b0e9c |
| 18 | +// SIZE 0x9c |
| 19 | +class InputDevice { |
| 20 | +public: |
| 21 | + |
| 22 | + enum { |
| 23 | + SOURCE_KEYBOARD = 0x10000000, |
| 24 | + SOURCE_MOUSE = 0x20000000, |
| 25 | + SOURCE_JOYSTICK1 = 0x30000000, |
| 26 | + SOURCE_JOYSTICK2 = 0x40000000, |
| 27 | + SOURCE_MASK = 0xf0000000, |
| 28 | + }; |
| 29 | + |
| 30 | + static inline LegoU32 GetKeySource(LegoU32 p_event) |
| 31 | + { |
| 32 | + return p_event & SOURCE_MASK; |
| 33 | + } |
| 34 | + |
| 35 | + static inline LegoU32 MakeEvent(LegoU32 p_source, LegoU32 p_value) |
| 36 | + { |
| 37 | + return p_source | p_value; |
| 38 | + } |
| 39 | + |
| 40 | + InputDevice(); |
| 41 | + virtual void VTable0x00(); |
| 42 | + virtual void VTable0x04(undefined4, LegoBool p_arg2, LegoBool32); |
| 43 | + virtual void VTable0x08(undefined4, LegoFloat) = 0; |
| 44 | + virtual ~InputDevice(); |
| 45 | + virtual LegoBool32 VTable0x10(); |
| 46 | + virtual undefined4 VTable0x14(undefined4); |
| 47 | + virtual undefined4 VTable0x18(); |
| 48 | + virtual LegoS32 VTable0x1c(); |
| 49 | + virtual undefined4 VTable0x20(); |
| 50 | + virtual undefined2* VTable0x24(undefined4); |
| 51 | + virtual void VTable0x28(undefined4) = 0; |
| 52 | + virtual LegoFloat VTable0x2c(undefined4) = 0; |
| 53 | + virtual LegoFloat VTable0x30(undefined4) = 0; |
| 54 | + virtual undefined4 VTable0x34(undefined4) = 0; |
| 55 | + virtual undefined4 VTable0x38() = 0; |
| 56 | + virtual undefined4 VTable0x3c() = 0; |
| 57 | + virtual undefined4 VTable0x40() = 0; |
| 58 | + virtual undefined4 VTable0x44() = 0; |
| 59 | + virtual undefined4 VTable0x48() = 0; |
| 60 | + virtual undefined4 VTable0x4c() = 0; |
| 61 | + virtual undefined4 VTable0x50(); |
| 62 | + virtual undefined4 VTable0x54(); |
| 63 | + virtual LegoBool32 VTable0x58() = 0; |
| 64 | + virtual LegoS32 VTable0x5c() = 0; |
| 65 | + virtual LegoBool32 VTable0x60() = 0; |
| 66 | + |
| 67 | + void FUN_0044b9f0(); |
| 68 | + void FUN_0044bab0(undefined4 p_arg1, undefined4 p_arg2); |
| 69 | + void FUN_0044bad0(const LegoChar* p_str); |
| 70 | + void FUN_0044baf0(undefined2* p_arg1, undefined2* p_arg2); |
| 71 | + undefined2* FUN_0044bb20(); |
| 72 | + undefined2* FUN_0044bb40(); |
| 73 | + void FUN_0044bb60(float p_arg1, float p_arg2, undefined4 p_arg3); |
| 74 | + void FUN_0044bc60(undefined4); |
| 75 | + void FUN_0044bda0(); |
| 76 | + void FUN_0044bdf0(undefined4 p_arg); |
| 77 | + LegoBool32 FUN_0044be10(undefined4); |
| 78 | + undefined2 FUN_0044be70(const LegoChar*); |
| 79 | + |
| 80 | + const LegoBool32 GetUnk0x18() const { return m_unk0x18; } |
| 81 | + void SetUnk0x28(undefined4 p_arg) { m_unk0x28 = p_arg; } |
| 82 | + |
| 83 | + // SYNTHETIC: LEGORACERS 0x0044b920 |
| 84 | + // InputDevice::`scalar deleting destructor' |
| 85 | + |
| 86 | +protected: |
| 87 | + undefined4 m_unk0x04[4]; // 0x04 |
| 88 | + OpalVault0xf0* m_opalVault; // 0x14 |
| 89 | + LegoBool32 m_unk0x18; // 0x18 |
| 90 | + undefined4 m_unk0x1c; // 0x1c |
| 91 | + undefined4 m_unk0x20; // 0x20 |
| 92 | + undefined4 m_unk0x24; // 0x24 |
| 93 | + undefined4 m_unk0x28; // 0x28 |
| 94 | + undefined2* m_unk0x2c; // 0x2c |
| 95 | + undefined2* m_unk0x30; // 0x30 |
| 96 | + undefined4 m_unk0x34; // 0x34 |
| 97 | + undefined4 m_unk0x38; // 0x38 |
| 98 | + undefined4 m_unk0x3c; // 0x3c |
| 99 | + undefined4 m_unk0x40; // 0x40 |
| 100 | + undefined4 m_unk0x44; // 0x44 |
| 101 | + undefined4 m_buttonCount; // 0x48 |
| 102 | + undefined4 m_axisCount; // 0x4c |
| 103 | + LegoS32 m_unk0x50; // 0x50 |
| 104 | + undefined4 m_devSubType; // 0x54 |
| 105 | + undefined4 m_devType; // 0x58 |
| 106 | + undefined4 m_unk0x5c; // 0x5c |
| 107 | + LegoChar m_unk0x60[32]; // 0x60 |
| 108 | + undefined m_unk0x80[0x90 - 0x80]; // 0x80 |
| 109 | + undefined4 m_unk0x90; // 0x90 |
| 110 | + undefined2* m_unk0x94; // 0x94 |
| 111 | + InputCallback* m_callback; // 0x98 |
| 112 | +}; |
| 113 | + |
| 114 | +#include "compat.h" |
| 115 | + |
| 116 | +#include <dinput.h> |
| 117 | +#include <windows.h> |
| 118 | + |
| 119 | +#endif // INPUTDEVICE_H |
0 commit comments