Isle
|
[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>
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 MxPresenter * | GetPresenterAt (MxS32 p_x, MxS32 p_y) |
[AI] Finds a presenter at the specific screen coordinates (for hit testing). More... | |
virtual LegoPhonemeList * | GetPhonemeList () |
[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... | |
MxPresenter * | GetPresenterByActionObjectName (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::Renderer * | GetRenderer () |
[AI] Returns the underlying renderer for this manager; normally a Direct3D Retained Mode wrapper. More... | |
Lego3DManager * | Get3DManager () |
[AI] Returns the Lego3DManager for this manager, which owns all 3D scene representations and view control. More... | |
LegoROI * | GetViewROI () |
[AI] Returns the viewpoint ROI for the current view/camera. More... | |
MxDirect3D * | GetDirect3D () |
[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... | |
![]() | |
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... | |
MxVideoParam & | GetVideoParam () |
[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... | |
MxDisplaySurface * | GetDisplaySurface () |
[AI] Returns the display surface used for video output; for direct drawing and palette operations. More... | |
MxRegion * | GetRegion () |
[AI] Gets region-tracking structure managing currently invalidated rectangles. More... | |
![]() | |
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... | |
![]() | |
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 | |
![]() | |
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... | |
MxDisplaySurface * | m_displaySurface |
[AI] Concrete blitting/output surface where final image is copied each frame. [0x58] More... | |
MxRegion * | m_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... | |
![]() | |
MxPresenterList * | m_presenters |
[AI] Pointer to list of currently registered (active) presenters. More... | |
MxThread * | m_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... | |
[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.
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.
|
override |
[AI] Releases all allocated resources and restores graphics state.
[AI]
Definition at line 57 of file legovideomanager.cpp.
|
overridevirtual |
[AI] Initializes LegoVideoManager with video parameters, creates all Direct3D, 3DManager, and renderer resources, and sets up camera/view state.
[AI]
p_videoParam | Video settings (resolution, palette, etc.) [AI] |
p_frequencyMS | Tick/update frequency for rendering. [AI] |
p_createThread | If true, creates a separate rendering thread. [AI] |
Reimplemented from MxVideoManager.
Definition at line 75 of file legovideomanager.cpp.
|
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.
int LegoVideoManager::DisableRMDevice | ( | ) |
[AI] Disables the Direct3D Retained Mode (RM) rendering device and saves/restores 3D state as needed.
[AI]
Definition at line 733 of file legovideomanager.cpp.
void LegoVideoManager::EnableFullScreenMovie | ( | MxBool | p_enable | ) |
[AI] Convenience method to enable or disable fullscreen movie playback with default scaling.
[AI]
p_enable | True to enable fullscreen movie, false to disable. [AI] |
Definition at line 580 of file legovideomanager.cpp.
[AI] Enables or disables fullscreen movie playback, with option to scale video content.
[AI]
p_enable | True to enable, false to disable. [AI] |
p_scale | True to scale movie to window/screen size; false to maintain original size. [AI] |
Definition at line 586 of file legovideomanager.cpp.
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]
Definition at line 684 of file legovideomanager.cpp.
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.
|
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.
|
inline |
[AI] Returns the active Direct3D wrapper (engine/utility) object.
[AI]
Definition at line 178 of file legovideomanager.h.
|
inline |
[AI] Returns the elapsed wall clock seconds since the last Tickle update (frame time).
[AI]
Definition at line 188 of file legovideomanager.h.
|
inlinevirtual |
[AI] Returns the currently installed phoneme list for in-game speech synchronization.
[AI]
Definition at line 124 of file legovideomanager.h.
|
virtual |
[AI] Finds a presenter at the specific screen coordinates (for hit testing).
[AI]
p_x | Screen X coordinate. [AI] |
p_y | Screen Y coordinate. [AI] |
Definition at line 517 of file legovideomanager.cpp.
MxPresenter * LegoVideoManager::GetPresenterByActionObjectName | ( | const char * | p_char | ) |
[AI] Searches all active presenters for one associated with the given action object name.
[AI]
p_char | Object/action name of interest. [AI] |
Definition at line 533 of file legovideomanager.cpp.
|
inline |
[AI] Indicates if 3D rendering is enabled and active (false if paused/fullscreen movie).
[AI]
Definition at line 183 of file legovideomanager.h.
|
inline |
[AI] Returns the underlying renderer for this manager; normally a Direct3D Retained Mode wrapper.
[AI]
Definition at line 163 of file legovideomanager.h.
|
inline |
[AI] Returns the viewpoint ROI for the current view/camera.
[AI]
Definition at line 173 of file legovideomanager.h.
[AI] Updates the position of the custom software cursor overlay, and ensures it renders on the next frame.
Caps position within window bounds. [AI]
p_cursorX | X pixel coordinate. [AI] |
p_cursorY | Y pixel coordinate. [AI] |
Definition at line 260 of file legovideomanager.cpp.
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]
p_shouldOverride | True to force sky color override; false to allow normal palette. [AI] |
Definition at line 649 of file legovideomanager.cpp.
[AI] Sets the realized palette to use for rendering and updates the display surface.
[AI]
p_palette | Input palette to realize and install. [AI] |
Reimplemented from MxVideoManager.
Definition at line 554 of file legovideomanager.cpp.
[AI] Resets palette entries and re-installs base palette, restoring sky color if requested.
[AI]
p_ignoreSkyColor | True to keep current sky color, false to reload from default. [AI] |
Definition at line 566 of file legovideomanager.cpp.
|
inline |
[AI] Enables or disables main 3D rendering (e.g., used internally on video transitions).
[AI]
p_render3d | True to enable, false to disable. [AI] |
Definition at line 194 of file legovideomanager.h.
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]
p_red | Red component (0-1). [AI] |
p_green | Green component (0-1). [AI] |
p_blue | Blue component (0-1). [AI] |
Definition at line 635 of file legovideomanager.cpp.
|
inline |
[AI] Used to control a non-interactive, non-main rendering update (PutData only).
[AI]
p_unk0x554 | True to enter overlay (PutData-only) mode. [AI] |
Definition at line 200 of file legovideomanager.h.
|
overridevirtual |
[AI] Performs per-frame update for all video, 3D, and interface layers.
Includes tickling all presenters, handling overlays, and performing buffer swaps. [AI]
Reimplemented from MxCore.
Definition at line 289 of file legovideomanager.cpp.
void LegoVideoManager::ToggleFPS | ( | MxBool | p_visible | ) |
[AI] Toggles display of the on-screen frames-per-second (FPS) overlay.
[AI]
p_visible | Show FPS overlay if true, hide if false. [AI] |
Definition at line 276 of file legovideomanager.cpp.
|
overridevirtual |
[AI] Notifies the manager of changes in view rectangle, updating the 3D device's viewport as needed.
[AI]
p_x | Left pixel. [AI] |
p_y | Top pixel. [AI] |
p_width | New width; 0 for unchanged. [AI] |
p_height | New height; 0 for unchanged. [AI] |
Reimplemented from MxVideoManager.
Definition at line 655 of file legovideomanager.cpp.