Isle
Loading...
Searching...
No Matches
registrationbook.cpp
Go to the documentation of this file.
1#include "registrationbook.h"
2
3#include "copter_actions.h"
4#include "dunebuggy.h"
5#include "dunecar_actions.h"
6#include "helicopter.h"
7#include "infocenter.h"
8#include "isle.h"
9#include "jetski.h"
10#include "jetski_actions.h"
11#include "jukebox_actions.h"
12#include "legocontrolmanager.h"
13#include "legogamestate.h"
14#include "legoinputmanager.h"
15#include "legopathstruct.h"
16#include "legoutils.h"
17#include "misc.h"
20#include "mxcontrolpresenter.h"
21#include "mxdisplaysurface.h"
22#include "mxmisc.h"
24#include "mxstillpresenter.h"
25#include "mxtimer.h"
26#include "mxtransitionmanager.h"
27#include "racecar.h"
28#include "racecar_actions.h"
29#include "regbook_actions.h"
30#include "scripts.h"
31
33
34// GLOBAL: LEGO1 0x100d9924
35// GLOBAL: BETA10 0x101bfb3c
36const char* g_infoman = "infoman";
37
38// GLOBAL: LEGO1 0x100f7964
40
41// GLOBAL: LEGO1 0x100f7968
43
44// FUNCTION: LEGO1 0x10076d20
45RegistrationBook::RegistrationBook() : m_registerDialogueTimer(0x80000000), m_unk0xfc(1)
46{
47 memset(m_alphabet, 0, sizeof(m_alphabet));
48 memset(m_name, 0, sizeof(m_name));
49 m_unk0x280.m_cursorPos = 0;
50
51 memset(m_checkmark, 0, sizeof(m_checkmark));
52 memset(&m_unk0x280, -1, sizeof(m_unk0x280) - 2);
53
54 m_unk0x2b8 = 0;
55 m_infocenterState = NULL;
56
58
59 m_unk0x2c1 = FALSE;
60 m_checkboxHilite = NULL;
61 m_checkboxSurface = NULL;
62 m_checkboxNormal = NULL;
63}
64
65// FUNCTION: LEGO1 0x10076f50
67{
68 for (MxS16 i = 0; i < 10; i++) {
69 for (MxS16 j = 0; j < 7; j++) {
70 if (m_name[i][j] != NULL) {
71 delete m_name[i][j]->GetAction();
72 delete m_name[i][j];
73 m_name[i][j] = NULL;
74 }
75 }
76 }
77
78 InputManager()->UnRegister(this);
79 if (InputManager()->GetWorld() == this) {
81 }
82
85
86 if (m_checkboxNormal) {
87 m_checkboxNormal->Release();
88 }
89}
90
91// FUNCTION: LEGO1 0x10077060
93{
94 MxResult result = LegoWorld::Create(p_dsAction);
95
96 if (result == SUCCESS) {
97 InputManager()->SetWorld(this);
98 ControlManager()->Register(this);
100 InputManager()->Register(this);
101
104
105 m_infocenterState = (InfocenterState*) GameState()->GetState("InfocenterState");
106 }
107
108 return result;
109}
110
111// FUNCTION: LEGO1 0x100770e0
112// FUNCTION: BETA10 0x100f2d98
114{
115 MxNotificationParam& param = (MxNotificationParam&) p_param;
116 MxLong result = 0;
117 LegoWorld::Notify(p_param);
118
119 if (m_worldStarted) {
120 switch (param.GetNotification()) {
122 result = HandleEndAction((MxEndActionNotificationParam&) p_param);
123 break;
125 m_registerDialogueTimer = Timer()->GetTime();
126 result = HandleKeyPress(((LegoEventNotificationParam&) p_param).GetKey());
127 break;
129 m_registerDialogueTimer = Timer()->GetTime();
130 break;
132 result = HandleControl((LegoControlManagerNotificationParam&) p_param);
133 break;
135 result = HandlePathStruct((LegoPathStructNotificationParam&) p_param);
136 break;
139 break;
140 }
141 }
142
143 return result;
144}
145
146// FUNCTION: LEGO1 0x10077210
147MxLong RegistrationBook::HandleEndAction(MxEndActionNotificationParam& p_param)
148{
149 if (p_param.GetAction()->GetAtomId() != m_atomId) {
150 return 0;
151 }
152
153 switch ((MxS32) p_param.GetAction()->GetObjectId()) {
155 m_unk0x2c1 = FALSE;
156
157 if (m_unk0x2b8 == 0) {
159 }
160 break;
165 m_registerDialogueTimer = Timer()->GetTime();
166 break;
167 }
168
169 return 1;
170}
171
172// FUNCTION: LEGO1 0x100772d0
173MxLong RegistrationBook::HandleKeyPress(MxU8 p_key)
174{
175 MxS16 key;
176 if (p_key >= 'a' && p_key <= 'z') {
177 key = p_key - ' ';
178 }
179 else {
180 key = p_key;
181 }
182
183 if ((key < 'A' || key > 'Z') && key != VK_BACK) {
184 if (key == VK_SPACE) {
187 }
188 }
189 else if (key != VK_BACK && m_unk0x280.m_cursorPos < 7) {
190 m_name[0][m_unk0x280.m_cursorPos] = m_alphabet[key - 'A']->Clone();
191
192 if (m_name[0][m_unk0x280.m_cursorPos] != NULL) {
193 m_alphabet[key - 'A']->GetAction()->SetUnknown24(m_alphabet[key - 'A']->GetAction()->GetUnknown24() + 1);
194 m_name[0][m_unk0x280.m_cursorPos]->Enable(TRUE);
195 m_name[0][m_unk0x280.m_cursorPos]->SetTickleState(MxPresenter::e_repeating);
196 m_name[0][m_unk0x280.m_cursorPos]->SetPosition(m_unk0x280.m_cursorPos * 23 + 343, 121);
197
198 if (m_unk0x280.m_cursorPos == 0) {
199 m_checkmark[0]->Enable(TRUE);
200 }
201
202 m_unk0x280.m_letters[m_unk0x280.m_cursorPos] = key - 'A';
203 m_unk0x280.m_cursorPos++;
204 }
205 }
206 else {
207 if (key == VK_BACK && m_unk0x280.m_cursorPos > 0) {
208 m_unk0x280.m_cursorPos--;
209
210 m_name[0][m_unk0x280.m_cursorPos]->Enable(FALSE);
211
212 delete m_name[0][m_unk0x280.m_cursorPos];
213 m_name[0][m_unk0x280.m_cursorPos] = NULL;
214
215 if (m_unk0x280.m_cursorPos == 0) {
216 m_checkmark[0]->Enable(FALSE);
217 }
218
219 m_unk0x280.m_letters[m_unk0x280.m_cursorPos] = -1;
220 }
221 }
222
223 return 1;
224}
225
226// FUNCTION: LEGO1 0x100774a0
227MxLong RegistrationBook::HandleControl(LegoControlManagerNotificationParam& p_param)
228{
229 MxS16 unk0x28 = p_param.m_unk0x28;
230
231 if (unk0x28 >= 1 && unk0x28 <= 28) {
233 if (unk0x28 == 28) {
235
236 if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
237 m_infocenterState->m_unk0x74 = 15;
238 }
239 else {
240 m_infocenterState->m_unk0x74 = 2;
241 }
242
244 }
245 else {
246 if (unk0x28 > 28) {
247 return 1;
248 }
249
250 HandleKeyPress(unk0x28 < 27 ? unk0x28 + 64 : 8);
251 }
252 }
253 else {
256
257 MxS16 i;
258 for (i = 0; i < 10; i++) {
259 if (m_checkmark[i]->GetAction()->GetObjectId() == p_param.m_clickedObjectId) {
260 break;
261 }
262 }
263
264 FUN_100775c0(i);
265 }
266 }
267
268 return 1;
269}
270
271// FUNCTION: LEGO1 0x100775c0
272// STUB: BETA10 0x100f32b2
273void RegistrationBook::FUN_100775c0(MxS16 p_playerIndex)
274{
275 if (m_infocenterState->HasRegistered()) {
276 GameState()->Save(0);
277 }
278
279 // TODO: structure incorrect
280 MxS16 player = p_playerIndex == 0 ? GameState()->FindPlayer(*(LegoGameState::Username*) &m_unk0x280.m_letters)
281 : p_playerIndex - 1;
282
283 switch (player) {
284 case 0:
285 if (!m_infocenterState->HasRegistered()) {
287 WriteInfocenterLetters(1);
288 FUN_100778c0();
289 }
290 break;
291 case -1:
292 GameState()->Init();
293
295
296 m_unk0x2c1 = TRUE;
297
298 // TOOD: structure incorrect
299 GameState()->AddPlayer(*(LegoGameState::Username*) &m_unk0x280.m_letters);
300 GameState()->Save(0);
301
302 WriteInfocenterLetters(0);
304 FUN_100778c0();
305 break;
306 default:
307 GameState()->Init();
308
310
311 m_unk0x2c1 = TRUE;
312
313 GameState()->SwitchPlayer(player);
314
315 WriteInfocenterLetters(player + 1);
317 FUN_100778c0();
318 break;
319 }
320
321 m_infocenterState->m_unk0x74 = 4;
322 if (m_unk0x2b8 == 0 && !m_unk0x2c1) {
325 }
326}
327
328// FUNCTION: LEGO1 0x10077860
329void RegistrationBook::WriteInfocenterLetters(MxS16 p_user)
330{
331 for (MxS16 i = 0; i < 7; i++) {
332 delete m_infocenterState->GetNameLetter(i);
333 m_infocenterState->SetNameLetter(i, m_name[p_user][i]);
334 m_name[p_user][i] = NULL;
335 }
336}
337
338// FUNCTION: LEGO1 0x100778c0
339void RegistrationBook::FUN_100778c0()
340{
341 if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
342 Act1State* act1state = (Act1State*) GameState()->GetState("Act1State");
343
344 if (act1state->m_helicopterPlane.IsPresent()) {
347 this,
349 );
350
351 m_unk0x2b8++;
352 }
353
354 if (act1state->m_jetskiPlane.IsPresent()) {
357 this,
359 );
360
361 m_unk0x2b8++;
362 }
363
364 if (act1state->m_dunebuggyPlane.IsPresent()) {
367 this,
369 );
370
371 m_unk0x2b8++;
372 }
373
374 if (act1state->m_racecarPlane.IsPresent()) {
377 this,
379 );
380
381 m_unk0x2b8++;
382 }
383
384 if (m_unk0x2b8 != 0) {
388 }
389 }
390}
391
392// FUNCTION: LEGO1 0x10077cc0
393// FUNCTION: BETA10 0x100f3671
395{
396 // This function is very fragile and appears to oscillate between two versions on small changes.
397 // This even happens for commenting out `assert()` calls, which shouldn't affect release builds at all.
398 // See https://github.com/isledecomp/isle/pull/1375 for a version that had 100 %.
399
400#ifndef BETA10
401 LegoGameState* gameState = GameState();
402 gameState->m_history.WriteScoreHistory();
403#endif
404
406
407 char letterBuffer[] = "A_Bitmap";
408 MxS16 i;
409
410 for (i = 0; i < 26; i++) {
411 // TODO: This might be an inline function.
412 // See also `HistoryBook::ReadyWorld()`.
413 if (i < 26) {
414 m_alphabet[i] = (MxStillPresenter*) Find("MxStillPresenter", letterBuffer);
415 assert(m_alphabet[i]);
416
417 // We need to loop through the entire alphabet,
418 // so increment the first char of the bitmap name
419 letterBuffer[0]++;
420 }
421 }
422
423 // Now we have to do the checkmarks
424 char checkmarkBuffer[] = "Check0_Ctl";
425 for (i = 0; i < 10; i++) {
426 m_checkmark[i] = (MxControlPresenter*) Find("MxControlPresenter", checkmarkBuffer);
427 assert(m_checkmark[i]);
428
429 // Just like in the prior letter loop,
430 // we need to increment the fifth char
431 // to get the next checkmark bitmap
432 checkmarkBuffer[5]++;
433 }
434
436
437 for (i = 1; i <= GameState()->m_playerCount; i++) {
438 for (MxS16 j = 0; j < 7; j++) {
439 if (players[i - 1].m_letters[j] != -1) {
440 if (j == 0) {
441 m_checkmark[i]->Enable(TRUE);
442 }
443
444 // Start building the player names using a two-dimensional array
445 m_name[i][j] = m_alphabet[players[i - 1].m_letters[j]]->Clone();
446
447 assert(m_name[i][j]);
448 // Enable the presenter to actually show the letter in the grid
449 m_name[i][j]->Enable(TRUE);
450
452 m_name[i][j]->SetPosition(23 * j + 343, 27 * i + 121);
453 }
454 }
455 }
456
457#ifdef BETA10
458 InfocenterState* infocenterState = (InfocenterState*) GameState()->GetState("InfocenterState");
459 assert(infocenterState);
460
461 if (infocenterState->HasRegistered())
462#else
463 if (m_infocenterState->HasRegistered())
464#endif
465 {
467
468 LegoROI* infoman = FindROI(g_infoman);
469 if (infoman != NULL) {
470 infoman->SetVisibility(FALSE);
471 }
472 }
473 else {
475 }
476}
477
478// FUNCTION: BETA10 0x100f3424
479inline void RegistrationBook::PlayAction(MxU32 p_objectId)
480{
481 MxDSAction action;
482 action.SetAtomId(*g_regbookScript);
483 action.SetObjectId(p_objectId);
484
486 Start(&action);
487}
488
489// FUNCTION: LEGO1 0x10077fd0
491{
492 if (!m_worldStarted) {
494 }
495 else {
496 MxLong time = Timer()->GetTime();
497 if (m_registerDialogueTimer != 0x80000000 && m_registerDialogueTimer + 30000 <= time) {
498 m_registerDialogueTimer = 0x80000000;
500 }
501
502 if (g_checkboxBlinkTimer + 500 <= time) {
504
505 if (m_checkboxHilite) {
506 DDBLTFX op;
507 op.dwSize = sizeof(op);
508 op.dwROP = SRCCOPY;
509
510 if (g_nextCheckbox) {
511 m_checkboxSurface->Blt(NULL, m_checkboxHilite, NULL, DDBLT_ROP, &op);
512 }
513 else {
514 m_checkboxSurface->Blt(NULL, m_checkboxNormal, NULL, DDBLT_ROP, &op);
515 }
516 }
517 else {
518 CreateSurface();
519 }
520
522 }
523 }
524
525 return SUCCESS;
526}
527
528// FUNCTION: LEGO1 0x10078180
530{
531 LegoWorld::Enable(p_enable);
532
533 if (p_enable) {
534 InputManager()->SetWorld(this);
536 }
537 else {
538 if (InputManager()->GetWorld() == this) {
540 }
541 }
542}
543
544// FUNCTION: LEGO1 0x100781d0
545MxLong RegistrationBook::HandlePathStruct(LegoPathStructNotificationParam& p_param)
546{
547 LegoPathActor* actor = NULL;
548 Act1State* act1state = (Act1State*) GameState()->GetState("Act1State");
549
550 switch (p_param.GetData()) {
553 act1state->m_helicopter = (Helicopter*) actor;
554 if (actor != NULL) {
555 actor->SetAtomId(*g_copterScript);
557 }
558 break;
561 act1state->m_dunebuggy = (DuneBuggy*) actor;
562 if (actor != NULL) {
563 actor->SetAtomId(*g_dunecarScript);
565 }
566 break;
569 act1state->m_jetski = (Jetski*) actor;
570 if (actor != NULL) {
571 actor->SetAtomId(*g_jetskiScript);
573 }
574 break;
577 act1state->m_racecar = (RaceCar*) actor;
578 if (actor != NULL) {
579 actor->SetAtomId(*g_racecarScript);
581 }
582 break;
583 }
584
585 if (actor == NULL) {
586 NotificationManager()->Send(this, p_param);
587 }
588 else {
589 RemoveActor(actor);
590 Remove(actor);
591 m_unk0x2b8--;
592 }
593
594 if (m_unk0x2b8 == 0 && !m_unk0x2c1) {
597 }
598
599 return 1;
600}
601
602// FUNCTION: LEGO1 0x10078350
603MxBool RegistrationBook::CreateSurface()
604{
605 MxCompositePresenterList* presenters = m_checkmark[0]->GetList();
606 MxStillPresenter *presenter, *uninitialized;
607
608 if (presenters) {
609 if (presenters->begin() != presenters->end()) {
610 presenter = (MxStillPresenter*) presenters->front();
611 }
612 else {
613 presenter = uninitialized; // intentionally uninitialized variable
614 }
615
616 if (presenter) {
617 m_checkboxSurface = presenter->VTable0x78();
618 }
619
620 presenter = (MxStillPresenter*) Find("MxStillPresenter", "CheckHiLite_Bitmap");
621 if (presenter) {
622 m_checkboxHilite = presenter->VTable0x78();
623 }
624
625 if (m_checkboxSurface && m_checkboxHilite) {
626 m_checkboxNormal = MxDisplaySurface::CopySurface(m_checkboxSurface);
627 return TRUE;
628 }
629 }
630
631 return FALSE;
632}
633
634// FUNCTION: LEGO1 0x100783e0
636{
638 return TRUE;
639}
[AI] Holds state and transient gameplay data for the first act on Lego Island.
Definition: isle.h:29
DuneBuggy * m_dunebuggy
[AI] Serializable pointer to current dune buggy object (NULL when not held in state)....
Definition: isle.h:158
Helicopter * m_helicopter
[AI] Serializable pointer to current helicopter object (NULL when not held in state)....
Definition: isle.h:137
RaceCar * m_racecar
[AI] Serializable pointer to current racecar object (NULL when not held in state)....
Definition: isle.h:173
LegoNamedPlane m_helicopterPlane
[AI] Serialized/deserialized world placement state for helicopter.
Definition: isle.h:125
LegoNamedPlane m_jetskiPlane
[AI] Placement state for jetski in world (serializable). [AI]
Definition: isle.h:140
LegoNamedPlane m_dunebuggyPlane
[AI] Placement state for dune buggy in world (serializable). [AI]
Definition: isle.h:152
LegoNamedPlane m_racecarPlane
[AI] Placement state for racecar in world (serializable). [AI]
Definition: isle.h:161
Jetski * m_jetski
[AI] Serializable pointer to current jetski object (NULL when not held in state). [AI]
Definition: isle.h:149
[AI] Represents the player-controllable dune buggy vehicle in LEGO Island, inheriting movement and in...
Definition: dunebuggy.h:16
[AI] Represents the flyable helicopter vehicle/path actor in the game, handling all in-game behaviors...
Definition: helicopter.h:57
[AI] Represents the state of the Infocenter area, storing scripts, dialogue playlists and UI letter p...
Definition: infocenter.h:23
void SetNameLetter(MxS32 p_index, MxStillPresenter *p_letter)
[AI] Sets the UI presenter for a specific name letter slot.
Definition: infocenter.h:77
MxBool HasRegistered()
[AI] True if any letter slot is filled (indicating the player has registered).
Definition: infocenter.h:83
MxStillPresenter * GetNameLetter(MxS32 p_index)
[AI] Returns the pointer to the UI presenter for a specific letter in the name field.
Definition: infocenter.h:70
MxU32 m_unk0x74
[AI] State machine variable tracking the Infocenter flow (e.g., 0=intro, 3=NA, 4=goto book,...
Definition: infocenter.h:149
[AI] Represents the jetski vehicle placed in the 3D world of LEGO Island.
Definition: jetski.h:19
[AI] Notification parameter for the LegoControlManager, used to propagate information about control e...
MxS32 m_clickedObjectId
[AI] Object ID of the clicked control/presenter (or -1 if not set). [AI]
MxS16 m_unk0x28
[AI] Undetermined; settable via SetUnknown0x28. [AI]
void Register(MxCore *p_listener)
[AI] Adds a listener to be notified of control events.
void Unregister(MxCore *p_listener)
[AI] Removes a listener so it no longer receives control events.
Notification parameter class for LEGO event notifications such as mouse events and modifier keys.
Comprehensive persistent game state manager: handles save/load, player selection, area switching,...
Definition: legogamestate.h:78
MxS16 m_playerCount
Number of player usernames registered. [AI].
void SwitchPlayer(MxS16 p_playerId)
Make the specified player (by ID/index) the current player.
void SwitchArea(Area p_area)
Switches the whole game state into a new area/world; manages transitions/scene loads.
History m_history
High score table/history for current game. [AI].
void Init()
Re-initializes all world/variable state to the current act's defaults. [AI].
Area m_currentArea
Area/world the player is presently in. [AI].
@ e_act1
Act 1: the first main segment of the game. [AI].
Definition: legogamestate.h:84
void StopArea(Area p_area)
Calls cleanup logic for the specified area (removes actors, VMs, closes handles, etc....
void SerializePlayersInfo(MxS16 p_flags)
Serializes all player info (usernames, player count) to the appropriate storage.
Username m_players[9]
Array of all known player usernames (max 9, ranked). [AI].
MxResult Save(MxULong p_slot)
Saves persistent game state (world variables, actor, etc.) to a file slot.
LegoState * GetState(const char *p_stateName)
Find an existing state (LegoState-derived) object by its registered script/class name.
MxS16 FindPlayer(Username &p_player)
Finds the player index for a username; returns -1 if not found.
@ e_infomain
Information Center, main screen. [AI].
Definition: legogamestate.h:96
@ e_previousArea
Alias: go to previous area. [AI].
Definition: legogamestate.h:94
@ e_regbook
Registration book "new game" area. [AI].
MxResult AddPlayer(Username &p_player)
Adds a new player (username), moves others down, manages slot files.
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]
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 DisableInputProcessing()
[AI] Block most input processing, allowing only button-down and space events (UI modal input blocking...
[AI] An actor that moves along a predefined path, supporting boundary transitions,...
Definition: legopathactor.h:32
[AI] Specialized notification parameter used for path structure related events in LEGO Island.
MxS16 GetData()
[AI] Retrieves the supplemental data associated with the notification.
[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.
Definition: legoroi.h:43
void Remove(MxCore *p_object)
Removes an object from all relevant world-managed lists or sets, and also detaches if needed.
Definition: legoworld.cpp:508
virtual void Enable(MxBool p_enable)
Enables or disables (pauses) the world and its main components.
Definition: legoworld.cpp:684
MxResult Tickle() override
Main world tick/update, especially manages startup countdown.
Definition: legoworld.cpp:810
MxBool m_worldStarted
Indicates if the world has successfully started and is considered active.
Definition: legoworld.h:388
MxCore * Find(const char *p_class, const char *p_name)
Finds an object of a given class and name in the world.
Definition: legoworld.cpp:573
MxLong Notify(MxParam &p_param) override
Notification callback responding to registered events such as EndAction and NewPresenter.
Definition: legoworld.cpp:212
void RemoveActor(LegoPathActor *p_actor)
Removes an actor from all known path controllers.
Definition: legoworld.cpp:325
MxResult Create(MxDSAction &p_dsAction) override
Initializes the world using an action, creating entity and sound lists, and camera controller.
Definition: legoworld.cpp:58
MxDSAction * GetAction()
[AI] Direct access to the underlying action.
void RaiseVolume()
[AI] Requests that the background music volume is raised (decrements suppression counter); triggers f...
void LowerVolume()
[AI] Requests a reduction in current background music volume, queuing for fade out (increments suppre...
[AI] STL list of MxPresenter pointers, used to manage multiple child presenters under composite contr...
MxCompositePresenterList * GetList()
[AI] Returns reference to the internal list of child presenters managed by this composite.
[AI] Presenter for UI controls, supporting toggles, grids, and "map" style controls with multiple int...
void Enable(MxBool p_enable) override
[AI] Enables or disables the control; delegates enable to correct sub-presenter based on current stat...
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
Definition: mxdsaction.h:17
const MxAtomId & GetAtomId()
[AI] Returns a const-reference to the object's atom identifier.
Definition: mxdsobject.h:133
virtual void SetAtomId(MxAtomId p_atomId)
[AI] Sets the atom id for this object instance, used for indexing or lookup.
Definition: mxdsobject.h:118
void SetUnknown24(MxS16 p_unk0x24)
[AI] Sets the unknown field at 0x24 (possibly version/state).
Definition: mxdsobject.h:151
void SetObjectId(MxU32 p_objectId)
[AI] Sets the object id (for serialization or lookup).
Definition: mxdsobject.h:147
MxU32 GetObjectId()
[AI] Returns the object id numeric value.
Definition: mxdsobject.h:130
static LPDIRECTDRAWSURFACE CopySurface(LPDIRECTDRAWSURFACE p_src)
[AI] Creates a deep copy of the provided surface (new DirectDraw surface with same content).
[AI] Notification parameter marking the end of an action, specialization of MxActionNotificationParam...
MxAtomId m_atomId
The AtomId associated with this entity, used for resource and script identification.
Definition: mxentity.h:124
void SetEntityId(MxS32 p_entityId)
Sets the entity ID to the given value.
Definition: mxentity.h:104
void SetAtomId(const MxAtomId &p_atomId)
Sets the AtomId to the given value.
Definition: mxentity.h:110
void Unregister(MxCore *p_listener)
[AI] Removes a previously registered listener and flushes any pending notifications for it.
void Register(MxCore *p_listener)
[AI] Registers a listener object to receive notifications.
MxResult Send(MxCore *p_listener, const MxNotificationParam &p_param)
[AI] Queues a notification to be sent to a specific registered listener.
[AI] Parameter object representing a single notification or event, carrying an identifier and sender ...
NotificationId GetNotification() const
[AI] Retrieves the current notification type of this parameter.
[AI] MxParam serves as a polymorphic base class for parameter passing in event and notification syste...
Definition: mxparam.h:7
virtual void SetTickleState(TickleState p_tickleState)
[AI] Forces the tickle state, advancing to the requested lifecycle stage.
Definition: mxpresenter.h:100
@ e_repeating
[AI] Presentation is repeating (e.g., looping media).
Definition: mxpresenter.h:28
MxDSAction * GetAction() const
[AI] Returns the current action being presented.
Definition: mxpresenter.h:175
[AI] Presenter for single still image/bitmap media sources in the game.
virtual MxStillPresenter * Clone()
[AI] Clones the presenter, attempting to fully duplicate internal state and associated memory resourc...
virtual void SetPosition(MxS32 p_x, MxS32 p_y)
[AI] Sets the pixel-based position of the presented image.
void Enable(MxBool p_enable) override
[AI] Sets the enabled/disabled state of the presenter, updating the video manager's rendering as need...
MxLong GetTime()
Returns the current timer value in ms, depending on running state.
Definition: mxtimer.h:50
MxResult StartTransition(TransitionType p_animationType, MxS32 p_speed, MxBool p_doCopy, MxBool p_playMusicInAnim)
[AI] Begins a new transition animation of type p_animationType at the specified speed,...
@ e_mosaic
[AI] Complex mosaic block-out effect.
virtual LPDIRECTDRAWSURFACE VTable0x78()
Retrieves the DirectDraw surface used for hardware-accelerated rendering.
void SetVisibility(unsigned char p_visible)
[AI] Sets the visibility flag to the provided value.
Definition: roi.h:235
[AI] Represents the drivable race car entity in the LEGO Island world.
Definition: racecar.h:24
Derived world for handling the user registration book/infocenter name entry interface.
MxResult Create(MxDSAction &p_dsAction) override
Handles creation/initialization logic when launched, registering to input/control and setting up stat...
void Enable(MxBool p_enable) override
Enables/disables world; updates input and UI state accordingly.
MxS16 m_letters[7]
[AI] Letter indices ('A'=0...'Z'=25 or -1 for empty) for currently-entered name.
static void PlayAction(MxU32 p_objectId)
Helper to play script action within the regbook.
~RegistrationBook() override
Destructor, cleans up UI elements, surfaces, and unregisters input/control/notification....
MxLong Notify(MxParam &p_param) override
Called for notification events including actions, keypresses, controls and transitions.
MxResult Tickle() override
Per-frame tick/update handler, manages dialogue timer and checkbox blink logic. [AI].
void ReadyWorld() override
Called to fully initialize the infocenter registration UI and player names. [AI].
MxBool Escape() override
Handles player pressing Escape, cancels animation and returns to main infocenter. [AI].
#define TRUE
Definition: d3drmdef.h:28
#define FALSE
Definition: d3drmdef.h:27
#define DDBLT_ROP
Definition: ddraw.h:2670
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
#define NULL
[AI] Null pointer value (C/C++ semantics).
Definition: legotypes.h:26
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
Definition: legotypes.h:30
void InvokeAction(Extra::ActionType p_actionId, const MxAtomId &p_pAtom, MxS32 p_streamId, LegoEntity *p_sender)
[AI] Dispatches and triggers a game action on the given script or object.
Definition: legoutils.cpp:271
void SetAppCursor(Cursor p_cursor)
[AI] Sets the in-game cursor to a specified type.
Definition: legoutils.cpp:566
@ e_cursorBusy
[AI] Busy or loading cursor (e.g., hourglass). [AI]
Definition: legoutils.h:24
LegoGameState * GameState()
[AI] Accessor for the game's central game state controller. [AI]
Definition: misc.cpp:61
void DeleteObjects(MxAtomId *p_id, MxS32 p_first, MxS32 p_last)
[AI] Batch deletes objects, given by atom id, and within the entity id range [p_first,...
Definition: misc.cpp:237
MxTransitionManager * TransitionManager()
[AI] Accessor for the MxTransitionManager, handling level transitions, fades, and world changes....
Definition: misc.cpp:208
MxBackgroundAudioManager * BackgroundAudioManager()
[AI] Accessor for the background audio manager. Used for background music and ambient sounds....
Definition: misc.cpp:37
LegoControlManager * ControlManager()
[AI] Accessor for the control manager through the input manager; manages higher-level user/game contr...
Definition: misc.cpp:53
void PlayMusic(JukeboxScript::Script p_objectId)
[AI] Starts music playback by scripting the background audio manager to play the music piece referenc...
Definition: misc.cpp:216
void SetIsWorldActive(MxBool p_isWorldActive)
[AI] Toggles whether the world should be considered active (enables/disables camera/user control etc)...
Definition: misc.cpp:228
LegoInputManager * InputManager()
[AI] Accessor for the input manager, which handles keyboard, mouse, and controller input....
Definition: misc.cpp:45
LegoROI * FindROI(const char *p_name)
[AI] Looks up a LegoROI (Real-time Object Instance) by name in the current world or global registry.
Definition: misc.cpp:151
MxTimer * Timer()
[AI] Returns the global simulation timer.
Definition: mxmisc.cpp:33
MxResult Start(MxDSAction *p_dsAction)
[AI] Schedules and initiates execution of a script action.
Definition: mxmisc.cpp:97
MxNotificationManager * NotificationManager()
[AI] Returns the notification manager for system-wide state/update notifications.
Definition: mxmisc.cpp:17
@ c_notificationControl
[AI] UI control event [AI]
@ c_notificationButtonDown
[AI] Mouse/gamepad button press [AI]
@ c_notificationKeyPress
[AI] Keyboard key press detected [AI]
@ c_notificationTransitioned
[AI] Object has transitioned states or locations [AI]
@ c_notificationEndAction
[AI] Indicates the end of an action [AI]
@ c_notificationPathStruct
[AI] Data related to a path structure [AI]
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
int MxLong
[AI]
Definition: mxtypes.h:83
signed short MxS16
[AI]
Definition: mxtypes.h:26
unsigned char MxU8
[AI]
Definition: mxtypes.h:8
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned int MxU32
[AI]
Definition: mxtypes.h:32
@ c_Helicopter_Actor
[AI] Main helicopter actor logic entry/action.
@ c_DuneBugy_Actor
[AI] ID for the main Dune Buggy actor instance.
@ c_Jetski_Actor
[AI] Main jetski actor entity script. [AI]
@ c_InformationCenter_Music
[AI] Background music for the information center.
@ c_RaceCar_Actor
[AI] Script action corresponding to the main interactive racecar actor.
@ c_iic006in_RunAnim
[AI] "Run" animation for iic006in. [AI]
@ c_iic007in_PlayWav
[AI] WAV audio playback action or trigger for iic007in resource. [AI]
@ c_Alphabet_Ctl
[AI] UI control for the full alphabet selection in Regbook, likely for character entry....
@ c_Textures
[AI] General reference to textures used in Regbook, likely a container or lookup resource....
@ c_iic008in_PlayWav
[AI] WAV audio playback action or trigger for iic008in resource. [AI]
MxLong g_checkboxBlinkTimer
MxBool g_nextCheckbox
const char * g_infoman
[AI] Contains global script AtomId pointers and utility functions for managing script AtomIds in LEGO...
MxAtomId * g_regbookScript
[AI] Script AtomId for the registration book script (name entry).
Definition: scripts.cpp:48
MxAtomId * g_racecarScript
[AI] Script AtomId for the build/race car SI file.
Definition: scripts.cpp:15
MxAtomId * g_copterScript
[AI] Script AtomId for the helicopter ("copter") build or activity.
Definition: scripts.cpp:6
MxAtomId * g_jetskiScript
[AI] Script AtomId for the jet ski-related script.
Definition: scripts.cpp:12
MxAtomId * g_dunecarScript
[AI] Script AtomId for the dune car building or mission script.
Definition: scripts.cpp:9
@ e_start
[AI] Start an activity or playback [AI]
Definition: extra.h:30
void WriteScoreHistory()
Rebuilds the high score table from current state objects, sorts it descending. [AI].
Player "username", stored as 7 short integers (character codes).
MxS16 m_letters[7]
Array of 7 wide characters: player name (filled by registration). [AI].
MxBool IsPresent()
[AI] Determines whether the plane instance is valid (present) based on its name.
DWORD dwSize
Definition: ddraw.h:141
DWORD dwROP
Definition: ddraw.h:143