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

[AI] Video subsystem manager for DirectDraw/Direct3D video rendering and presenter control. More...

#include <mxvideomanager.h>

Inheritance diagram for MxVideoManager:
Collaboration diagram for MxVideoManager:

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...
 
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...
 

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...
 
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] 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.

Constructor & Destructor Documentation

◆ MxVideoManager()

MxVideoManager::MxVideoManager ( )

[AI] Constructs a new MxVideoManager and initializes resources.

Definition at line 16 of file mxvideomanager.cpp.

◆ ~MxVideoManager()

MxVideoManager::~MxVideoManager ( )
override

[AI] Destructor; cleans up all allocated resources (DirectDraw, display surface, etc.).

Definition at line 27 of file mxvideomanager.cpp.

Member Function Documentation

◆ Create()

MxResult MxVideoManager::Create ( MxVideoParam p_videoParam,
MxU32  p_frequencyMS,
MxBool  p_createThread 
)
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.

Parameters
p_videoParamConfiguration parameters and palette for the video.
p_frequencyMSTickle frequency in ms.
p_createThreadWhether to use internal tickle thread or not.
Returns
MxResult indicating status.

[AI]

Reimplemented in LegoVideoManager.

Definition at line 217 of file mxvideomanager.cpp.

◆ Destroy() [1/2]

void MxVideoManager::Destroy ( )
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.

◆ Destroy() [2/2]

void MxVideoManager::Destroy ( MxBool  p_fromDestructor)

[AI] Destroys all resources; called with destruction source information.

Used for finer destructor control.

Parameters
p_fromDestructorTRUE if called from destructor, used for shutdown cleanup order. [AI]

Definition at line 45 of file mxvideomanager.cpp.

◆ GetDirectDraw()

LPDIRECTDRAW MxVideoManager::GetDirectDraw ( )
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.

◆ GetDisplaySurface()

MxDisplaySurface * MxVideoManager::GetDisplaySurface ( )
inline

[AI] Returns the display surface used for video output; for direct drawing and palette operations.

Definition at line 149 of file mxvideomanager.h.

◆ GetRegion()

MxRegion * MxVideoManager::GetRegion ( )
inline

[AI] Gets region-tracking structure managing currently invalidated rectangles.

Definition at line 153 of file mxvideomanager.h.

◆ GetVideoParam()

MxVideoParam & MxVideoManager::GetVideoParam ( )
inline

[AI] Retrieves the current video parameter configuration used by this manager.

Returns
Reference to the video parameter structure in use for this video manager.

Definition at line 141 of file mxvideomanager.h.

◆ Init()

MxResult MxVideoManager::Init ( )

[AI] Initializes video resources and zeros pointers for this manager.

Returns
MxResult indicating success/failure.

Definition at line 33 of file mxvideomanager.cpp.

◆ InvalidateRect()

void MxVideoManager::InvalidateRect ( MxRect32 p_rect)

[AI] Invalidates a rectangular region in the display; marks it for redraw on next tick.

Parameters
p_rectRegion of the display to be marked dirty and queued for redraw.

Definition at line 301 of file mxvideomanager.cpp.

◆ RealizePalette()

MxResult MxVideoManager::RealizePalette ( MxPalette p_palette)
virtual

[AI] Applies (realizes) the palette to both MxVideoParam and hardware palette, and updates the display surface.

Parameters
p_palettePalette to use, can be NULL. [AI]
Returns
MxResult for operation.

Reimplemented in LegoVideoManager.

Definition at line 339 of file mxvideomanager.cpp.

◆ SortPresenterList()

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.

◆ Tickle()

MxResult MxVideoManager::Tickle ( )
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.

Returns
MxResult indicating operation success or failure. [AI]

Reimplemented from MxMediaManager.

Definition at line 313 of file mxvideomanager.cpp.

◆ UpdateRegion()

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.

◆ UpdateView()

void MxVideoManager::UpdateView ( MxU32  p_x,
MxU32  p_y,
MxU32  p_width,
MxU32  p_height 
)
virtual

[AI] Updates the visible video sub-rectangle inside the overall frame; typically for sub-region blits.

Parameters
p_xOffset X (left).
p_yOffset Y (top).
p_widthDisplay rectangle width.
p_heightDisplay rectangle height.

[AI]

Reimplemented in LegoVideoManager.

Definition at line 22 of file mxvideomanager.cpp.

◆ VTable0x28()

MxResult MxVideoManager::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 
)
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.

Parameters
p_videoParamVideo parameters, including palette, display region, etc. [AI]
p_pDirectDrawThe DirectDraw interface, can be external or newly allocated. [AI]
p_pDirect3DThe Direct3D2 interface, can be external or newly allocated. [AI]
p_ddSurface1Primary DirectDraw surface for backbuffer. [AI]
p_ddSurface2Secondary DirectDraw surface for double-buffering. [AI]
p_ddClipperThe DirectDraw clipper for region management. [AI]
p_frequencyMSTickle frequency in milliseconds. [AI]
p_createThreadTRUE to create a dedicated tickle thread, FALSE to register with the main tickle manager. [AI]
Returns
MxResult indicating success/failure. [AI]

Definition at line 135 of file mxvideomanager.cpp.

Member Data Documentation

◆ m_displaySurface

MxDisplaySurface* MxVideoManager::m_displaySurface
protected

[AI] Concrete blitting/output surface where final image is copied each frame. [0x58]

Definition at line 162 of file mxvideomanager.h.

◆ m_pDirect3D

LPDIRECT3D2 MxVideoManager::m_pDirect3D
protected

[AI] Direct3D2 interface pointer, for 3D presentation and device context. [0x54]

Definition at line 161 of file mxvideomanager.h.

◆ m_pDirectDraw

LPDIRECTDRAW MxVideoManager::m_pDirectDraw
protected

[AI] DirectDraw interface pointer. May be allocated here, or passed in/injected. [0x50]

Definition at line 160 of file mxvideomanager.h.

◆ m_region

MxRegion* MxVideoManager::m_region
protected

[AI] Tracks regions that have been invalidated and need to be updated/redrawn. [0x5c]

Definition at line 163 of file mxvideomanager.h.

◆ m_unk0x60

MxBool MxVideoManager::m_unk0x60
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.

◆ m_videoParam

MxVideoParam MxVideoManager::m_videoParam
protected

[AI] Video configuration, containing palette, source/dest rectangles, and other state. [Offset 0x2c]

Definition at line 159 of file mxvideomanager.h.


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