2023-06-23 12:17:41 -04:00
|
|
|
#include "mxvideoparam.h"
|
|
|
|
|
2023-12-07 07:13:31 -05:00
|
|
|
#include "decomp.h"
|
|
|
|
|
2023-06-23 12:17:41 -04:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2023-12-07 07:13:31 -05:00
|
|
|
DECOMP_SIZE_ASSERT(MxVideoParam, 0x24);
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100bec70
|
2023-06-23 12:17:41 -04:00
|
|
|
MxVideoParam::MxVideoParam()
|
|
|
|
{
|
2023-11-06 18:12:09 -05:00
|
|
|
this->m_rect.SetRight(640);
|
|
|
|
this->m_rect.SetBottom(480);
|
|
|
|
this->m_rect.SetLeft(0);
|
|
|
|
this->m_rect.SetTop(0);
|
|
|
|
this->m_palette = NULL;
|
2023-10-24 19:38:27 -04:00
|
|
|
this->m_backBuffers = 0;
|
|
|
|
this->m_unk1c = 0;
|
2023-11-06 18:12:09 -05:00
|
|
|
this->m_deviceId = NULL;
|
2023-06-23 12:17:41 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100beca0
|
2023-10-24 19:38:27 -04:00
|
|
|
MxVideoParam::MxVideoParam(
|
|
|
|
COMPAT_CONST MxRect32& p_rect,
|
|
|
|
MxPalette* p_pal,
|
|
|
|
MxULong p_backBuffers,
|
|
|
|
COMPAT_CONST MxVideoParamFlags& p_flags
|
|
|
|
)
|
2023-06-23 12:17:41 -04:00
|
|
|
{
|
2023-11-06 18:12:09 -05:00
|
|
|
this->m_rect = p_rect;
|
2023-10-24 19:38:27 -04:00
|
|
|
this->m_palette = p_pal;
|
|
|
|
this->m_backBuffers = p_backBuffers;
|
|
|
|
this->m_flags = p_flags;
|
|
|
|
this->m_unk1c = 0;
|
|
|
|
this->m_deviceId = NULL;
|
2023-06-23 12:17:41 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100becf0
|
2023-10-24 19:38:27 -04:00
|
|
|
MxVideoParam::MxVideoParam(MxVideoParam& p_videoParam)
|
2023-06-23 12:17:41 -04:00
|
|
|
{
|
2023-11-06 18:12:09 -05:00
|
|
|
this->m_rect = p_videoParam.m_rect;
|
2023-10-24 19:38:27 -04:00
|
|
|
this->m_palette = p_videoParam.m_palette;
|
|
|
|
this->m_backBuffers = p_videoParam.m_backBuffers;
|
|
|
|
this->m_flags = p_videoParam.m_flags;
|
|
|
|
this->m_unk1c = p_videoParam.m_unk1c;
|
|
|
|
this->m_deviceId = NULL;
|
|
|
|
SetDeviceName(p_videoParam.m_deviceId);
|
2023-06-23 12:17:41 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100bed50
|
2023-11-21 03:44:45 -05:00
|
|
|
MxVideoParam::~MxVideoParam()
|
2023-06-23 12:17:41 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
if (this->m_deviceId != NULL)
|
|
|
|
delete[] this->m_deviceId;
|
2023-06-23 12:17:41 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100bed70
|
2023-10-24 19:38:27 -04:00
|
|
|
void MxVideoParam::SetDeviceName(char* id)
|
2023-06-23 12:17:41 -04:00
|
|
|
{
|
2023-11-06 18:12:09 -05:00
|
|
|
if (this->m_deviceId != NULL)
|
2023-10-24 19:38:27 -04:00
|
|
|
delete[] this->m_deviceId;
|
2023-06-23 12:17:41 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
if (id != 0) {
|
|
|
|
this->m_deviceId = new char[strlen(id) + 1];
|
2023-06-23 12:17:41 -04:00
|
|
|
|
2023-11-06 18:12:09 -05:00
|
|
|
if (this->m_deviceId != NULL) {
|
2023-10-24 19:38:27 -04:00
|
|
|
strcpy(this->m_deviceId, id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
2023-11-06 18:12:09 -05:00
|
|
|
this->m_deviceId = NULL;
|
2023-10-24 19:38:27 -04:00
|
|
|
}
|
2023-06-23 12:17:41 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100bede0
|
2023-11-21 03:44:45 -05:00
|
|
|
MxVideoParam& MxVideoParam::operator=(const MxVideoParam& p_videoParam)
|
2023-06-23 12:17:41 -04:00
|
|
|
{
|
2023-11-21 03:44:45 -05:00
|
|
|
this->m_rect = p_videoParam.m_rect;
|
|
|
|
this->m_palette = p_videoParam.m_palette;
|
|
|
|
this->m_backBuffers = p_videoParam.m_backBuffers;
|
|
|
|
this->m_flags = p_videoParam.m_flags;
|
|
|
|
this->m_unk1c = p_videoParam.m_unk1c;
|
|
|
|
SetDeviceName(p_videoParam.m_deviceId);
|
|
|
|
|
|
|
|
return *this;
|
2023-06-23 12:17:41 -04:00
|
|
|
}
|