26 m_waitIndicator =
NULL;
36 delete[] m_copyBuffer;
38 if (m_waitIndicator !=
NULL) {
40 delete m_waitIndicator;
57 MxULong time = m_animationSpeed + m_systemTime;
58 if (time > timeGetTime()) {
62 m_systemTime = timeGetTime();
99 if (!p_playMusicInAnim) {
101 backgroundAudioManager->
Stop();
104 m_mode = p_animationType;
106 m_copyFlags.
m_bit0 = p_doCopy;
108 if (m_copyFlags.
m_bit0 && m_waitIndicator !=
NULL) {
116 MxU32 time = timeGetTime();
119 m_animationSpeed = p_speed;
138void MxTransitionManager::EndTransition(
MxBool p_notifyWorld)
165void MxTransitionManager::NoTransition()
173void MxTransitionManager::DissolveTransition()
176 if (m_animationTimer == 40) {
177 m_animationTimer = 0;
183 if (m_animationTimer == 0) {
186 for (i = 0; i < 640; i++) {
187 m_columnOrder[i] = i;
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;
199 for (i = 0; i < 480; i++) {
200 m_randomShift[i] = rand() % 640;
206 memset(&ddsd, 0,
sizeof(ddsd));
207 ddsd.
dwSize =
sizeof(ddsd);
211 m_ddSurface->Restore();
216 SubmitCopyRect(&ddsd);
218 for (
MxS32 col = 0; col < 640; col++) {
220 if (m_animationTimer * 16 > m_columnOrder[col]) {
224 if (m_animationTimer * 16 + 15 < m_columnOrder[col]) {
228 for (
MxS32 row = 0; row < 480; row++) {
232 MxS32 xShift = (m_randomShift[row] + col) % 640;
246 SetupCopyRect(&ddsd);
249 if (
VideoManager()->GetVideoParam().Flags().GetFlipSurfaces()) {
259void MxTransitionManager::MosaicTransition()
261 if (m_animationTimer == 16) {
262 m_animationTimer = 0;
267 if (m_animationTimer == 0) {
272 for (i = 0; i < 64; i++) {
273 m_columnOrder[i] = i;
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;
284 for (i = 0; i < 48; i++) {
285 m_randomShift[i] = rand() % 64;
291 memset(&ddsd, 0,
sizeof(ddsd));
292 ddsd.
dwSize =
sizeof(ddsd);
296 m_ddSurface->Restore();
297 res = m_ddSurface->Lock(
NULL, &ddsd, 1,
NULL);
301 SubmitCopyRect(&ddsd);
303 for (
MxS32 col = 0; col < 64; col++) {
305 if (m_animationTimer * 4 > m_columnOrder[col]) {
309 if (m_animationTimer * 4 + 3 < m_columnOrder[col]) {
313 for (
MxS32 row = 0; row < 48; row++) {
319 MxS32 xShift = 10 * ((m_randomShift[row] + col) % 64);
328 MxU32 sample = bytesPerPixel == 1 ? *source : *(
MxU16*) source;
331 for (
MxS32 k = 10 * row; k < 10 * row + 10; k++) {
335 memset(pos, sample, 10);
341 for (
MxS32 tt = 0; tt < 10; tt++) {
349 SetupCopyRect(&ddsd);
352 if (
VideoManager()->GetVideoParam().Flags().GetFlipSurfaces()) {
363void MxTransitionManager::WipeDownTransition()
366 if (m_animationTimer == 240) {
367 m_animationTimer = 0;
373 memset(&ddsd, 0,
sizeof(ddsd));
374 ddsd.
dwSize =
sizeof(ddsd);
378 m_ddSurface->Restore();
383 SubmitCopyRect(&ddsd);
394 SetupCopyRect(&ddsd);
402void MxTransitionManager::WindowsTransition()
404 if (m_animationTimer == 240) {
405 m_animationTimer = 0;
411 memset(&ddsd, 0,
sizeof(ddsd));
412 ddsd.
dwSize =
sizeof(ddsd);
416 m_ddSurface->Restore();
421 SubmitCopyRect(&ddsd);
426 MxS32 bytesPerLine = bytesPerPixel * 640;
428 memset(line, 0, bytesPerLine);
430 for (
MxS32 i = m_animationTimer + 1; i < 480 - m_animationTimer; i++) {
433 memset(line + m_animationTimer * bytesPerPixel, 0, bytesPerPixel);
434 memset(line + 640 + (-1 - m_animationTimer) * bytesPerPixel, 0, bytesPerPixel);
438 memset(line, 0, bytesPerLine);
440 SetupCopyRect(&ddsd);
448void MxTransitionManager::BrokenTransition()
456 memset(&ddsd, 0,
sizeof(ddsd));
457 ddsd.
dwSize =
sizeof(ddsd);
461 m_ddSurface->Restore();
466 SubmitCopyRect(&ddsd);
467 SetupCopyRect(&ddsd);
476 if (m_waitIndicator !=
NULL) {
479 m_waitIndicator =
NULL;
483 if (p_waitIndicator !=
NULL) {
485 m_waitIndicator = p_waitIndicator;
491 m_waitIndicator->
Tickle();
511 MxU32 bytesPerPixel = p_ddsc->ddpfPixelFormat.dwRGBBitCount / 8;
513 const MxU8* src = (
const MxU8*) m_copyBuffer;
516 copyPitch = ((m_copyRect.right - m_copyRect.left) + 1) * bytesPerPixel;
519 dst = (
MxU8*) p_ddsc->lpSurface + (p_ddsc->lPitch * m_copyRect.top) + (bytesPerPixel * m_copyRect.left);
521 for (y = 0; y < m_copyRect.bottom - m_copyRect.top + 1; ++y) {
522 memcpy(dst, src, copyPitch);
524 dst += p_ddsc->lPitch;
528 delete[] m_copyBuffer;
541 m_waitIndicator->
Tickle();
546 MxU32 copyPitch = (p_ddsc->ddpfPixelFormat.dwRGBBitCount / 8) *
547 (m_copyRect.right - m_copyRect.left + 1);
548 MxU32 bytesPerPixel = p_ddsc->ddpfPixelFormat.dwRGBBitCount / 8;
556 m_copyRect.right = m_copyRect.left + width - 1;
557 m_copyRect.bottom = m_copyRect.top + height - 1;
561 (
const MxU8*) p_ddsc->lpSurface + m_copyRect.top * p_ddsc->lPitch + bytesPerPixel * m_copyRect.left;
563 m_copyBuffer =
new MxU8[bytesPerPixel * width * height];
569 MxU8* dst = m_copyBuffer;
571 for (
MxS32 i = 0; i < (m_copyRect.bottom - m_copyRect.top + 1); i++) {
572 memcpy(dst, src, copyPitch);
573 src += p_ddsc->lPitch;
[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.
MxLong Notify(MxParam &p_param) override
Notification callback responding to registered events such as EndAction and NewPresenter.
[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...
MxU32 GetFlags()
[AI] Returns the flag field for this action (bitmask).
void SetFlags(MxU32 p_flags)
[AI] Sets the flag bitmask controlling action logic (enabled, looping, etc).
void SetLoopCount(MxS32 p_loopCount)
[AI] Sets the loop count for this action.
@ c_bit5
[AI] Unknown - possibly reserved [AI]
@ c_world
[AI] Action is described in world-space coordinates [AI]
@ c_bit10
[AI] Unknown - possibly reserved [AI]
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.
[AI] Parameter object representing a single notification or event, carrying an identifier and sender ...
T GetY() const
[AI] Get Y coordinate.
T GetX() const
[AI] Get X coordinate.
MxPoint32 GetLocation() const
[AI] Returns the presenter's screen location (in pixels).
MxS32 GetCurrentTickleState() const
[AI] Returns the current tickle state.
@ e_streaming
[AI] Streaming or rendering actively.
MxDSAction * GetAction() const
[AI] Returns the current action being presented.
[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.
struct _DDSURFACEDESC FAR * LPDDSURFACEDESC
struct IDirectDrawSurface FAR * LPDIRECTDRAWSURFACE
#define DDERR_SURFACELOST
#define DECOMP_SIZE_ASSERT(T, S)
#define NULL
[AI] Null pointer value (C/C++ semantics).
#define FAILURE
[AI] Used to indicate a failed operation in result codes.
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
void SetAppCursor(Cursor p_cursor)
[AI] Sets the in-game cursor to a specified type.
@ e_cursorBusy
[AI] Busy or loading cursor (e.g., hourglass). [AI]
LegoVideoManager * VideoManager()
[AI] Accessor for the game's LegoVideoManager subsystem. Used for managing 3D/video hardware....
MxBackgroundAudioManager * BackgroundAudioManager()
[AI] Accessor for the background audio manager. Used for background music and ambient sounds....
LegoWorld * CurrentWorld()
[AI] Accessor for the currently active LegoWorld instance. [AI]
LegoInputManager * InputManager()
[AI] Accessor for the input manager, which handles keyboard, mouse, and controller input....
MxTickleManager * TickleManager()
[AI] Provides access to the global tickle manager.
@ c_notificationTransitioned
[AI] Object has transitioned states or locations [AI]
DDPIXELFORMAT ddpfPixelFormat
MxU8 m_bit0
[AI] Least significant bit of the flag byte.