Isle
|
[AI] Video subsystem manager for DirectDraw/Direct3D video rendering and presenter control. More...
#include <mxvideomanager.h>
Public Member Functions | |
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... | |
Protected Attributes | |
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] Video subsystem manager for DirectDraw/Direct3D video rendering and presenter control.
[AI] Forward declaration for the global video manager responsible for media presenter creation/setup.
The MxVideoManager class manages the DirectDraw and Direct3D interfaces, handles display surface allocation, region-based updates and invalidation, and sorts and calls tickle on registered video presenters. It can operate either using a tickle thread or by registering with the tickle manager for manual frame updates. Palette management, presenter sorting (by Z), and region-based redisplay are also handled here.
The video parameters, such as palette and display region, are managed using a MxVideoParam instance. This class is essential for rendering of animated and FMV sequences in LEGO Island and for their associated presenter ticks.
This manager may create its own DirectDraw/Direct3D interfaces, or be configured to use externally provided ones.
[AI]
Definition at line 30 of file mxvideomanager.h.
MxVideoManager::MxVideoManager | ( | ) |
[AI] Constructs a new MxVideoManager and initializes resources.
Definition at line 16 of file mxvideomanager.cpp.
|
override |
[AI] Destructor; cleans up all allocated resources (DirectDraw, display surface, etc.).
Definition at line 27 of file mxvideomanager.cpp.
|
virtual |
[AI] Similar to VTable0x28, this launches video with a new DirectDraw instance.
Only used when the manager is responsible for all video resources.
Initializes video, region, palettes, and display surface, with optional thread or tickle interval.
p_videoParam | Configuration parameters and palette for the video. |
p_frequencyMS | Tickle frequency in ms. |
p_createThread | Whether to use internal tickle thread or not. |
[AI]
Reimplemented in LegoVideoManager.
Definition at line 217 of file mxvideomanager.cpp.
|
overridevirtual |
[AI] Releases all display/video resources, any DirectDraw/Direct3D handles, and associated objects.
Called by the base destructor.
Reimplemented from MxMediaManager.
Definition at line 295 of file mxvideomanager.cpp.
void MxVideoManager::Destroy | ( | MxBool | p_fromDestructor | ) |
[AI] Destroys all resources; called with destruction source information.
Used for finer destructor control.
p_fromDestructor | TRUE if called from destructor, used for shutdown cleanup order. [AI] |
Definition at line 45 of file mxvideomanager.cpp.
|
inline |
[AI] Returns the current DirectDraw COM interface managed by this class (may be owned or external).
Definition at line 145 of file mxvideomanager.h.
|
inline |
[AI] Returns the display surface used for video output; for direct drawing and palette operations.
Definition at line 149 of file mxvideomanager.h.
|
inline |
[AI] Gets region-tracking structure managing currently invalidated rectangles.
Definition at line 153 of file mxvideomanager.h.
|
inline |
[AI] Retrieves the current video parameter configuration used by this manager.
Definition at line 141 of file mxvideomanager.h.
MxResult MxVideoManager::Init | ( | ) |
[AI] Initializes video resources and zeros pointers for this manager.
Definition at line 33 of file mxvideomanager.cpp.
void MxVideoManager::InvalidateRect | ( | MxRect32 & | p_rect | ) |
[AI] Invalidates a rectangular region in the display; marks it for redraw on next tick.
p_rect | Region of the display to be marked dirty and queued for redraw. |
Definition at line 301 of file mxvideomanager.cpp.
[AI] Applies (realizes) the palette to both MxVideoParam and hardware palette, and updates the display surface.
p_palette | Palette to use, can be NULL. [AI] |
Reimplemented in LegoVideoManager.
Definition at line 339 of file mxvideomanager.cpp.
void MxVideoManager::SortPresenterList | ( | ) |
[AI] Sorts presenters in descending Z order for proper overdraw order during tickle (bubble-sort).
Definition at line 101 of file mxvideomanager.cpp.
|
overridevirtual |
[AI] Runs the per-frame tick/update including presenter tickle, surface update, and region display.
Also sorts presenters and performs double-buffered region redraw.
Reimplemented from MxMediaManager.
Definition at line 313 of file mxvideomanager.cpp.
void MxVideoManager::UpdateRegion | ( | ) |
[AI] Updates the portion of the display surface that is marked dirty based on m_region, performs the actual onscreen blit.
Definition at line 88 of file mxvideomanager.cpp.
[AI] Updates the visible video sub-rectangle inside the overall frame; typically for sub-region blits.
p_x | Offset X (left). |
p_y | Offset Y (top). |
p_width | Display rectangle width. |
p_height | Display rectangle height. |
[AI]
Reimplemented in LegoVideoManager.
Definition at line 22 of file mxvideomanager.cpp.
|
virtual |
[AI] Main DirectDraw/Direct3D allocator and presenter chain creation.
Creates or assigns all underlying graphics interfaces, regions, palettes, and display surface, then spawns a tickle thread if so configured. p_pDirectDraw/p_pDirect3D are optionally provided externally. Also responsible for double-buffer backbuffer targets, and registering tickle interval.
p_videoParam | Video parameters, including palette, display region, etc. [AI] |
p_pDirectDraw | The DirectDraw interface, can be external or newly allocated. [AI] |
p_pDirect3D | The Direct3D2 interface, can be external or newly allocated. [AI] |
p_ddSurface1 | Primary DirectDraw surface for backbuffer. [AI] |
p_ddSurface2 | Secondary DirectDraw surface for double-buffering. [AI] |
p_ddClipper | The DirectDraw clipper for region management. [AI] |
p_frequencyMS | Tickle frequency in milliseconds. [AI] |
p_createThread | TRUE to create a dedicated tickle thread, FALSE to register with the main tickle manager. [AI] |
Definition at line 135 of file mxvideomanager.cpp.
|
protected |
[AI] Concrete blitting/output surface where final image is copied each frame. [0x58]
Definition at line 162 of file mxvideomanager.h.
|
protected |
[AI] Direct3D2 interface pointer, for 3D presentation and device context. [0x54]
Definition at line 161 of file mxvideomanager.h.
|
protected |
[AI] DirectDraw interface pointer. May be allocated here, or passed in/injected. [0x50]
Definition at line 160 of file mxvideomanager.h.
|
protected |
[AI] Tracks regions that have been invalidated and need to be updated/redrawn. [0x5c]
Definition at line 163 of file mxvideomanager.h.
|
protected |
[AI] TRUE if manager owns the DirectDraw/Direct3D objects and should release them; FALSE if external. [0x60]
Definition at line 164 of file mxvideomanager.h.
|
protected |
[AI] Video configuration, containing palette, source/dest rectangles, and other state. [Offset 0x2c]
Definition at line 159 of file mxvideomanager.h.