Isle
Loading...
Searching...
No Matches
legoinputmanager.cpp
Go to the documentation of this file.
1#include "legoinputmanager.h"
2
5#include "legomain.h"
6#include "legoutils.h"
7#include "legovideomanager.h"
8#include "legoworld.h"
9#include "misc.h"
10#include "mxautolock.h"
11#include "mxdebug.h"
12#include "roi/legoroi.h"
13
18
19// GLOBAL: LEGO1 0x100f31b0
21
22// GLOBAL: LEGO1 0x100f31b4
23const char* g_unk0x100f31b4 = NULL;
24
25// GLOBAL: LEGO1 0x100f67b8
27
28// FUNCTION: LEGO1 0x1005b790
30{
31 m_keyboardNotifyList = NULL;
32 m_world = NULL;
33 m_camera = NULL;
34 m_eventQueue = NULL;
35 m_unk0x80 = FALSE;
36 m_autoDragTimerID = 0;
37 m_x = 0;
38 m_y = 0;
39 m_controlManager = NULL;
40 m_unk0x81 = FALSE;
41 m_unk0x88 = FALSE;
42 m_directInput = NULL;
43 m_directInputDevice = NULL;
44 m_kbStateSuccess = FALSE;
45 m_unk0x195 = 0;
46 m_joyid = -1;
47 m_joystickIndex = -1;
48 m_useJoystick = FALSE;
49 m_unk0x335 = FALSE;
50 m_unk0x336 = FALSE;
51 m_unk0x74 = 0x19;
52 m_autoDragTime = 1000;
53}
54
55// FUNCTION: LEGO1 0x1005b8f0
57{
58 Destroy();
59}
60
61// FUNCTION: LEGO1 0x1005b960
63{
64 MxResult result = SUCCESS;
65
66 m_controlManager = new LegoControlManager;
67
68 if (!m_keyboardNotifyList) {
69 m_keyboardNotifyList = new LegoNotifyList;
70 }
71
72 if (!m_eventQueue) {
73 m_eventQueue = new LegoEventQueue;
74 }
75
78
79 if (!m_keyboardNotifyList || !m_eventQueue || !m_directInputDevice) {
80 Destroy();
81 result = FAILURE;
82 }
83
84 return result;
85}
86
87// FUNCTION: LEGO1 0x1005bfe0
89{
90 ReleaseDX();
91
92 if (m_keyboardNotifyList) {
93 delete m_keyboardNotifyList;
94 }
95 m_keyboardNotifyList = NULL;
96
97 if (m_eventQueue) {
98 delete m_eventQueue;
99 }
100 m_eventQueue = NULL;
101
102 if (m_controlManager) {
103 delete m_controlManager;
104 }
105}
106
107// FUNCTION: LEGO1 0x1005c030
108// FUNCTION: BETA10 0x10088f6e
110{
111 HINSTANCE hinstance = (HINSTANCE) GetWindowLong(p_hwnd, GWL_HINSTANCE);
112
113 // 0x500 for DX5
114 if (DirectInputCreate(hinstance, 0x500, &m_directInput, NULL) == DI_OK) {
115 if (m_directInput->CreateDevice(GUID_SysKeyboard, &m_directInputDevice, NULL) == DI_OK) {
116 m_directInputDevice->SetCooperativeLevel(p_hwnd, DISCL_NONEXCLUSIVE | DISCL_FOREGROUND);
117 m_directInputDevice->SetDataFormat(&c_dfDIKeyboard);
118 if (m_directInputDevice->Acquire()) {
119 MxTrace("Can't acquire the keyboard!\n");
120 }
121 }
122 }
123}
124
125// FUNCTION: LEGO1 0x1005c0a0
127{
128 if (m_directInputDevice != NULL) {
129 m_directInputDevice->Unacquire();
130 m_directInputDevice->Release();
131 m_directInputDevice = NULL;
132 }
133
134 if (m_directInput != NULL) {
135 m_directInput->Release();
136 m_directInput = NULL;
137 }
138}
139
140// FUNCTION: LEGO1 0x1005c0f0
142{
143 m_kbStateSuccess = FALSE;
144
145 if (m_directInputDevice) {
146 HRESULT hr = m_directInputDevice->GetDeviceState(sizeOfArray(m_keyboardState), &m_keyboardState);
147
148 if (hr == DIERR_INPUTLOST || hr == DIERR_NOTACQUIRED) {
149 if (m_directInputDevice->Acquire() == S_OK) {
150 hr = m_directInputDevice->GetDeviceState(sizeOfArray(m_keyboardState), &m_keyboardState);
151 }
152 }
153
154 if (hr == S_OK) {
155 m_kbStateSuccess = TRUE;
156 }
157 }
158}
159
160// FUNCTION: LEGO1 0x1005c160
162{
164
165 if (!m_kbStateSuccess) {
166 return FAILURE;
167 }
168
169 if (g_unk0x100f67b8) {
170 if (m_keyboardState[DIK_LEFT] & 0x80 && GetAsyncKeyState(VK_LEFT) == 0) {
171 m_keyboardState[DIK_LEFT] = 0;
172 }
173
174 if (m_keyboardState[DIK_RIGHT] & 0x80 && GetAsyncKeyState(VK_RIGHT) == 0) {
175 m_keyboardState[DIK_RIGHT] = 0;
176 }
177 }
178
179 MxU32 keyFlags = 0;
180
181 if ((m_keyboardState[DIK_NUMPAD8] | m_keyboardState[DIK_UP]) & 0x80) {
182 keyFlags |= c_up;
183 }
184
185 if ((m_keyboardState[DIK_NUMPAD2] | m_keyboardState[DIK_DOWN]) & 0x80) {
186 keyFlags |= c_down;
187 }
188
189 if ((m_keyboardState[DIK_NUMPAD4] | m_keyboardState[DIK_LEFT]) & 0x80) {
190 keyFlags |= c_left;
191 }
192
193 if ((m_keyboardState[DIK_NUMPAD6] | m_keyboardState[DIK_RIGHT]) & 0x80) {
194 keyFlags |= c_right;
195 }
196
197 if ((m_keyboardState[DIK_LCONTROL] | m_keyboardState[DIK_RCONTROL]) & 0x80) {
198 keyFlags |= c_ctrl;
199 }
200
201 p_keyFlags = keyFlags;
202
203 return SUCCESS;
204}
205
206// FUNCTION: LEGO1 0x1005c240
208{
209 JOYINFOEX joyinfoex;
210
211 if (m_useJoystick != FALSE) {
212 MxS32 joyid = m_joystickIndex;
213 if (joyid >= 0) {
214 joyinfoex.dwSize = 0x34;
215 joyinfoex.dwFlags = 0xFF;
216
217 if (joyGetPosEx(joyid, &joyinfoex) == JOYERR_NOERROR &&
218 joyGetDevCaps(joyid, &m_joyCaps, 0x194) == JOYERR_NOERROR) {
219 m_joyid = joyid;
220 return SUCCESS;
221 }
222 }
223
224 for (joyid = JOYSTICKID1; joyid < 16; joyid++) {
225 joyinfoex.dwSize = 0x34;
226 joyinfoex.dwFlags = 0xFF;
227 if (joyGetPosEx(joyid, &joyinfoex) == JOYERR_NOERROR &&
228 joyGetDevCaps(joyid, &m_joyCaps, 0x194) == JOYERR_NOERROR) {
229 m_joyid = joyid;
230 return SUCCESS;
231 }
232 }
233 }
234
235 return FAILURE;
236}
237
238// FUNCTION: LEGO1 0x1005c320
240 MxU32* p_joystickX,
241 MxU32* p_joystickY,
242 DWORD* p_buttonsState,
243 MxU32* p_povPosition
244)
245{
246 if (m_useJoystick != FALSE) {
247 if (m_joyid < 0 && GetJoystickId() == -1) {
248 m_useJoystick = FALSE;
249 return FAILURE;
250 }
251
252 JOYINFOEX joyinfoex;
253 joyinfoex.dwSize = 0x34;
254 joyinfoex.dwFlags = JOY_RETURNX | JOY_RETURNY | JOY_RETURNBUTTONS;
255 MxU32 capabilities = m_joyCaps.wCaps;
256
257 if ((capabilities & JOYCAPS_HASPOV) != 0) {
258 joyinfoex.dwFlags = JOY_RETURNX | JOY_RETURNY | JOY_RETURNPOV | JOY_RETURNBUTTONS;
259
260 if ((capabilities & JOYCAPS_POVCTS) != 0) {
261 joyinfoex.dwFlags = JOY_RETURNX | JOY_RETURNY | JOY_RETURNPOV | JOY_RETURNBUTTONS | JOY_RETURNPOVCTS;
262 }
263 }
264
265 MMRESULT mmresult = joyGetPosEx(m_joyid, &joyinfoex);
266
267 if (mmresult == MMSYSERR_NOERROR) {
268 *p_buttonsState = joyinfoex.dwButtons;
269 MxU32 xmin = m_joyCaps.wXmin;
270 MxU32 ymax = m_joyCaps.wYmax;
271 MxU32 ymin = m_joyCaps.wYmin;
272 MxS32 ydiff = ymax - ymin;
273 *p_joystickX = ((joyinfoex.dwXpos - xmin) * 100) / (m_joyCaps.wXmax - xmin);
274 *p_joystickY = ((joyinfoex.dwYpos - m_joyCaps.wYmin) * 100) / ydiff;
275 if ((m_joyCaps.wCaps & (JOYCAPS_POV4DIR | JOYCAPS_POVCTS)) != 0) {
276 if (joyinfoex.dwPOV == JOY_POVCENTERED) {
277 *p_povPosition = (MxU32) -1;
278 return SUCCESS;
279 }
280 *p_povPosition = joyinfoex.dwPOV / 100;
281 return SUCCESS;
282 }
283 else {
284 *p_povPosition = (MxU32) -1;
285 return SUCCESS;
286 }
287 }
288 }
289
290 return FAILURE;
291}
292
293// FUNCTION: LEGO1 0x1005c470
295{
296 AUTOLOCK(m_criticalSection);
297
298 LegoNotifyListCursor cursor(m_keyboardNotifyList);
299 if (!cursor.Find(p_notify)) {
300 m_keyboardNotifyList->Append(p_notify);
301 }
302}
303
304// FUNCTION: LEGO1 0x1005c5c0
306{
307 AUTOLOCK(m_criticalSection);
308
309 LegoNotifyListCursor cursor(m_keyboardNotifyList);
310 if (cursor.Find(p_notify)) {
311 cursor.Detach();
312 }
313}
314
315// FUNCTION: LEGO1 0x1005c700
317{
318 m_camera = p_camera;
319}
320
321// FUNCTION: LEGO1 0x1005c710
323{
324 m_camera = NULL;
325}
326
327// FUNCTION: LEGO1 0x1005c720
328// FUNCTION: BETA10 0x100896b8
330{
331 m_world = p_world;
332}
333
334// FUNCTION: LEGO1 0x1005c730
335// FUNCTION: BETA10 0x100896dc
337{
338 m_world = NULL;
339}
340
341// FUNCTION: LEGO1 0x1005c740
342void LegoInputManager::QueueEvent(NotificationId p_id, MxU8 p_modifier, MxLong p_x, MxLong p_y, MxU8 p_key)
343{
344 LegoEventNotificationParam param = LegoEventNotificationParam(p_id, NULL, p_modifier, p_x, p_y, p_key);
345
346 if (((!m_unk0x88) || ((m_unk0x335 && (param.GetNotification() == c_notificationButtonDown)))) ||
347 ((m_unk0x336 && (p_key == VK_SPACE)))) {
348 ProcessOneEvent(param);
349 }
350}
351
352// FUNCTION: LEGO1 0x1005c820
354{
355 AUTOLOCK(m_criticalSection);
356
358 while (m_eventQueue->Dequeue(event)) {
359 if (ProcessOneEvent(event)) {
360 break;
361 }
362 }
363}
364
365// FUNCTION: LEGO1 0x1005c9c0
367{
368 MxBool processRoi;
369
370 if (p_param.GetNotification() == c_notificationKeyPress) {
371 if (!Lego()->IsPaused() || p_param.GetKey() == VK_PAUSE) {
372 if (p_param.GetKey() == VK_SHIFT) {
373 if (m_unk0x195) {
374 m_unk0x80 = FALSE;
376
377 if (m_camera) {
378 m_camera->Notify(p_param);
379 }
380 }
381
382 m_unk0x195 = !m_unk0x195;
383 return TRUE;
384 }
385
386 LegoNotifyListCursor cursor(m_keyboardNotifyList);
387 MxCore* target;
388
389 while (cursor.Next(target)) {
390 if (target->Notify(p_param) != 0) {
391 return TRUE;
392 }
393 }
394 }
395 }
396 else {
397 if (!Lego()->IsPaused()) {
398 processRoi = TRUE;
399
400 if (m_unk0x335 != 0) {
401 if (p_param.GetNotification() == c_notificationButtonDown) {
402 LegoEventNotificationParam notification(c_notificationKeyPress, NULL, 0, 0, 0, VK_SPACE);
403 LegoNotifyListCursor cursor(m_keyboardNotifyList);
404 MxCore* target;
405
406 while (cursor.Next(target)) {
407 if (target->Notify(notification) != 0) {
408 return TRUE;
409 }
410 }
411 }
412
413 return TRUE;
414 }
415
416 if (m_unk0x195 && p_param.GetNotification() == c_notificationButtonDown) {
417 m_unk0x195 = 0;
418 return TRUE;
419 }
420
421 if (m_world != NULL && m_world->Notify(p_param) != 0) {
422 return TRUE;
423 }
424
425 if (p_param.GetNotification() == c_notificationButtonDown) {
426 MxPresenter* presenter = VideoManager()->GetPresenterAt(p_param.GetX(), p_param.GetY());
427
428 if (presenter) {
429 if (presenter->GetDisplayZ() < 0) {
430 processRoi = FALSE;
431
432 if (m_controlManager->FUN_10029210(p_param, presenter)) {
433 return TRUE;
434 }
435 }
436 else {
437 LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY());
438
439 if (roi == NULL && m_controlManager->FUN_10029210(p_param, presenter)) {
440 return TRUE;
441 }
442 }
443 }
444 }
445 else if (p_param.GetNotification() == c_notificationButtonUp) {
446 if (g_unk0x100f31b0 != -1 || m_controlManager->GetUnknown0x10() ||
447 m_controlManager->GetUnknown0x0c() == 1) {
448 MxBool result = m_controlManager->FUN_10029210(p_param, NULL);
450
451 m_unk0x80 = FALSE;
452 m_unk0x81 = FALSE;
453 return result;
454 }
455 }
456
457 if (FUN_1005cdf0(p_param)) {
458 if (processRoi && p_param.GetNotification() == c_notificationClick) {
459 LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY());
460 p_param.SetROI(roi);
461
462 if (roi && roi->GetVisibility() == TRUE) {
463 for (OrientableROI* parent = roi->GetParentROI(); parent; parent = parent->GetParentROI()) {
464 roi = (LegoROI*) parent;
465 }
466
467 LegoEntity* entity = roi->GetEntity();
468 if (entity && entity->Notify(p_param) != 0) {
469 return TRUE;
470 }
471 }
472 }
473
474 if (m_camera && m_camera->Notify(p_param) != 0) {
475 return TRUE;
476 }
477 }
478 }
479 }
480
481 return FALSE;
482}
483
484// FUNCTION: LEGO1 0x1005cdf0
485// FUNCTION: BETA10 0x10089cc1
487{
488 MxBool result = FALSE;
489
490 switch (p_param.GetNotification()) {
492 m_x = p_param.GetX();
493 m_y = p_param.GetY();
494 m_unk0x80 = FALSE;
495 m_unk0x81 = TRUE;
497 break;
500
501 if (m_unk0x80) {
503 result = TRUE;
504 }
505 else if (m_unk0x81) {
506 p_param.SetX(m_x);
507 p_param.SetY(m_y);
509 result = TRUE;
510 }
511
512 m_unk0x80 = FALSE;
513 m_unk0x81 = FALSE;
514 break;
516 if (m_unk0x195) {
518 }
519
520 if ((m_unk0x195 || m_unk0x81) && p_param.GetModifier() & LegoEventNotificationParam::c_lButtonState) {
521 if (!m_unk0x80) {
522 if (m_unk0x195) {
523 m_x = p_param.GetX();
524 m_y = p_param.GetY();
525 }
526
527 MxS32 diffX = p_param.GetX() - m_x;
528 MxS32 diffY = p_param.GetY() - m_y;
529 MxS32 t = diffX * diffX + diffY * diffY;
530
531 if (m_unk0x195 || t > m_unk0x74) {
533 m_unk0x80 = TRUE;
535 result = TRUE;
536 p_param.SetX(m_x);
537 p_param.SetY(m_y);
538 }
539 }
540 else {
542 result = TRUE;
543 }
544 }
545 break;
547 if (p_param.GetModifier() == m_autoDragTimerID) {
549
550 if (m_unk0x81) {
551 m_unk0x80 = TRUE;
552 p_param.SetX(m_x);
553 p_param.SetY(m_y);
556 result = TRUE;
557 }
558 else {
559 m_unk0x80 = FALSE;
560 }
561 }
562 break;
563 }
564
565 return result;
566}
567
568// FUNCTION: LEGO1 0x1005cfb0
569// FUNCTION: BETA10 0x10089fc5
571{
572 m_autoDragTimerID = ::SetTimer(LegoOmni::GetInstance()->GetWindowHandle(), 1, m_autoDragTime, NULL);
573}
574
575// FUNCTION: LEGO1 0x1005cfd0
576// FUNCTION: BETA10 0x1008a005
578{
579 if (m_autoDragTimerID) {
580 ::KillTimer(LegoOmni::GetInstance()->GetWindowHandle(), m_autoDragTimerID);
581 }
582}
583
584// FUNCTION: LEGO1 0x1005cff0
586{
587 m_unk0x88 = FALSE;
588 g_unk0x100f31b0 = -1;
590}
Camera controller for 3D scenes, handles interactive camera manipulation and view transformation.
MxLong Notify(MxParam &p_param) override
Handles notifications for camera-relevant events (like mouse drag and mouse clicks).
[AI] Manages control presenters and dispatches notifications for control/input events within the LEGO...
undefined4 GetUnknown0x0c()
[AI] Gets the internal flag at offset 0x0c.
undefined GetUnknown0x10()
[AI] Gets the internal flag at offset 0x10.
MxBool FUN_10029210(LegoEventNotificationParam &p_param, MxPresenter *p_presenter)
[AI] Handles event notification logic, taking an event and possibly updating the manager/presenter st...
[AI] Represents an entity that can be placed and managed in the LEGO Island world.
Definition: legoentity.h:16
MxLong Notify(MxParam &p_param) override
[AI] Handles event notification for the entity, most notably user clicks, using polymorphic dispatch.
Definition: legoentity.cpp:466
Notification parameter class for LEGO event notifications such as mouse events and modifier keys.
MxS32 GetY() const
Returns Y (vertical) coordinate for the event, usually screen-relative in pixels.
void SetX(MxS32 p_x)
Sets the X (horizontal) coordinate for the event.
MxU8 GetModifier()
Returns modifier bitmask for this event (mouse/keyboard state).
void SetY(MxS32 p_y)
Sets the Y (vertical) coordinate for the event.
MxU8 GetKey() const
Returns the keycode for this event, or 0 if not used.
MxS32 GetX() const
Returns X (horizontal) coordinate for the event, usually screen-relative in pixels.
void SetModifier(MxU8 p_modifier)
Sets the modifier state bitmask for the event.
void SetROI(LegoROI *p_roi)
Sets the ROI reference (object involved in the event).
[AI] Event queue for processing Lego input (mouse/keyboard/joystick) events.[AI] Queue of input event...
[AI] Handles keyboard, mouse, and joystick input for the game.
void ClearCamera()
[AI] Remove any assigned camera controller, disabling camera navigation responses....
void GetKeyboardState()
[AI] Polls DirectInput for current keyboard state. Updates m_keyboardState and success flag....
MxBool FUN_1005cdf0(LegoEventNotificationParam &p_param)
[AI] Complex drag/click/timer event filter.
~LegoInputManager() override
[AI] Clean up and release all acquired input devices, notification lists, control managers,...
MxResult GetNavigationKeyStates(MxU32 &p_keyFlags)
[AI] Retrieves current navigation (arrow) key status from the keyboard, combining keypad and arrow ke...
void QueueEvent(NotificationId p_id, MxU8 p_modifier, MxLong p_x, MxLong p_y, MxU8 p_key)
[AI] Add an input event (for mouse, keyboard, or joystick) to the processing queue,...
MxResult Create(HWND p_hwnd)
[AI] Set up DirectInput and joystick state, instantiate controller and notification list.
void EnableInputProcessing()
[AI] Enable event queue and input event processing. Resets relevant state. [AI]
void UnRegister(MxCore *)
[AI] Unregister a previously registered recipient so it will no longer receive input notifications.
void ClearWorld()
[AI] Remove any world assignment (used to clear targeting/scene changes). [AI]
MxBool ProcessOneEvent(LegoEventNotificationParam &p_param)
[AI] Processes a single input event (key, mouse click, drag, etc.), sending it to appropriate targets...
void StopAutoDragTimer()
[AI] Stop the running auto drag timer if any. [AI]
void StartAutoDragTimer()
[AI] Start the Windows timer used for distinguishing auto drag events during mouse interaction....
MxResult GetJoystickState(MxU32 *p_joystickX, MxU32 *p_joystickY, DWORD *p_buttonsState, MxU32 *p_povPosition)
[AI] Retrieve state of the currently assigned joystick device and normalized position/button state.
@ c_up
[AI] Up arrow key or equivalent key [AI]
@ c_left
[AI] Left arrow key or equivalent key [AI]
@ c_right
[AI] Right arrow key or equivalent key [AI]
@ c_ctrl
[AI] Control key [AI]
@ c_down
[AI] Down arrow key or equivalent key [AI]
void SetCamera(LegoCameraController *p_camera)
[AI] Assigns a new camera controller for mouse/look operations.
MxResult GetJoystickId()
[AI] Scan for valid joystick ID based on preferred index or check all available joysticks.
void ReleaseDX()
[AI] Unacquire and release all DirectInput device interfaces (keyboard). [AI]
void ProcessEvents()
[AI] Dispatch processing of all queued input events until the queue is empty or processing requests e...
void CreateAndAcquireKeyboard(HWND p_hwnd)
[AI] Create keyboard input device and acquire focus for the given window handle.
void SetWorld(LegoWorld *p_world)
[AI] Assigns the current world to receive mouse/click/pick notifications.
void Register(MxCore *)
[AI] Register a core object as a recipient for keyboard events; safe for concurrent multi-threading.
void Destroy() override
[AI] Release all allocated DirectInput devices, notification lists, event queues, and control manager...
[AI] Cursor (iterator) for traversing a LegoNotifyList. Used to find or detach notification targets....
[AI] A list of notification targets (MxCore*) interested in input events (primarily keyboard).
static LegoOmni * GetInstance()
[AI] Returns the current LegoOmni singleton pointer, cast from MxOmni.
Definition: legomain.cpp:305
[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.
Definition: legoroi.h:43
LegoEntity * GetEntity()
[AI] Gets the entity associated with this ROI (or NULL).
Definition: legoroi.h:293
virtual MxPresenter * GetPresenterAt(MxS32 p_x, MxS32 p_y)
[AI] Finds a presenter at the specific screen coordinates (for hit testing).
Represents the active 3D world, holding all entity, animation, sound, path, and ROI objects.
Definition: legoworld.h:49
MxLong Notify(MxParam &p_param) override
Notification callback responding to registered events such as EndAction and NewPresenter.
Definition: legoworld.cpp:212
[AI] Base virtual class for all Mindscape engine (Mx) objects.
Definition: mxcore.h:15
virtual MxLong Notify(MxParam &p_param)
[AI] Virtual callback notification mechanism.
Definition: mxcore.cpp:25
MxBool Next()
[AI]
void Detach()
[AI]
MxBool Find(T p_obj)
[AI]
void Append(T p_obj)
[AI]
Definition: mxlist.h:100
NotificationId GetNotification() const
[AI] Retrieves the current notification type of this parameter.
void SetNotification(NotificationId p_type)
[AI] Sets the notification type for this parameter object.
[AI] Abstract base class for all presenter types in the LEGO Island engine, responsible for managing ...
Definition: mxpresenter.h:20
MxS32 GetDisplayZ() const
[AI] Returns the display Z (depth) order.
Definition: mxpresenter.h:172
MxBool Dequeue(T &p_obj)
Removes the object from the front of the queue and copies it to p_obj.
Definition: mxqueue.h:23
[AI] Represents an ROI (Real-time Object Instance) that can be oriented in world space,...
Definition: orientableroi.h:29
OrientableROI * GetParentROI() const
Accessor for the parent ROI in the transformation hierarchy.
unsigned char GetVisibility()
[AI] Returns the visibility flag; true if visible, false if hidden.
Definition: roi.h:228
#define TRUE
Definition: d3drmdef.h:28
#define FALSE
Definition: d3drmdef.h:27
typedef DWORD(FAR PASCAL *LPCLIPPERCALLBACK)(LPDIRECTDRAWCLIPPER lpDDClipper
long HRESULT
Definition: ddraw.h:115
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
#define sizeOfArray(arr)
Definition: decomp.h:23
#define DIK_NUMPAD6
Definition: dinput.h:1139
#define DIK_NUMPAD4
Definition: dinput.h:1137
#define DIK_LCONTROL
Definition: dinput.h:1091
#define DISCL_FOREGROUND
Definition: dinput.h:624
#define DIK_NUMPAD2
Definition: dinput.h:1142
#define DIK_DOWN
Definition: dinput.h:1178
#define DIK_RCONTROL
Definition: dinput.h:1167
#define DIK_NUMPAD8
Definition: dinput.h:1134
#define DirectInputCreate
Definition: dinput.h:1487
#define DIERR_NOTACQUIRED
Definition: dinput.h:1661
const DIDATAFORMAT c_dfDIKeyboard
#define DI_OK
Definition: dinput.h:1502
#define DIERR_INPUTLOST
Definition: dinput.h:1649
#define DIK_LEFT
Definition: dinput.h:1175
#define DISCL_NONEXCLUSIVE
Definition: dinput.h:623
#define DIK_UP
Definition: dinput.h:1173
#define DIK_RIGHT
Definition: dinput.h:1176
MxS32 g_unk0x100f31b0
[AI] Global variable used for tracking drag state, -1 if inactive. [AI]
const char * g_unk0x100f31b4
[AI] Global pointer for additional drag state/context (purpose unclear). [AI]
MxBool g_unk0x100f67b8
MxS32 g_unk0x100f31b0
[AI] Global variable used for tracking drag state, -1 if inactive. [AI]
const char * g_unk0x100f31b4
[AI] Global pointer for additional drag state/context (purpose unclear). [AI]
#define NULL
[AI] Null pointer value (C/C++ semantics).
Definition: legotypes.h:26
#define FAILURE
[AI] Used to indicate a failed operation in result codes.
Definition: legotypes.h:34
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
Definition: legotypes.h:30
LegoROI * PickROI(MxLong p_x, MxLong p_y)
[AI] Picks the ROI (Renderable Object Instance) at screen coordinates.
Definition: legoutils.cpp:39
LegoVideoManager * VideoManager()
[AI] Accessor for the game's LegoVideoManager subsystem. Used for managing 3D/video hardware....
Definition: misc.cpp:29
LegoOmni * Lego()
[AI] Retrieves the global LegoOmni singleton instance, providing access to core subsystems.
Definition: misc.cpp:16
#define AUTOLOCK(CS)
[AI] Macro for automatic locking using the MxAutoLock class. This macro instantiates an MxAutoLock ob...
Definition: mxautolock.h:5
#define MxTrace(args)
[AI] Macro for trace logging (non-variadic version, MSVC compatibility), expands to nothing.
Definition: mxdebug.h:55
NotificationId
Several of those should be defined in LegoOmni.
@ c_notificationTimer
[AI] Timer-related event [AI]
@ c_notificationDragEnd
[AI] End of drag event [AI]
@ c_notificationButtonUp
[AI] Mouse/gamepad button release [AI]
@ c_notificationButtonDown
[AI] Mouse/gamepad button press [AI]
@ c_notificationDragStart
[AI] Start of a drag event (mouse/touch) [AI]
@ c_notificationDrag
[AI] Ongoing drag/move event [AI]
@ c_notificationMouseMove
[AI] Mouse movement event [AI]
@ c_notificationKeyPress
[AI] Keyboard key press detected [AI]
@ c_notificationClick
[AI] Mouse click event [AI]
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
int MxLong
[AI]
Definition: mxtypes.h:83
unsigned char MxU8
[AI]
Definition: mxtypes.h:8
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned int MxU32
[AI]
Definition: mxtypes.h:32