mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 00:14:22 +00:00
lego1: implement MxTimer + dependencies
This commit is contained in:
54
LEGO1/mxvideoparam.cpp
Normal file
54
LEGO1/mxvideoparam.cpp
Normal file
@@ -0,0 +1,54 @@
|
||||
#include "mxvideoparam.h"
|
||||
|
||||
MxVideoParam::MxVideoParam()
|
||||
{
|
||||
this->m_flags = MxVideoParamFlags();
|
||||
this->m_right = 640;
|
||||
this->m_bottom = 480;
|
||||
this->m_left = 0;
|
||||
this->m_top = 0;
|
||||
this->m_palette = 0;
|
||||
this->m_backBuffers = 0;
|
||||
this->m_unk1c = 0;
|
||||
this->m_deviceId = 0;
|
||||
}
|
||||
|
||||
MxVideoParam &MxVideoParam::operator=(const MxVideoParam &other)
|
||||
{
|
||||
m_flags = MxVideoParamFlags();
|
||||
m_left = other.m_left;
|
||||
m_top = other.m_top;
|
||||
m_right = other.m_right;
|
||||
m_bottom = other.m_bottom;
|
||||
m_palette = other.m_palette;
|
||||
m_backBuffers = other.m_backBuffers;
|
||||
m_flags = other.m_flags;
|
||||
m_unk1c = other.m_unk1c;
|
||||
m_deviceId = other.m_deviceId;
|
||||
SetDeviceName(other.m_deviceId);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// TODO: this doesn't match exactly, something weird with the conditional on id
|
||||
void MxVideoParam::SetDeviceName(char *id)
|
||||
{
|
||||
if (this->m_deviceId != 0)
|
||||
free(this->m_deviceId);
|
||||
|
||||
if (id == 0)
|
||||
{
|
||||
this->m_deviceId = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->m_deviceId = (char *)malloc(strlen(id) + 1);
|
||||
strcpy(this->m_deviceId, id);
|
||||
}
|
||||
}
|
||||
|
||||
MxVideoParam::~MxVideoParam()
|
||||
{
|
||||
if (this->m_deviceId != 0)
|
||||
free(this->m_deviceId);
|
||||
}
|
Reference in New Issue
Block a user