Isle
Loading...
Searching...
No Matches
mxvideoparam.cpp
Go to the documentation of this file.
1#include "mxvideoparam.h"
2
3#include "decomp.h"
4
5#include <stdlib.h>
6#include <string.h>
7
9
10// FUNCTION: LEGO1 0x100bec70
11// FUNCTION: BETA10 0x1012db3e
13{
14 m_rect = MxRect32(0, 0, 640, 480);
15 m_palette = NULL;
16 m_backBuffers = 0;
17 m_unk0x1c = 0;
18 m_deviceId = NULL;
19}
20
21// FUNCTION: LEGO1 0x100beca0
22// FUNCTION: BETA10 0x1012dbb1
23MxVideoParam::MxVideoParam(MxRect32& p_rect, MxPalette* p_palette, MxULong p_backBuffers, MxVideoParamFlags& p_flags)
24{
25 m_rect = p_rect;
26 m_palette = p_palette;
27 m_backBuffers = p_backBuffers;
28 m_flags = p_flags;
29 m_unk0x1c = 0;
30 m_deviceId = NULL;
31}
32
33// FUNCTION: LEGO1 0x100becf0
34// FUNCTION: BETA10 0x1012dc1e
36{
37 m_rect = p_videoParam.m_rect;
38 m_palette = p_videoParam.m_palette;
39 m_backBuffers = p_videoParam.m_backBuffers;
40 m_flags = p_videoParam.m_flags;
41 m_unk0x1c = p_videoParam.m_unk0x1c;
42 m_deviceId = NULL;
43 SetDeviceName(p_videoParam.m_deviceId);
44}
45
46// FUNCTION: LEGO1 0x100bed50
47// FUNCTION: BETA10 0x1012dca3
49{
50 if (m_deviceId != NULL) {
51 delete[] m_deviceId;
52 }
53}
54
55// FUNCTION: LEGO1 0x100bed70
56// FUNCTION: BETA10 0x1012dce1
57void MxVideoParam::SetDeviceName(char* p_deviceId)
58{
59 if (m_deviceId != NULL) {
60 delete[] m_deviceId;
61 }
62
63 if (p_deviceId != NULL) {
64 m_deviceId = new char[strlen(p_deviceId) + 1];
65
66 if (m_deviceId != NULL) {
67 strcpy(m_deviceId, p_deviceId);
68 }
69 }
70 else {
71 m_deviceId = NULL;
72 }
73}
74
75// FUNCTION: LEGO1 0x100bede0
76// FUNCTION: BETA10 0x1012dd76
78{
79 m_rect = p_videoParam.m_rect;
80 m_palette = p_videoParam.m_palette;
81 m_backBuffers = p_videoParam.m_backBuffers;
82 m_flags = p_videoParam.m_flags;
83 m_unk0x1c = p_videoParam.m_unk0x1c;
84 SetDeviceName(p_videoParam.m_deviceId);
85
86 return *this;
87}
[AI] Encapsulates a DirectDraw 8-bit (256 color) palette for use with DirectX rendering.
Definition: mxpalette.h:17
[AI] Rectangle using 32-bit signed integer coordinates.
Definition: mxgeometry.h:706
[AI] Manages video parameter flags, providing an abstraction for various video settings such as fulls...
[AI] Video parameter configuration for display and rendering, encapsulates resolution,...
Definition: mxvideoparam.h:14
~MxVideoParam()
[AI] Destructor, frees device name memory if used. [AI]
MxPalette * p_palette
Definition: mxvideoparam.h:25
void SetDeviceName(char *p_deviceId)
[AI] Set the device name/id for this video parameter (e.g., a specific display adapter),...
MxPalette MxULong MxVideoParamFlags & p_flags
Definition: mxvideoparam.h:25
MxVideoParam()
[AI] Construct MxVideoParam with default screen rectangle (640x480), no palette, zero backbuffers,...
MxPalette MxULong p_backBuffers
Definition: mxvideoparam.h:25
MxVideoParam & operator=(const MxVideoParam &p_videoParam)
[AI] Assignment operator, performs deep copy (including device name string) of another instance.
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
#define NULL
[AI] Null pointer value (C/C++ semantics).
Definition: legotypes.h:26
unsigned int MxULong
[AI]
Definition: mxtypes.h:93