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

Provides a DirectDraw-based drawing surface for blitting bitmaps, managing palette, and screen updates. More...

#include <mxdisplaysurface.h>

Inheritance diagram for MxDisplaySurface:
Collaboration diagram for MxDisplaySurface:

Public Member Functions

 MxDisplaySurface ()
 [AI] Constructs the display surface and initializes all members. More...
 
 ~MxDisplaySurface () override
 [AI] Destroys the display surface and releases DirectDraw objects and resources. More...
 
virtual MxResult Init (MxVideoParam &p_videoParam, LPDIRECTDRAWSURFACE p_ddSurface1, LPDIRECTDRAWSURFACE p_ddSurface2, LPDIRECTDRAWCLIPPER p_ddClipper)
 [AI] Initializes the surface object with given video parameters, DirectDraw surfaces, and a clipper. More...
 
virtual MxResult Create (MxVideoParam &p_videoParam)
 [AI] Creates DirectDraw surfaces and initializes based on the desired video mode. More...
 
virtual void Destroy ()
 [AI] Releases all DirectDraw surfaces and resources held by this object. More...
 
virtual void SetPalette (MxPalette *p_palette)
 [AI] Sets the palette used for the primary and secondary DirectDraw surfaces. More...
 
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. More...
 
virtual void VTable0x28 (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 the back surface, specified by coordinates and output size. More...
 
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. More...
 
virtual void VTable0x30 (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), outputting to active back surface. More...
 
virtual void VTable0x34 (MxU8 *p_pixels, MxS32 p_bpp, MxS32 p_width, MxS32 p_height, MxS32 p_x, MxS32 p_y)
 [AI] Directly writes an array of pixel data into the back surface at the given rectangle. More...
 
virtual void Display (MxS32 p_left, MxS32 p_top, MxS32 p_left2, MxS32 p_top2, MxS32 p_width, MxS32 p_height)
 [AI] Presents the back buffer contents to the front buffer or window. More...
 
virtual void GetDC (HDC *p_hdc)
 [AI] Acquires a Win32 device context (DC) for the back buffer surface, for GDI drawing. More...
 
virtual void ReleaseDC (HDC p_hdc)
 [AI] Releases a device context (DC) previously acquired for the back surface. More...
 
virtual LPDIRECTDRAWSURFACE VTable0x44 (MxBitmap *p_bitmap, undefined4 *p_ret, undefined4 p_doNotWriteToSurface, undefined4 p_transparent)
 [AI] Allocates a DirectDraw surface for a bitmap to allow hardware blitting/transparency. More...
 
void ClearScreen ()
 [AI] Fills the current back buffer with black (clears the display area). [AI] More...
 
LPDIRECTDRAWSURFACE GetDirectDrawSurface1 ()
 [AI] Returns the primary DirectDraw surface (front buffer). More...
 
LPDIRECTDRAWSURFACE GetDirectDrawSurface2 ()
 [AI] Returns the secondary DirectDraw surface (back buffer). More...
 
MxVideoParamGetVideoParam ()
 [AI] Gets the video parameter configuration (mode/resolution/etc) in use by this surface. More...
 
void DrawTransparentRLE (MxU8 *&p_bitmapData, MxU8 *&p_surfaceData, MxU32 p_bitmapSize, MxS32 p_width, MxS32 p_height, MxLong p_pitch, MxU8 p_bpp)
 [AI] Performs RLE-based transparent drawing from an RLE-compressed bitmap into the given surface. More...
 
LPDIRECTDRAWSURFACE FUN_100bc8b0 (MxS32 width, MxS32 height)
 [AI] Creates a 16-bit DirectDraw surface of specified size, either in video or system memory. 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...
 

Static Public Member Functions

static LPDIRECTDRAWSURFACE CreateCursorSurface ()
 [AI] Creates and draws a 16x16 cursor DirectDraw surface. More...
 
static LPDIRECTDRAWSURFACE CopySurface (LPDIRECTDRAWSURFACE p_src)
 [AI] Creates a deep copy of the provided surface (new DirectDraw surface with same content). More...
 

Detailed Description

Provides a DirectDraw-based drawing surface for blitting bitmaps, managing palette, and screen updates.

[AI]

[AI] This class manages the primary and secondary DirectDraw surfaces for the purpose of rendering game frames, copying bitmaps, handling palette changes, managing double buffering, and supporting transparent RLE bitmap blits. It works alongside MxVideoParam for resolution, flipping, palette, and fullscreen/window handling. [AI] []

Definition at line 19 of file mxdisplaysurface.h.

Constructor & Destructor Documentation

◆ MxDisplaySurface()

MxDisplaySurface::MxDisplaySurface ( )

[AI] Constructs the display surface and initializes all members.

Definition at line 22 of file mxdisplaysurface.cpp.

◆ ~MxDisplaySurface()

MxDisplaySurface::~MxDisplaySurface ( )
override

[AI] Destroys the display surface and releases DirectDraw objects and resources.

Definition at line 28 of file mxdisplaysurface.cpp.

Member Function Documentation

◆ ClearScreen()

void MxDisplaySurface::ClearScreen ( )

[AI] Fills the current back buffer with black (clears the display area). [AI]

Definition at line 45 of file mxdisplaysurface.cpp.

◆ CopySurface()

LPDIRECTDRAWSURFACE MxDisplaySurface::CopySurface ( LPDIRECTDRAWSURFACE  p_src)
static

[AI] Creates a deep copy of the provided surface (new DirectDraw surface with same content).

[AI]

Parameters
p_srcSource DirectDraw surface to copy. [AI]
Returns
New surface on success, or NULL. [AI]

Definition at line 1036 of file mxdisplaysurface.cpp.

◆ Create()

MxResult MxDisplaySurface::Create ( MxVideoParam p_videoParam)
virtual

[AI] Creates DirectDraw surfaces and initializes based on the desired video mode.

[AI]

Parameters
p_videoParamVideo parameters describing target video mode and properties. [AI]
Returns
SUCCESS on success, FAILURE otherwise. [AI]

Definition at line 140 of file mxdisplaysurface.cpp.

◆ CreateCursorSurface()

LPDIRECTDRAWSURFACE MxDisplaySurface::CreateCursorSurface ( )
static

[AI] Creates and draws a 16x16 cursor DirectDraw surface.

[AI]

Returns
Pointer to the new cursor surface, or NULL on error. [AI]

Definition at line 1062 of file mxdisplaysurface.cpp.

◆ Destroy()

void MxDisplaySurface::Destroy ( )
virtual

[AI] Releases all DirectDraw surfaces and resources held by this object.

Definition at line 252 of file mxdisplaysurface.cpp.

◆ Display()

void MxDisplaySurface::Display ( MxS32  p_left,
MxS32  p_top,
MxS32  p_left2,
MxS32  p_top2,
MxS32  p_width,
MxS32  p_height 
)
virtual

[AI] Presents the back buffer contents to the front buffer or window.

[AI]

Parameters
p_left/p_topSource rectangle. [AI]
p_left2/p_top2Destination rectangle (windowed mode). [AI]
p_width/p_heightSize of area to copy or flip. [AI]

Definition at line 824 of file mxdisplaysurface.cpp.

◆ DrawTransparentRLE()

void MxDisplaySurface::DrawTransparentRLE ( MxU8 *&  p_bitmapData,
MxU8 *&  p_surfaceData,
MxU32  p_bitmapSize,
MxS32  p_width,
MxS32  p_height,
MxLong  p_pitch,
MxU8  p_bpp 
)

[AI] Performs RLE-based transparent drawing from an RLE-compressed bitmap into the given surface.

[AI]

Parameters
p_bitmapDataCurrent position in the RLE-compressed bitmap data. [AI]
p_surfaceDataTarget point in destination surface memory. [AI]
p_bitmapSizeTotal size in bytes of the bitmap data. [AI]
p_width/p_heightSize of area to draw. [AI]
p_pitchSurface pitch (bytes per row). [AI]
p_bppBits per pixel for output surface. [AI]

Definition at line 599 of file mxdisplaysurface.cpp.

◆ FUN_100bc8b0()

LPDIRECTDRAWSURFACE MxDisplaySurface::FUN_100bc8b0 ( MxS32  width,
MxS32  height 
)

[AI] Creates a 16-bit DirectDraw surface of specified size, either in video or system memory.

Parameters
widthSurface width. [AI]
heightSurface height. [AI]
Returns
Created surface on success, or NULL. [AI]

Definition at line 1372 of file mxdisplaysurface.cpp.

◆ GetDC()

void MxDisplaySurface::GetDC ( HDC *  p_hdc)
virtual

[AI] Acquires a Win32 device context (DC) for the back buffer surface, for GDI drawing.

[AI]

Parameters
p_hdcOutput pointer for the device context handle. [AI]

Definition at line 875 of file mxdisplaysurface.cpp.

◆ GetDirectDrawSurface1()

LPDIRECTDRAWSURFACE MxDisplaySurface::GetDirectDrawSurface1 ( )
inline

[AI] Returns the primary DirectDraw surface (front buffer).

Definition at line 178 of file mxdisplaysurface.h.

◆ GetDirectDrawSurface2()

LPDIRECTDRAWSURFACE MxDisplaySurface::GetDirectDrawSurface2 ( )
inline

[AI] Returns the secondary DirectDraw surface (back buffer).

Definition at line 181 of file mxdisplaysurface.h.

◆ GetVideoParam()

MxVideoParam & MxDisplaySurface::GetVideoParam ( )
inline

[AI] Gets the video parameter configuration (mode/resolution/etc) in use by this surface.

Definition at line 184 of file mxdisplaysurface.h.

◆ Init()

MxResult MxDisplaySurface::Init ( MxVideoParam p_videoParam,
LPDIRECTDRAWSURFACE  p_ddSurface1,
LPDIRECTDRAWSURFACE  p_ddSurface2,
LPDIRECTDRAWCLIPPER  p_ddClipper 
)
virtual

[AI] Initializes the surface object with given video parameters, DirectDraw surfaces, and a clipper.

Parameters
p_videoParamVideo parameters describing resolution, bitdepth, and flags. [AI]
p_ddSurface1Primary DirectDraw surface, typically the front buffer. [AI]
p_ddSurface2Secondary DirectDraw surface, typically the back buffer. [AI]
p_ddClipperWindow clipper for drawing in windowed mode. [AI]
Returns
SUCCESS on success, FAILURE otherwise. [AI]

Definition at line 114 of file mxdisplaysurface.cpp.

◆ ReleaseDC()

void MxDisplaySurface::ReleaseDC ( HDC  p_hdc)
virtual

[AI] Releases a device context (DC) previously acquired for the back surface.

[AI]

Parameters
p_hdcThe device context handle to release. [AI]

Definition at line 885 of file mxdisplaysurface.cpp.

◆ SetPalette()

void MxDisplaySurface::SetPalette ( MxPalette p_palette)
virtual

[AI] Sets the palette used for the primary and secondary DirectDraw surfaces.

Parameters
p_palettePalette object containing hardware palette entries. [AI]

[AI] This also handles internally converting the palette for 16-bit display modes. [AI]

Definition at line 277 of file mxdisplaysurface.cpp.

◆ VTable0x24()

void MxDisplaySurface::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 
)
virtual

[AI] Draws a bitmap onto a surface described by p_desc, scaling to the specified rectangle.

[AI]

Parameters
p_descSurface description (mostly used for fast access to the raw buffer). [AI]
p_bitmapThe bitmap to draw. [AI]
p_left/p_top/p_right/p_bottomRectangle in surface coordinates to draw into. [AI]
p_width/p_heightThe area width/height to draw. [AI]

Definition at line 1142 of file mxdisplaysurface.cpp.

◆ VTable0x28()

void MxDisplaySurface::VTable0x28 ( MxBitmap p_bitmap,
MxS32  p_left,
MxS32  p_top,
MxS32  p_right,
MxS32  p_bottom,
MxS32  p_width,
MxS32  p_height 
)
virtual

[AI] Draws a bitmap onto the back surface, specified by coordinates and output size.

[AI]

Parameters
p_bitmapThe bitmap to be drawn. [AI]
p_left/p_top/p_right/p_bottomSurface destination rectangle. [AI]
p_width/p_heightThe width and height to draw. [AI]

Definition at line 334 of file mxdisplaysurface.cpp.

◆ VTable0x2c()

void MxDisplaySurface::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 
)
virtual

[AI] Draws a bitmap with optional transparency (RLE) onto the output surface.

[AI]

Parameters
p_descSurface description for output. [AI]
p_bitmapBitmap source. [AI]
p_left/p_top/p_right/p_bottomOutput rectangle in surface coordinates. [AI]
p_width/p_heightArea width/height to draw. [AI]
p_RLEIf TRUE, treat as RLE-style transparency. [AI]

Definition at line 1291 of file mxdisplaysurface.cpp.

◆ VTable0x30()

void MxDisplaySurface::VTable0x30 ( MxBitmap p_bitmap,
MxS32  p_left,
MxS32  p_top,
MxS32  p_right,
MxS32  p_bottom,
MxS32  p_width,
MxS32  p_height,
MxBool  p_RLE 
)
virtual

[AI] Draws a bitmap with optional transparency (RLE), outputting to active back surface.

[AI]

Parameters
p_bitmapBitmap to be drawn. [AI]
p_left/p_top/p_right/p_bottomOutput rectangle coordinates. [AI]
p_width/p_heightDrawing size. [AI]
p_RLEIf TRUE, apply RLE-based transparency algorithm. [AI]

Definition at line 496 of file mxdisplaysurface.cpp.

◆ VTable0x34()

void MxDisplaySurface::VTable0x34 ( MxU8 p_pixels,
MxS32  p_bpp,
MxS32  p_width,
MxS32  p_height,
MxS32  p_x,
MxS32  p_y 
)
virtual

[AI] Directly writes an array of pixel data into the back surface at the given rectangle.

[AI]

Parameters
p_pixelsSource pixel data. [AI]
p_bppBits per pixel of source. [AI]
p_width/p_heightOutput rectangle in pixels. [AI]
p_x/p_yDestination position (top-left). [AI]

Definition at line 754 of file mxdisplaysurface.cpp.

◆ VTable0x44()

LPDIRECTDRAWSURFACE MxDisplaySurface::VTable0x44 ( MxBitmap p_bitmap,
undefined4 p_ret,
undefined4  p_doNotWriteToSurface,
undefined4  p_transparent 
)
virtual

[AI] Allocates a DirectDraw surface for a bitmap to allow hardware blitting/transparency.

[AI_SUGGESTED_NAME: AllocateBitmapSurface]

Parameters
p_bitmapBitmap source. [AI]
p_retUsed as allocation flag; returned as a pointer to updated allocation status. [AI]
p_doNotWriteToSurfaceIf set, surface is not filled (unsupported). [AI]
p_transparentWhether to use transparency/color key. [AI]
Returns
Newly created DirectDraw surface, or NULL on failure. [AI]

Definition at line 894 of file mxdisplaysurface.cpp.


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