Isle
Loading...
Searching...
No Matches
mxdisplaysurface.h
Go to the documentation of this file.
1#ifndef MXDISPLAYSURFACE_H
2#define MXDISPLAYSURFACE_H
3
4#include "decomp.h"
5#include "mxcore.h"
6#include "mxvideoparam.h"
7
8#include <ddraw.h>
9
10class MxBitmap;
11class MxPalette;
12
17// VTABLE: LEGO1 0x100dc768
18// SIZE 0xac
19class MxDisplaySurface : public MxCore {
20public:
22 MxDisplaySurface(); // [AI]
23
25 ~MxDisplaySurface() override; // [AI]
26
33 virtual MxResult Init(
34 MxVideoParam& p_videoParam,
35 LPDIRECTDRAWSURFACE p_ddSurface1,
36 LPDIRECTDRAWSURFACE p_ddSurface2,
37 LPDIRECTDRAWCLIPPER p_ddClipper
38 ); // vtable+0x14
39
43 virtual MxResult Create(MxVideoParam& p_videoParam); // vtable+0x18
44
46 virtual void Destroy(); // vtable+0x1c
47
51 virtual void SetPalette(MxPalette* p_palette); // vtable+0x20
52
58 virtual void VTable0x24(
59 LPDDSURFACEDESC p_desc,
60 MxBitmap* p_bitmap,
61 MxS32 p_left,
62 MxS32 p_top,
63 MxS32 p_right,
64 MxS32 p_bottom,
65 MxS32 p_width,
66 MxS32 p_height
67 ); // vtable+0x24
68
73 virtual void VTable0x28(
74 MxBitmap* p_bitmap,
75 MxS32 p_left,
76 MxS32 p_top,
77 MxS32 p_right,
78 MxS32 p_bottom,
79 MxS32 p_width,
80 MxS32 p_height
81 ); // vtable+0x28
82
89 virtual void VTable0x2c(
90 LPDDSURFACEDESC p_desc,
91 MxBitmap* p_bitmap,
92 MxS32 p_left,
93 MxS32 p_top,
94 MxS32 p_right,
95 MxS32 p_bottom,
96 MxS32 p_width,
97 MxS32 p_height,
98 MxBool p_RLE
99 ); // vtable+0x2c
100
106 virtual void VTable0x30(
107 MxBitmap* p_bitmap,
108 MxS32 p_left,
109 MxS32 p_top,
110 MxS32 p_right,
111 MxS32 p_bottom,
112 MxS32 p_width,
113 MxS32 p_height,
114 MxBool p_RLE
115 ); // vtable+0x30
116
122 virtual void VTable0x34(
123 MxU8* p_pixels,
124 MxS32 p_bpp,
125 MxS32 p_width,
126 MxS32 p_height,
127 MxS32 p_x,
128 MxS32 p_y
129 ); // vtable+0x34
130
135 virtual void Display(
136 MxS32 p_left,
137 MxS32 p_top,
138 MxS32 p_left2,
139 MxS32 p_top2,
140 MxS32 p_width,
141 MxS32 p_height
142 ); // vtable+0x38
143
146 virtual void GetDC(HDC* p_hdc); // vtable+0x3c
147
150 virtual void ReleaseDC(HDC p_hdc); // vtable+0x40
151
159 MxBitmap* p_bitmap,
160 undefined4* p_ret,
161 undefined4 p_doNotWriteToSurface,
162 undefined4 p_transparent
163 ); // vtable+0x44
164
166 void ClearScreen(); // [AI]
167
171
176
178 LPDIRECTDRAWSURFACE GetDirectDrawSurface1() { return m_ddSurface1; } // [AI]
179
181 LPDIRECTDRAWSURFACE GetDirectDrawSurface2() { return m_ddSurface2; } // [AI]
182
184 MxVideoParam& GetVideoParam() { return m_videoParam; } // [AI]
185
194 MxU8*& p_bitmapData,
195 MxU8*& p_surfaceData,
196 MxU32 p_bitmapSize,
197 MxS32 p_width,
198 MxS32 p_height,
199 MxLong p_pitch,
200 MxU8 p_bpp
201 ); // [AI]
202
207 LPDIRECTDRAWSURFACE FUN_100bc8b0(MxS32 width, MxS32 height); // [AI_SUGGESTED_NAME: Create16BitSurface]
208
209private:
212 MxU8 CountTotalBitsSetTo1(MxU32 p_param); // [AI]
213
216 MxU8 CountContiguousBitsSetTo1(MxU32 p_param); // [AI]
217
219 void Init(); // [AI]
220
221 MxVideoParam m_videoParam;
222 LPDIRECTDRAWSURFACE m_ddSurface1;
223 LPDIRECTDRAWSURFACE m_ddSurface2;
224 LPDIRECTDRAWCLIPPER m_ddClipper;
225 MxBool m_initialized;
226 DDSURFACEDESC m_surfaceDesc;
227 MxU16* m_16bitPal;
228};
229
230// SYNTHETIC: LEGO1 0x100ba580
231// MxDisplaySurface::`scalar deleting destructor'
232
233#endif // MXDISPLAYSURFACE_H
[AI] Represents an 8bpp or high color device-independent bitmap (DIB) and provides operations for bit...
Definition: mxbitmap.h:55
[AI] Base virtual class for all Mindscape engine (Mx) objects.
Definition: mxcore.h:15
Provides a DirectDraw-based drawing surface for blitting bitmaps, managing palette,...
LPDIRECTDRAWSURFACE FUN_100bc8b0(MxS32 width, MxS32 height)
[AI] Creates a 16-bit DirectDraw surface of specified size, either in video or system memory.
static LPDIRECTDRAWSURFACE CopySurface(LPDIRECTDRAWSURFACE p_src)
[AI] Creates a deep copy of the provided surface (new DirectDraw surface with same content).
~MxDisplaySurface() override
[AI] Destroys the display surface and releases DirectDraw objects and resources.
LPDIRECTDRAWSURFACE GetDirectDrawSurface1()
[AI] Returns the primary DirectDraw surface (front buffer).
virtual MxResult Create(MxVideoParam &p_videoParam)
[AI] Creates DirectDraw surfaces and initializes based on the desired video mode.
virtual void SetPalette(MxPalette *p_palette)
[AI] Sets the palette used for the primary and secondary DirectDraw surfaces.
void ClearScreen()
[AI] Fills the current back buffer with black (clears the display area). [AI]
virtual void GetDC(HDC *p_hdc)
[AI] Acquires a Win32 device context (DC) for the back buffer surface, for GDI drawing.
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.
MxDisplaySurface()
[AI] Constructs the display surface and initializes all members.
virtual void Destroy()
[AI] Releases all DirectDraw surfaces and resources held by this object.
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.
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,...
LPDIRECTDRAWSURFACE GetDirectDrawSurface2()
[AI] Returns the secondary DirectDraw surface (back buffer).
static LPDIRECTDRAWSURFACE CreateCursorSurface()
[AI] Creates and draws a 16x16 cursor DirectDraw surface.
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.
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.
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.
virtual void ReleaseDC(HDC p_hdc)
[AI] Releases a device context (DC) previously acquired for the back surface.
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.
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.
MxVideoParam & GetVideoParam()
[AI] Gets the video parameter configuration (mode/resolution/etc) in use by this surface.
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.
[AI] Encapsulates a DirectDraw 8-bit (256 color) palette for use with DirectX rendering.
Definition: mxpalette.h:17
[AI] Video parameter configuration for display and rendering, encapsulates resolution,...
Definition: mxvideoparam.h:14
struct _DDSURFACEDESC FAR * LPDDSURFACEDESC
Definition: ddraw.h:83
struct IDirectDrawClipper FAR * LPDIRECTDRAWCLIPPER
Definition: ddraw.h:79
struct IDirectDrawSurface FAR * LPDIRECTDRAWSURFACE
Definition: ddraw.h:74
unsigned int undefined4
Definition: decomp.h:28
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
int MxLong
[AI]
Definition: mxtypes.h:83
unsigned char MxU8
[AI]
Definition: mxtypes.h:8
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned short MxU16
[AI]
Definition: mxtypes.h:20
unsigned int MxU32
[AI]
Definition: mxtypes.h:32