Isle
Loading...
Searching...
No Matches
mxtransitionmanager.cpp
Go to the documentation of this file.
2
3#include "legoinputmanager.h"
4#include "legoutils.h"
5#include "legovideomanager.h"
6#include "legoworld.h"
7#include "misc.h"
9#include "mxdisplaysurface.h"
10#include "mxmisc.h"
11#include "mxparam.h"
12#include "mxticklemanager.h"
13#include "mxvideopresenter.h"
14
16
17// GLOBAL: LEGO1 0x100f4378
18RECT g_fullScreenRect = {0, 0, 640, 480};
19
20// FUNCTION: LEGO1 0x1004b8d0
22{
23 m_animationTimer = 0;
24 m_mode = e_idle;
25 m_ddSurface = NULL;
26 m_waitIndicator = NULL;
27 m_copyBuffer = NULL;
28 m_copyFlags.m_bit0 = FALSE;
29 m_unk0x28.m_bit0 = FALSE;
30 m_unk0x24 = 0;
31}
32
33// FUNCTION: LEGO1 0x1004ba00
35{
36 delete[] m_copyBuffer;
37
38 if (m_waitIndicator != NULL) {
39 delete m_waitIndicator->GetAction();
40 delete m_waitIndicator;
41 }
42
44}
45
46// FUNCTION: LEGO1 0x1004baa0
48{
49 LegoVideoManager* videoManager = VideoManager();
50 m_ddSurface = videoManager->GetDisplaySurface()->GetDirectDrawSurface2();
51 return SUCCESS;
52}
53
54// FUNCTION: LEGO1 0x1004bac0
56{
57 MxULong time = m_animationSpeed + m_systemTime;
58 if (time > timeGetTime()) {
59 return SUCCESS;
60 }
61
62 m_systemTime = timeGetTime();
63
64 switch (m_mode) {
65 case e_noAnimation:
66 NoTransition();
67 break;
68 case e_dissolve:
69 DissolveTransition();
70 break;
71 case e_mosaic:
72 MosaicTransition();
73 break;
74 case e_wipeDown:
75 WipeDownTransition();
76 break;
77 case e_windows:
78 WindowsTransition();
79 break;
80 case e_broken:
81 BrokenTransition();
82 break;
83 }
84 return SUCCESS;
85}
86
87// FUNCTION: LEGO1 0x1004bb70
88// FUNCTION: BETA10 0x100ec4c1
90 TransitionType p_animationType,
91 MxS32 p_speed,
92 MxBool p_doCopy,
93 MxBool p_playMusicInAnim
94)
95{
96 assert(m_mode == e_idle);
97
98 if (m_mode == e_idle) {
99 if (!p_playMusicInAnim) {
100 MxBackgroundAudioManager* backgroundAudioManager = BackgroundAudioManager();
101 backgroundAudioManager->Stop();
102 }
103
104 m_mode = p_animationType;
105
106 m_copyFlags.m_bit0 = p_doCopy;
107
108 if (m_copyFlags.m_bit0 && m_waitIndicator != NULL) {
109 m_waitIndicator->Enable(TRUE);
110
111 MxDSAction* action = m_waitIndicator->GetAction();
112 action->SetLoopCount(10000);
113 action->SetFlags(action->GetFlags() | MxDSAction::c_bit10);
114 }
115
116 MxU32 time = timeGetTime();
117 m_systemTime = time;
118
119 m_animationSpeed = p_speed;
120
121 MxTickleManager* tickleManager = TickleManager();
122 tickleManager->RegisterClient(this, p_speed);
123
124 LegoInputManager* inputManager = InputManager();
125 inputManager->SetUnknown88(TRUE);
126 inputManager->SetUnknown336(FALSE);
127
128 LegoVideoManager* videoManager = VideoManager();
129 videoManager->SetRender3D(FALSE);
130
132 return SUCCESS;
133 }
134 return FAILURE;
135}
136
137// FUNCTION: LEGO1 0x1004bc30
138void MxTransitionManager::EndTransition(MxBool p_notifyWorld)
139{
140 if (m_mode != e_idle) {
141 m_mode = e_idle;
142
143 m_copyFlags.m_bit0 = FALSE;
144
146
147 if (p_notifyWorld) {
148 LegoWorld* world = CurrentWorld();
149
150 if (world) {
151#ifdef COMPAT_MODE
152 {
154 world->Notify(param);
155 }
156#else
158#endif
159 }
160 }
161 }
162}
163
164// FUNCTION: LEGO1 0x1004bcf0
165void MxTransitionManager::NoTransition()
166{
167 LegoVideoManager* videoManager = VideoManager();
168 videoManager->GetDisplaySurface()->ClearScreen();
169 EndTransition(TRUE);
170}
171
172// FUNCTION: LEGO1 0x1004bd10
173void MxTransitionManager::DissolveTransition()
174{
175 // If the animation is finished
176 if (m_animationTimer == 40) {
177 m_animationTimer = 0;
178 EndTransition(TRUE);
179 return;
180 }
181
182 // If we are starting the animation
183 if (m_animationTimer == 0) {
184 // Generate the list of columns in order...
185 MxS32 i;
186 for (i = 0; i < 640; i++) {
187 m_columnOrder[i] = i;
188 }
189
190 // ...then shuffle the list (to ensure that we hit each column once)
191 for (i = 0; i < 640; i++) {
192 MxS32 swap = rand() % 640;
193 MxU16 t = m_columnOrder[i];
194 m_columnOrder[i] = m_columnOrder[swap];
195 m_columnOrder[swap] = t;
196 }
197
198 // For each scanline, pick a random X offset
199 for (i = 0; i < 480; i++) {
200 m_randomShift[i] = rand() % 640;
201 }
202 }
203
204 // Run one tick of the animation
205 DDSURFACEDESC ddsd;
206 memset(&ddsd, 0, sizeof(ddsd));
207 ddsd.dwSize = sizeof(ddsd);
208
209 HRESULT res = m_ddSurface->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL);
210 if (res == DDERR_SURFACELOST) {
211 m_ddSurface->Restore();
212 res = m_ddSurface->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL);
213 }
214
215 if (res == DD_OK) {
216 SubmitCopyRect(&ddsd);
217
218 for (MxS32 col = 0; col < 640; col++) {
219 // Select 16 columns on each tick
220 if (m_animationTimer * 16 > m_columnOrder[col]) {
221 continue;
222 }
223
224 if (m_animationTimer * 16 + 15 < m_columnOrder[col]) {
225 continue;
226 }
227
228 for (MxS32 row = 0; row < 480; row++) {
229 // Shift the chosen column a different amount at each scanline.
230 // We use the same shift for that scanline each time.
231 // By the end, every pixel gets hit.
232 MxS32 xShift = (m_randomShift[row] + col) % 640;
233
234 // Set the chosen pixel to black
235 if (ddsd.ddpfPixelFormat.dwRGBBitCount == 8) {
236 MxU8* surf = (MxU8*) ddsd.lpSurface + ddsd.lPitch * row + xShift;
237 *surf = 0;
238 }
239 else {
240 MxU8* surf = (MxU8*) ddsd.lpSurface + ddsd.lPitch * row + xShift * 2;
241 *(MxU16*) surf = 0;
242 }
243 }
244 }
245
246 SetupCopyRect(&ddsd);
247 m_ddSurface->Unlock(ddsd.lpSurface);
248
249 if (VideoManager()->GetVideoParam().Flags().GetFlipSurfaces()) {
251 surf->BltFast(0, 0, m_ddSurface, &g_fullScreenRect, DDBLTFAST_WAIT);
252 }
253
254 m_animationTimer++;
255 }
256}
257
258// FUNCTION: LEGO1 0x1004bed0
259void MxTransitionManager::MosaicTransition()
260{
261 if (m_animationTimer == 16) {
262 m_animationTimer = 0;
263 EndTransition(TRUE);
264 return;
265 }
266 else {
267 if (m_animationTimer == 0) {
268
269 // Same init/shuffle steps as the dissolve transition, except that
270 // we are using big blocky pixels and only need 64 columns.
271 MxS32 i;
272 for (i = 0; i < 64; i++) {
273 m_columnOrder[i] = i;
274 }
275
276 for (i = 0; i < 64; i++) {
277 MxS32 swap = rand() % 64;
278 MxU16 t = m_columnOrder[i];
279 m_columnOrder[i] = m_columnOrder[swap];
280 m_columnOrder[swap] = t;
281 }
282
283 // The same is true here. We only need 48 rows.
284 for (i = 0; i < 48; i++) {
285 m_randomShift[i] = rand() % 64;
286 }
287 }
288
289 // Run one tick of the animation
290 DDSURFACEDESC ddsd;
291 memset(&ddsd, 0, sizeof(ddsd));
292 ddsd.dwSize = sizeof(ddsd);
293
294 HRESULT res = m_ddSurface->Lock(NULL, &ddsd, 1, NULL);
295 if (res == DDERR_SURFACELOST) {
296 m_ddSurface->Restore();
297 res = m_ddSurface->Lock(NULL, &ddsd, 1, NULL);
298 }
299
300 if (res == DD_OK) {
301 SubmitCopyRect(&ddsd);
302
303 for (MxS32 col = 0; col < 64; col++) {
304 // Select 4 columns on each tick
305 if (m_animationTimer * 4 > m_columnOrder[col]) {
306 continue;
307 }
308
309 if (m_animationTimer * 4 + 3 < m_columnOrder[col]) {
310 continue;
311 }
312
313 for (MxS32 row = 0; row < 48; row++) {
314 // To do the mosaic effect, we subdivide the 640x480 surface into
315 // 10x10 pixel blocks. At the chosen block, we sample the top-leftmost
316 // color and set the other 99 pixels to that value.
317
318 // First, get the offset of the 10x10 block that we will sample for this row.
319 MxS32 xShift = 10 * ((m_randomShift[row] + col) % 64);
320
321 // Combine xShift with this value to target the correct location in the buffer.
322 MxS32 bytesPerPixel = ddsd.ddpfPixelFormat.dwRGBBitCount / 8;
323
324 // Seek to the sample position.
325 MxU8* source = (MxU8*) ddsd.lpSurface + 10 * row * ddsd.lPitch + bytesPerPixel * xShift;
326
327 // Sample byte or word depending on display mode.
328 MxU32 sample = bytesPerPixel == 1 ? *source : *(MxU16*) source;
329
330 // For each of the 10 rows in the 10x10 square:
331 for (MxS32 k = 10 * row; k < 10 * row + 10; k++) {
332 if (ddsd.ddpfPixelFormat.dwRGBBitCount == 8) {
333 // Optimization: If the pixel is only one byte, we can use memset
334 MxU8* pos = ((MxU8*) ddsd.lpSurface + k * ddsd.lPitch + xShift);
335 memset(pos, sample, 10);
336 }
337 else {
338 // Need to double xShift because it measures pixels not bytes
339 MxU16* pos = (MxU16*) ((MxU8*) ddsd.lpSurface + k * ddsd.lPitch + 2 * xShift);
340
341 for (MxS32 tt = 0; tt < 10; tt++) {
342 pos[tt] = sample;
343 }
344 }
345 }
346 }
347 }
348
349 SetupCopyRect(&ddsd);
350 m_ddSurface->Unlock(ddsd.lpSurface);
351
352 if (VideoManager()->GetVideoParam().Flags().GetFlipSurfaces()) {
354 surf->BltFast(0, 0, m_ddSurface, &g_fullScreenRect, DDBLTFAST_WAIT);
355 }
356
357 m_animationTimer++;
358 }
359 }
360}
361
362// FUNCTION: LEGO1 0x1004c170
363void MxTransitionManager::WipeDownTransition()
364{
365 // If the animation is finished
366 if (m_animationTimer == 240) {
367 m_animationTimer = 0;
368 EndTransition(TRUE);
369 return;
370 }
371
372 DDSURFACEDESC ddsd;
373 memset(&ddsd, 0, sizeof(ddsd));
374 ddsd.dwSize = sizeof(ddsd);
375
376 HRESULT res = m_ddSurface->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL);
377 if (res == DDERR_SURFACELOST) {
378 m_ddSurface->Restore();
379 res = m_ddSurface->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL);
380 }
381
382 if (res == DD_OK) {
383 SubmitCopyRect(&ddsd);
384
385 // For each of the 240 animation ticks, blank out two scanlines
386 // starting at the top of the screen.
387 // (dwRGBBitCount / 8) will tell how many bytes are used per pixel.
388 MxU8* line = (MxU8*) ddsd.lpSurface + 2 * ddsd.lPitch * m_animationTimer;
389 memset(line, 0, 640 * ddsd.ddpfPixelFormat.dwRGBBitCount / 8);
390
391 line += ddsd.lPitch;
392 memset(line, 0, 640 * ddsd.ddpfPixelFormat.dwRGBBitCount / 8);
393
394 SetupCopyRect(&ddsd);
395 m_ddSurface->Unlock(ddsd.lpSurface);
396
397 m_animationTimer++;
398 }
399}
400
401// FUNCTION: LEGO1 0x1004c270
402void MxTransitionManager::WindowsTransition()
403{
404 if (m_animationTimer == 240) {
405 m_animationTimer = 0;
406 EndTransition(TRUE);
407 return;
408 }
409
410 DDSURFACEDESC ddsd;
411 memset(&ddsd, 0, sizeof(ddsd));
412 ddsd.dwSize = sizeof(ddsd);
413
414 HRESULT res = m_ddSurface->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL);
415 if (res == DDERR_SURFACELOST) {
416 m_ddSurface->Restore();
417 res = m_ddSurface->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL);
418 }
419
420 if (res == DD_OK) {
421 SubmitCopyRect(&ddsd);
422
423 MxU8* line = (MxU8*) ddsd.lpSurface + m_animationTimer * ddsd.lPitch;
424
425 MxS32 bytesPerPixel = ddsd.ddpfPixelFormat.dwRGBBitCount / 8;
426 MxS32 bytesPerLine = bytesPerPixel * 640;
427
428 memset(line, 0, bytesPerLine);
429
430 for (MxS32 i = m_animationTimer + 1; i < 480 - m_animationTimer; i++) {
431 line += ddsd.lPitch;
432
433 memset(line + m_animationTimer * bytesPerPixel, 0, bytesPerPixel);
434 memset(line + 640 + (-1 - m_animationTimer) * bytesPerPixel, 0, bytesPerPixel);
435 }
436
437 line += ddsd.lPitch;
438 memset(line, 0, bytesPerLine);
439
440 SetupCopyRect(&ddsd);
441 m_ddSurface->Unlock(ddsd.lpSurface);
442
443 m_animationTimer++;
444 }
445}
446
447// FUNCTION: LEGO1 0x1004c3e0
448void MxTransitionManager::BrokenTransition()
449{
450 // This function has no actual animation logic.
451 // It also never calls EndTransition to
452 // properly terminate the transition, so
453 // the game just hangs forever.
454
455 DDSURFACEDESC ddsd;
456 memset(&ddsd, 0, sizeof(ddsd));
457 ddsd.dwSize = sizeof(ddsd);
458
459 HRESULT res = m_ddSurface->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL);
460 if (res == DDERR_SURFACELOST) {
461 m_ddSurface->Restore();
462 res = m_ddSurface->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL);
463 }
464
465 if (res == DD_OK) {
466 SubmitCopyRect(&ddsd);
467 SetupCopyRect(&ddsd);
468 m_ddSurface->Unlock(ddsd.lpSurface);
469 }
470}
471
472// FUNCTION: LEGO1 0x1004c470
474{
475 // End current wait indicator
476 if (m_waitIndicator != NULL) {
477 m_waitIndicator->GetAction()->SetFlags(m_waitIndicator->GetAction()->GetFlags() & ~MxDSAction::c_world);
478 m_waitIndicator->EndAction();
479 m_waitIndicator = NULL;
480 }
481
482 // Check if we were given a new wait indicator
483 if (p_waitIndicator != NULL) {
484 // Setup the new wait indicator
485 m_waitIndicator = p_waitIndicator;
486
487 LegoVideoManager* videoManager = VideoManager();
488 videoManager->UnregisterPresenter(*m_waitIndicator);
489
490 if (m_waitIndicator->GetCurrentTickleState() < MxPresenter::e_streaming) {
491 m_waitIndicator->Tickle();
492 }
493 }
494 else {
495 // Disable copy rect
496 m_copyFlags.m_bit0 = FALSE;
497 }
498}
499
500// FUNCTION: LEGO1 0x1004c4d0
501void MxTransitionManager::SubmitCopyRect(LPDDSURFACEDESC p_ddsc)
502{
503 // Check if the copy rect is setup
504 if (m_copyFlags.m_bit0 == FALSE || m_waitIndicator == NULL || m_copyBuffer == NULL) {
505 return;
506 }
507
508 // Copy the copy rect onto the surface
509 MxU8* dst;
510
511 MxU32 bytesPerPixel = p_ddsc->ddpfPixelFormat.dwRGBBitCount / 8;
512
513 const MxU8* src = (const MxU8*) m_copyBuffer;
514
515 MxS32 copyPitch;
516 copyPitch = ((m_copyRect.right - m_copyRect.left) + 1) * bytesPerPixel;
517
518 MxS32 y;
519 dst = (MxU8*) p_ddsc->lpSurface + (p_ddsc->lPitch * m_copyRect.top) + (bytesPerPixel * m_copyRect.left);
520
521 for (y = 0; y < m_copyRect.bottom - m_copyRect.top + 1; ++y) {
522 memcpy(dst, src, copyPitch);
523 src += copyPitch;
524 dst += p_ddsc->lPitch;
525 }
526
527 // Free the copy buffer
528 delete[] m_copyBuffer;
529 m_copyBuffer = NULL;
530}
531
532// FUNCTION: LEGO1 0x1004c580
533void MxTransitionManager::SetupCopyRect(LPDDSURFACEDESC p_ddsc)
534{
535 // Check if the copy rect is setup
536 if (m_copyFlags.m_bit0 == FALSE || m_waitIndicator == NULL) {
537 return;
538 }
539
540 // Tickle wait indicator
541 m_waitIndicator->Tickle();
542
543 // Check if wait indicator has started
544 if (m_waitIndicator->GetCurrentTickleState() >= MxPresenter::e_streaming) {
545 // Setup the copy rect
546 MxU32 copyPitch = (p_ddsc->ddpfPixelFormat.dwRGBBitCount / 8) *
547 (m_copyRect.right - m_copyRect.left + 1); // This uses m_copyRect, seemingly erroneously
548 MxU32 bytesPerPixel = p_ddsc->ddpfPixelFormat.dwRGBBitCount / 8;
549
550 m_copyRect.left = m_waitIndicator->GetLocation().GetX();
551 m_copyRect.top = m_waitIndicator->GetLocation().GetY();
552
553 MxS32 height = m_waitIndicator->GetHeight();
554 MxS32 width = m_waitIndicator->GetWidth();
555
556 m_copyRect.right = m_copyRect.left + width - 1;
557 m_copyRect.bottom = m_copyRect.top + height - 1;
558
559 // Allocate the copy buffer
560 const MxU8* src =
561 (const MxU8*) p_ddsc->lpSurface + m_copyRect.top * p_ddsc->lPitch + bytesPerPixel * m_copyRect.left;
562
563 m_copyBuffer = new MxU8[bytesPerPixel * width * height];
564 if (!m_copyBuffer) {
565 return;
566 }
567
568 // Copy into the copy buffer
569 MxU8* dst = m_copyBuffer;
570
571 for (MxS32 i = 0; i < (m_copyRect.bottom - m_copyRect.top + 1); i++) {
572 memcpy(dst, src, copyPitch);
573 src += p_ddsc->lPitch;
574 dst += copyPitch;
575 }
576 }
577
578 // Setup display surface
579 if ((m_waitIndicator->GetAction()->GetFlags() & MxDSAction::c_bit5) != 0) {
580 MxDisplaySurface* displaySurface = VideoManager()->GetDisplaySurface();
581 MxBool und = FALSE;
582 displaySurface->VTable0x2c(
583 p_ddsc,
584 m_waitIndicator->GetBitmap(),
585 0,
586 0,
587 m_waitIndicator->GetLocation().GetX(),
588 m_waitIndicator->GetLocation().GetY(),
589 m_waitIndicator->GetWidth(),
590 m_waitIndicator->GetHeight(),
591 und
592 );
593 }
594 else {
595 MxDisplaySurface* displaySurface = VideoManager()->GetDisplaySurface();
596 displaySurface->VTable0x24(
597 p_ddsc,
598 m_waitIndicator->GetBitmap(),
599 0,
600 0,
601 m_waitIndicator->GetLocation().GetX(),
602 m_waitIndicator->GetLocation().GetY(),
603 m_waitIndicator->GetWidth(),
604 m_waitIndicator->GetHeight()
605 );
606 }
607}
[AI] Handles keyboard, mouse, and joystick input for the game.
void SetUnknown88(MxBool p_unk0x88)
[AI] Set general-purpose input block flag (purpose: temporary input disable during drag or transition...
void SetUnknown336(MxBool p_unk0x336)
[AI] Enables accepting input only for space-bar events (used in special UI states).
[AI] Extends the functionality of MxVideoManager to provide LEGO Island–specific video and 3D graphic...
void SetRender3D(MxBool p_render3d)
[AI] Enables or disables main 3D rendering (e.g., used internally on video transitions).
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] Background music manager that handles playback, volume, state transitions, and notifications for...
void Stop()
[AI] Immediately stops all background music, clears all actions and presenters, and resets tickle sta...
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
Definition: mxdsaction.h:17
MxU32 GetFlags()
[AI] Returns the flag field for this action (bitmask).
Definition: mxdsaction.h:177
void SetFlags(MxU32 p_flags)
[AI] Sets the flag bitmask controlling action logic (enabled, looping, etc).
Definition: mxdsaction.h:183
void SetLoopCount(MxS32 p_loopCount)
[AI] Sets the loop count for this action.
Definition: mxdsaction.h:209
@ c_bit5
[AI] Unknown - possibly reserved [AI]
Definition: mxdsaction.h:24
@ c_world
[AI] Action is described in world-space coordinates [AI]
Definition: mxdsaction.h:27
@ c_bit10
[AI] Unknown - possibly reserved [AI]
Definition: mxdsaction.h:29
Provides a DirectDraw-based drawing surface for blitting bitmaps, managing palette,...
LPDIRECTDRAWSURFACE GetDirectDrawSurface1()
[AI] Returns the primary DirectDraw surface (front buffer).
void ClearScreen()
[AI] Fills the current back buffer with black (clears the display area). [AI]
virtual void VTable0x24(LPDDSURFACEDESC p_desc, MxBitmap *p_bitmap, MxS32 p_left, MxS32 p_top, MxS32 p_right, MxS32 p_bottom, MxS32 p_width, MxS32 p_height)
[AI] Draws a bitmap onto a surface described by p_desc, scaling to the specified rectangle.
LPDIRECTDRAWSURFACE GetDirectDrawSurface2()
[AI] Returns the secondary DirectDraw surface (back buffer).
virtual void VTable0x2c(LPDDSURFACEDESC p_desc, MxBitmap *p_bitmap, MxS32 p_left, MxS32 p_top, MxS32 p_right, MxS32 p_bottom, MxS32 p_width, MxS32 p_height, MxBool p_RLE)
[AI] Draws a bitmap with optional transparency (RLE) onto the output surface.
virtual void UnregisterPresenter(MxPresenter &p_presenter)
[AI] Remove a presenter from tickle and managed output lists.
MxResult Tickle() override
[AI] Advances the presenter's state and media stream, if any, by tickling (i.e., updating) components...
void Enable(MxBool p_enable) override
[AI] Enables or disables media stream playback and transitions state as needed.
[AI] Parameter object representing a single notification or event, carrying an identifier and sender ...
T GetY() const
[AI] Get Y coordinate.
Definition: mxgeometry.h:53
T GetX() const
[AI] Get X coordinate.
Definition: mxgeometry.h:48
MxPoint32 GetLocation() const
[AI] Returns the presenter's screen location (in pixels).
Definition: mxpresenter.h:163
MxS32 GetCurrentTickleState() const
[AI] Returns the current tickle state.
Definition: mxpresenter.h:160
@ e_streaming
[AI] Streaming or rendering actively.
Definition: mxpresenter.h:27
MxDSAction * GetAction() const
[AI] Returns the current action being presented.
Definition: mxpresenter.h:175
[AI] Manages ticking ("tickling") a set of MxCore objects at specified intervals.
virtual void UnregisterClient(MxCore *p_client)
[AI] Unregisters (marks for destruction) a previously registered client.
virtual void RegisterClient(MxCore *p_client, MxTime p_interval)
[AI] Registers an MxCore object to receive periodic tickles.
[AI] Handles screen transitions and animations (such as dissolve, mosaic, wipe, etc....
MxResult Tickle() override
[AI] Performs per-frame advancement of the current transition animation, advancing its state if neces...
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,...
TransitionType
[AI] Enumerates all supported transition effect types.
@ e_idle
[AI] No transition is active.
@ e_dissolve
[AI] Black "pixels" dissolve across the screen in random order.
@ e_mosaic
[AI] Complex mosaic block-out effect.
@ e_wipeDown
[AI] Vertical wipe (top-down) fill.
@ e_windows
[AI] Animated shrinking "window" effect from full screen edges inward.
@ e_broken
[AI] Invalid/buggy mode, causes hang, used for diagnostics or internal testing.
@ e_noAnimation
[AI] Instant clear/fill screen, no animated effect.
MxTransitionManager()
[AI] Initializes MxTransitionManager and resets all transition states and working buffers.
virtual MxResult GetDDrawSurfaceFromVideoManager()
[AI] Retrieves the primary DirectDraw surface to render transitions onto, querying via the video mana...
~MxTransitionManager() override
[AI] Cleans up resources for the transition manager, deletes animation memory, notifies tickle manage...
void SetWaitIndicator(MxVideoPresenter *p_waitIndicator)
[AI] Sets or resets the visual wait indicator presented during blocking transitions.
MxDisplaySurface * GetDisplaySurface()
[AI] Returns the display surface used for video output; for direct drawing and palette operations.
Derived video presenter responsible for displaying video frames using DirectDraw surfaces.
MxBitmap * GetBitmap()
Returns the frame bitmap currently used for this presenter.
virtual MxS32 GetHeight()
Returns the height of the current bitmap or alpha mask in pixels.
virtual MxS32 GetWidth()
Returns the width of the current bitmap or alpha mask in pixels.
void EndAction() override
Signals the end of the current playback action.
#define TRUE
Definition: d3drmdef.h:28
#define FALSE
Definition: d3drmdef.h:27
struct _DDSURFACEDESC FAR * LPDDSURFACEDESC
Definition: ddraw.h:83
struct IDirectDrawSurface FAR * LPDIRECTDRAWSURFACE
Definition: ddraw.h:74
#define DDBLTFAST_WAIT
Definition: ddraw.h:2737
#define DDERR_SURFACELOST
Definition: ddraw.h:3489
#define DD_OK
Definition: ddraw.h:3166
long HRESULT
Definition: ddraw.h:115
#define DDLOCK_WAIT
Definition: ddraw.h:2916
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
#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
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
LegoVideoManager * VideoManager()
[AI] Accessor for the game's LegoVideoManager subsystem. Used for managing 3D/video hardware....
Definition: misc.cpp:29
MxBackgroundAudioManager * BackgroundAudioManager()
[AI] Accessor for the background audio manager. Used for background music and ambient sounds....
Definition: misc.cpp:37
LegoWorld * CurrentWorld()
[AI] Accessor for the currently active LegoWorld instance. [AI]
Definition: misc.cpp:93
LegoInputManager * InputManager()
[AI] Accessor for the input manager, which handles keyboard, mouse, and controller input....
Definition: misc.cpp:45
MxTickleManager * TickleManager()
[AI] Provides access to the global tickle manager.
Definition: mxmisc.cpp:25
@ c_notificationTransitioned
[AI] Object has transitioned states or locations [AI]
RECT g_fullScreenRect
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
unsigned char MxU8
[AI]
Definition: mxtypes.h:8
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned int MxULong
[AI]
Definition: mxtypes.h:93
unsigned short MxU16
[AI]
Definition: mxtypes.h:20
unsigned int MxU32
[AI]
Definition: mxtypes.h:32
DWORD dwRGBBitCount
Definition: ddraw.h:348
LPVOID lpSurface
Definition: ddraw.h:1152
DDPIXELFORMAT ddpfPixelFormat
Definition: ddraw.h:1157
LONG lPitch
Definition: ddraw.h:1140
DWORD dwSize
Definition: ddraw.h:1134
MxU8 m_bit0
[AI] Least significant bit of the flag byte.
Definition: mxtypes.h:171