Isle
Loading...
Searching...
No Matches
LegoVideoManager Class Reference

[AI] Extends the functionality of MxVideoManager to provide LEGO Island–specific video and 3D graphics management, including interface with DirectDraw/Direct3D, 3D scene composition, custom resource and palette/sky color handling, and in-engine FPS/cursor overlays. More...

#include <legovideomanager.h>

Inheritance diagram for LegoVideoManager:
Collaboration diagram for LegoVideoManager:

Public Member Functions

 LegoVideoManager ()
 [AI] Constructs a new LegoVideoManager, initializing all graphics, rendering, and state members to default. More...
 
 ~LegoVideoManager () override
 [AI] Releases all allocated resources and restores graphics state. More...
 
int EnableRMDevice ()
 [AI] Enables the Direct3D Retained Mode (RM) rendering device, and re-creates the device/viewport if currently paused (e.g. More...
 
int DisableRMDevice ()
 [AI] Disables the Direct3D Retained Mode (RM) rendering device and saves/restores 3D state as needed. More...
 
void EnableFullScreenMovie (MxBool p_enable)
 [AI] Convenience method to enable or disable fullscreen movie playback with default scaling. More...
 
void EnableFullScreenMovie (MxBool p_enable, MxBool p_scale)
 [AI] Enables or disables fullscreen movie playback, with option to scale video content. More...
 
void MoveCursor (MxS32 p_cursorX, MxS32 p_cursorY)
 [AI] Updates the position of the custom software cursor overlay, and ensures it renders on the next frame. More...
 
void ToggleFPS (MxBool p_visible)
 [AI] Toggles display of the on-screen frames-per-second (FPS) overlay. More...
 
MxResult Tickle () override
 [AI] Performs per-frame update for all video, 3D, and interface layers. More...
 
void Destroy () override
 [AI] Cleans up graphics resources, disables overlays, removes from 3D scene and releases presenters/lists. More...
 
MxResult Create (MxVideoParam &p_videoParam, MxU32 p_frequencyMS, MxBool p_createThread) override
 [AI] Initializes LegoVideoManager with video parameters, creates all Direct3D, 3DManager, and renderer resources, and sets up camera/view state. More...
 
MxResult RealizePalette (MxPalette *) override
 [AI] Sets the realized palette to use for rendering and updates the display surface. More...
 
void UpdateView (MxU32 p_x, MxU32 p_y, MxU32 p_width, MxU32 p_height) override
 [AI] Notifies the manager of changes in view rectangle, updating the 3D device's viewport as needed. More...
 
virtual MxPresenterGetPresenterAt (MxS32 p_x, MxS32 p_y)
 [AI] Finds a presenter at the specific screen coordinates (for hit testing). More...
 
virtual LegoPhonemeListGetPhonemeList ()
 [AI] Returns the currently installed phoneme list for in-game speech synchronization. More...
 
void SetSkyColor (float p_red, float p_green, float p_blue)
 [AI] Sets the RGB color for the sky/background in the 3D view and updates the palette accordingly. More...
 
void OverrideSkyColor (MxBool p_shouldOverride)
 [AI] Requests that the palette override the sky color entry, for movie transitions or when re-enabling 3D rendering. More...
 
MxResult ResetPalette (MxBool p_ignoreSkyColor)
 [AI] Resets palette entries and re-installs base palette, restoring sky color if requested. More...
 
MxPresenterGetPresenterByActionObjectName (const char *p_char)
 [AI] Searches all active presenters for one associated with the given action object name. More...
 
void FUN_1007c520 ()
 [AI] Sets rendering state to allow PutData for all overlay presenters, disables 3D main rendering. More...
 
Tgl::RendererGetRenderer ()
 [AI] Returns the underlying renderer for this manager; normally a Direct3D Retained Mode wrapper. More...
 
Lego3DManagerGet3DManager ()
 [AI] Returns the Lego3DManager for this manager, which owns all 3D scene representations and view control. More...
 
LegoROIGetViewROI ()
 [AI] Returns the viewpoint ROI for the current view/camera. More...
 
MxDirect3DGetDirect3D ()
 [AI] Returns the active Direct3D wrapper (engine/utility) object. More...
 
MxBool GetRender3D ()
 [AI] Indicates if 3D rendering is enabled and active (false if paused/fullscreen movie). More...
 
double GetElapsedSeconds ()
 [AI] Returns the elapsed wall clock seconds since the last Tickle update (frame time). More...
 
void SetRender3D (MxBool p_render3d)
 [AI] Enables or disables main 3D rendering (e.g., used internally on video transitions). More...
 
void SetUnk0x554 (MxBool p_unk0x554)
 [AI] Used to control a non-interactive, non-main rendering update (PutData only). More...
 
- Public Member Functions inherited from MxVideoManager
 MxVideoManager ()
 [AI] Constructs a new MxVideoManager and initializes resources. More...
 
 ~MxVideoManager () override
 [AI] Destructor; cleans up all allocated resources (DirectDraw, display surface, etc.). More...
 
MxResult Tickle () override
 [AI] Runs the per-frame tick/update including presenter tickle, surface update, and region display. More...
 
void Destroy () override
 [AI] Releases all display/video resources, any DirectDraw/Direct3D handles, and associated objects. More...
 
virtual MxResult VTable0x28 (MxVideoParam &p_videoParam, LPDIRECTDRAW p_pDirectDraw, LPDIRECT3D2 p_pDirect3D, LPDIRECTDRAWSURFACE p_ddSurface1, LPDIRECTDRAWSURFACE p_ddSurface2, LPDIRECTDRAWCLIPPER p_ddClipper, MxU32 p_frequencyMS, MxBool p_createThread)
 [AI] Main DirectDraw/Direct3D allocator and presenter chain creation. More...
 
virtual MxResult Create (MxVideoParam &p_videoParam, MxU32 p_frequencyMS, MxBool p_createThread)
 [AI] Similar to VTable0x28, this launches video with a new DirectDraw instance. More...
 
virtual MxResult RealizePalette (MxPalette *p_palette)
 [AI] Applies (realizes) the palette to both MxVideoParam and hardware palette, and updates the display surface. More...
 
virtual void UpdateView (MxU32 p_x, MxU32 p_y, MxU32 p_width, MxU32 p_height)
 [AI] Updates the visible video sub-rectangle inside the overall frame; typically for sub-region blits. More...
 
MxResult Init ()
 [AI] Initializes video resources and zeros pointers for this manager. More...
 
void Destroy (MxBool p_fromDestructor)
 [AI] Destroys all resources; called with destruction source information. More...
 
void InvalidateRect (MxRect32 &p_rect)
 [AI] Invalidates a rectangular region in the display; marks it for redraw on next tick. More...
 
void SortPresenterList ()
 [AI] Sorts presenters in descending Z order for proper overdraw order during tickle (bubble-sort). More...
 
void UpdateRegion ()
 [AI] Updates the portion of the display surface that is marked dirty based on m_region, performs the actual onscreen blit. More...
 
MxVideoParamGetVideoParam ()
 [AI] Retrieves the current video parameter configuration used by this manager. More...
 
LPDIRECTDRAW GetDirectDraw ()
 [AI] Returns the current DirectDraw COM interface managed by this class (may be owned or external). More...
 
MxDisplaySurfaceGetDisplaySurface ()
 [AI] Returns the display surface used for video output; for direct drawing and palette operations. More...
 
MxRegionGetRegion ()
 [AI] Gets region-tracking structure managing currently invalidated rectangles. More...
 
- Public Member Functions inherited from MxMediaManager
 MxMediaManager ()
 [AI] Constructor. More...
 
 ~MxMediaManager () override
 [AI] Destructor. More...
 
MxResult Tickle () override
 [AI] Called by the tickle manager to step through and update all presenters, and process their output data. More...
 
virtual MxResult Create ()
 [AI] Allocates and initializes the internal presenter list for this manager, ensuring thread safety. More...
 
virtual void Destroy ()
 [AI] Destroys all registered presenters and resets the internal state, ensuring safe resource disposal. More...
 
virtual void RegisterPresenter (MxPresenter &p_presenter)
 [AI] Register a new presenter for tickle management and playback coordination. More...
 
virtual void UnregisterPresenter (MxPresenter &p_presenter)
 [AI] Remove a presenter from tickle and managed output lists. More...
 
virtual void StopPresenters ()
 [AI] Stops/ends the action on all registered presenters, typically halting all playback and output. More...
 
MxResult Init ()
 [AI] Initializes all internal members to their default values. More...
 
- Public Member Functions inherited from MxCore
 MxCore ()
 [AI] Constructs a new MxCore object and assigns it a unique id. More...
 
virtual ~MxCore ()
 [AI] Virtual destructor. Required for correct polymorphic cleanup in derived classes. More...
 
virtual MxLong Notify (MxParam &p_param)
 [AI] Virtual callback notification mechanism. More...
 
virtual MxResult Tickle ()
 [AI] Called by tickle managers to allow the object to update itself. More...
 
virtual const char * ClassName () const
 [AI] Returns the runtime class name of this object. More...
 
virtual MxBool IsA (const char *p_name) const
 [AI] Checks whether this object's class type or parents match the given name. More...
 
MxU32 GetId ()
 [AI] Gets the unique (per-process) id assigned to this object instance. More...
 

Additional Inherited Members

- Protected Attributes inherited from MxVideoManager
MxVideoParam m_videoParam
 [AI] Video configuration, containing palette, source/dest rectangles, and other state. [Offset 0x2c] More...
 
LPDIRECTDRAW m_pDirectDraw
 [AI] DirectDraw interface pointer. May be allocated here, or passed in/injected. [0x50] More...
 
LPDIRECT3D2 m_pDirect3D
 [AI] Direct3D2 interface pointer, for 3D presentation and device context. [0x54] More...
 
MxDisplaySurfacem_displaySurface
 [AI] Concrete blitting/output surface where final image is copied each frame. [0x58] More...
 
MxRegionm_region
 [AI] Tracks regions that have been invalidated and need to be updated/redrawn. [0x5c] More...
 
MxBool m_unk0x60
 [AI] TRUE if manager owns the DirectDraw/Direct3D objects and should release them; FALSE if external. [0x60] More...
 
- Protected Attributes inherited from MxMediaManager
MxPresenterListm_presenters
 [AI] Pointer to list of currently registered (active) presenters. More...
 
MxThreadm_thread
 [AI] Optional pointer to a worker thread used for media dispatch/IO (if multi-threaded operation is used, otherwise NULL). More...
 
MxCriticalSection m_criticalSection
 [AI] Critical section object used for guarding access to the presenter list and internal members for thread safety. More...
 

Detailed Description

[AI] Extends the functionality of MxVideoManager to provide LEGO Island–specific video and 3D graphics management, including interface with DirectDraw/Direct3D, 3D scene composition, custom resource and palette/sky color handling, and in-engine FPS/cursor overlays.

[AI]

[AI] This manager is responsible for handling both 2D (video overlays, cursor, movies) and 3D rendering using Direct3D Retained Mode, palette manipulations, and integrating multiple engine components including Lego3DManager, phoneme reference lists for speech, and presenter-layer management. It also manages DirectDraw surfaces for custom overlays like the cursor and FPS meter, handles switching between fullscreen movies and gameplay, and exposes logic for enabling/disabling the 3D device state. [AI]

Definition at line 29 of file legovideomanager.h.

Constructor & Destructor Documentation

◆ LegoVideoManager()

LegoVideoManager::LegoVideoManager ( )

[AI] Constructs a new LegoVideoManager, initializing all graphics, rendering, and state members to default.

[AI]

Definition at line 29 of file legovideomanager.cpp.

◆ ~LegoVideoManager()

LegoVideoManager::~LegoVideoManager ( )
override

[AI] Releases all allocated resources and restores graphics state.

[AI]

Definition at line 57 of file legovideomanager.cpp.

Member Function Documentation

◆ Create()

MxResult LegoVideoManager::Create ( MxVideoParam p_videoParam,
MxU32  p_frequencyMS,
MxBool  p_createThread 
)
overridevirtual

[AI] Initializes LegoVideoManager with video parameters, creates all Direct3D, 3DManager, and renderer resources, and sets up camera/view state.

[AI]

Parameters
p_videoParamVideo settings (resolution, palette, etc.) [AI]
p_frequencyMSTick/update frequency for rendering. [AI]
p_createThreadIf true, creates a separate rendering thread. [AI]
Returns
[AI] SUCCESS if all initialization succeeded; otherwise FAILURE. [AI]

Reimplemented from MxVideoManager.

Definition at line 75 of file legovideomanager.cpp.

◆ Destroy()

void LegoVideoManager::Destroy ( )
overridevirtual

[AI] Cleans up graphics resources, disables overlays, removes from 3D scene and releases presenters/lists.

[AI]

Reimplemented from MxMediaManager.

Definition at line 226 of file legovideomanager.cpp.

◆ DisableRMDevice()

int LegoVideoManager::DisableRMDevice ( )

[AI] Disables the Direct3D Retained Mode (RM) rendering device and saves/restores 3D state as needed.

[AI]

Returns
[AI] Returns 0 on success, -1 if already paused or on error.

Definition at line 733 of file legovideomanager.cpp.

◆ EnableFullScreenMovie() [1/2]

void LegoVideoManager::EnableFullScreenMovie ( MxBool  p_enable)

[AI] Convenience method to enable or disable fullscreen movie playback with default scaling.

[AI]

Parameters
p_enableTrue to enable fullscreen movie, false to disable. [AI]

Definition at line 580 of file legovideomanager.cpp.

◆ EnableFullScreenMovie() [2/2]

void LegoVideoManager::EnableFullScreenMovie ( MxBool  p_enable,
MxBool  p_scale 
)

[AI] Enables or disables fullscreen movie playback, with option to scale video content.

[AI]

Parameters
p_enableTrue to enable, false to disable. [AI]
p_scaleTrue to scale movie to window/screen size; false to maintain original size. [AI]

Definition at line 586 of file legovideomanager.cpp.

◆ EnableRMDevice()

int LegoVideoManager::EnableRMDevice ( )

[AI] Enables the Direct3D Retained Mode (RM) rendering device, and re-creates the device/viewport if currently paused (e.g.

after a fullscreen movie). [AI]

Returns
[AI] Returns 0 on success, -1 if not paused or on error.

Definition at line 684 of file legovideomanager.cpp.

◆ FUN_1007c520()

void LegoVideoManager::FUN_1007c520 ( )

[AI] Sets rendering state to allow PutData for all overlay presenters, disables 3D main rendering.

[AI]

Definition at line 670 of file legovideomanager.cpp.

◆ Get3DManager()

Lego3DManager * LegoVideoManager::Get3DManager ( )
inline

[AI] Returns the Lego3DManager for this manager, which owns all 3D scene representations and view control.

[AI]

Definition at line 168 of file legovideomanager.h.

◆ GetDirect3D()

MxDirect3D * LegoVideoManager::GetDirect3D ( )
inline

[AI] Returns the active Direct3D wrapper (engine/utility) object.

[AI]

Definition at line 178 of file legovideomanager.h.

◆ GetElapsedSeconds()

double LegoVideoManager::GetElapsedSeconds ( )
inline

[AI] Returns the elapsed wall clock seconds since the last Tickle update (frame time).

[AI]

Definition at line 188 of file legovideomanager.h.

◆ GetPhonemeList()

virtual LegoPhonemeList * LegoVideoManager::GetPhonemeList ( )
inlinevirtual

[AI] Returns the currently installed phoneme list for in-game speech synchronization.

[AI]

Returns
[AI] The LegoPhonemeList reference pointer. [AI]

Definition at line 124 of file legovideomanager.h.

◆ GetPresenterAt()

MxPresenter * LegoVideoManager::GetPresenterAt ( MxS32  p_x,
MxS32  p_y 
)
virtual

[AI] Finds a presenter at the specific screen coordinates (for hit testing).

[AI]

Parameters
p_xScreen X coordinate. [AI]
p_yScreen Y coordinate. [AI]
Returns
[AI] The presenter if found (typically for interactive overlays, e.g. buttons), or NULL otherwise. [AI]

Definition at line 517 of file legovideomanager.cpp.

◆ GetPresenterByActionObjectName()

MxPresenter * LegoVideoManager::GetPresenterByActionObjectName ( const char *  p_char)

[AI] Searches all active presenters for one associated with the given action object name.

[AI]

Parameters
p_charObject/action name of interest. [AI]
Returns
[AI] Pointer to presenter if found, NULL otherwise. [AI]

Definition at line 533 of file legovideomanager.cpp.

◆ GetRender3D()

MxBool LegoVideoManager::GetRender3D ( )
inline

[AI] Indicates if 3D rendering is enabled and active (false if paused/fullscreen movie).

[AI]

Definition at line 183 of file legovideomanager.h.

◆ GetRenderer()

Tgl::Renderer * LegoVideoManager::GetRenderer ( )
inline

[AI] Returns the underlying renderer for this manager; normally a Direct3D Retained Mode wrapper.

[AI]

Returns
[AI] The Tgl::Renderer pointer. [AI]

Definition at line 163 of file legovideomanager.h.

◆ GetViewROI()

LegoROI * LegoVideoManager::GetViewROI ( )
inline

[AI] Returns the viewpoint ROI for the current view/camera.

[AI]

Definition at line 173 of file legovideomanager.h.

◆ MoveCursor()

void LegoVideoManager::MoveCursor ( MxS32  p_cursorX,
MxS32  p_cursorY 
)

[AI] Updates the position of the custom software cursor overlay, and ensures it renders on the next frame.

Caps position within window bounds. [AI]

Parameters
p_cursorXX pixel coordinate. [AI]
p_cursorYY pixel coordinate. [AI]

Definition at line 260 of file legovideomanager.cpp.

◆ OverrideSkyColor()

void LegoVideoManager::OverrideSkyColor ( MxBool  p_shouldOverride)

[AI] Requests that the palette override the sky color entry, for movie transitions or when re-enabling 3D rendering.

[AI]

Parameters
p_shouldOverrideTrue to force sky color override; false to allow normal palette. [AI]

Definition at line 649 of file legovideomanager.cpp.

◆ RealizePalette()

MxResult LegoVideoManager::RealizePalette ( MxPalette p_pallete)
overridevirtual

[AI] Sets the realized palette to use for rendering and updates the display surface.

[AI]

Parameters
p_paletteInput palette to realize and install. [AI]
Returns
[AI] Returns SUCCESS if palette set. [AI]

Reimplemented from MxVideoManager.

Definition at line 554 of file legovideomanager.cpp.

◆ ResetPalette()

MxResult LegoVideoManager::ResetPalette ( MxBool  p_ignoreSkyColor)

[AI] Resets palette entries and re-installs base palette, restoring sky color if requested.

[AI]

Parameters
p_ignoreSkyColorTrue to keep current sky color, false to reload from default. [AI]
Returns
[AI] Returns SUCCESS if palette reset. [AI]

Definition at line 566 of file legovideomanager.cpp.

◆ SetRender3D()

void LegoVideoManager::SetRender3D ( MxBool  p_render3d)
inline

[AI] Enables or disables main 3D rendering (e.g., used internally on video transitions).

[AI]

Parameters
p_render3dTrue to enable, false to disable. [AI]

Definition at line 194 of file legovideomanager.h.

◆ SetSkyColor()

void LegoVideoManager::SetSkyColor ( float  p_red,
float  p_green,
float  p_blue 
)

[AI] Sets the RGB color for the sky/background in the 3D view and updates the palette accordingly.

[AI]

Parameters
p_redRed component (0-1). [AI]
p_greenGreen component (0-1). [AI]
p_blueBlue component (0-1). [AI]

Definition at line 635 of file legovideomanager.cpp.

◆ SetUnk0x554()

void LegoVideoManager::SetUnk0x554 ( MxBool  p_unk0x554)
inline

[AI] Used to control a non-interactive, non-main rendering update (PutData only).

[AI]

Parameters
p_unk0x554True to enter overlay (PutData-only) mode. [AI]

Definition at line 200 of file legovideomanager.h.

◆ Tickle()

MxResult LegoVideoManager::Tickle ( )
overridevirtual

[AI] Performs per-frame update for all video, 3D, and interface layers.

Includes tickling all presenters, handling overlays, and performing buffer swaps. [AI]

Returns
[AI] Always returns SUCCESS. [AI]

Reimplemented from MxCore.

Definition at line 289 of file legovideomanager.cpp.

◆ ToggleFPS()

void LegoVideoManager::ToggleFPS ( MxBool  p_visible)

[AI] Toggles display of the on-screen frames-per-second (FPS) overlay.

[AI]

Parameters
p_visibleShow FPS overlay if true, hide if false. [AI]

Definition at line 276 of file legovideomanager.cpp.

◆ UpdateView()

void LegoVideoManager::UpdateView ( MxU32  p_x,
MxU32  p_y,
MxU32  p_width,
MxU32  p_height 
)
overridevirtual

[AI] Notifies the manager of changes in view rectangle, updating the 3D device's viewport as needed.

[AI]

Parameters
p_xLeft pixel. [AI]
p_yTop pixel. [AI]
p_widthNew width; 0 for unchanged. [AI]
p_heightNew height; 0 for unchanged. [AI]

Reimplemented from MxVideoManager.

Definition at line 655 of file legovideomanager.cpp.


The documentation for this class was generated from the following files: