2023-06-29 04:10:08 -04:00
|
|
|
#include "mxdsserialaction.h"
|
2023-09-25 15:53:57 -04:00
|
|
|
#include "mxdsmediaaction.h"
|
2023-06-29 04:10:08 -04:00
|
|
|
|
2023-09-20 16:22:57 -04:00
|
|
|
DECOMP_SIZE_ASSERT(MxDSSerialAction, 0xa8)
|
|
|
|
|
2023-06-29 04:10:08 -04:00
|
|
|
// OFFSET: LEGO1 0x100ca9d0
|
|
|
|
MxDSSerialAction::MxDSSerialAction()
|
|
|
|
{
|
2023-07-03 13:24:51 -04:00
|
|
|
this->SetType(MxDSType_SerialAction);
|
2023-09-25 15:53:57 -04:00
|
|
|
this->m_cursor = new MxDSActionListCursor(this->m_actions);
|
|
|
|
this->m_unk0xa0 = 0;
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
|
|
|
|
2023-09-25 15:53:57 -04:00
|
|
|
// OFFSET: LEGO1 0x100caac0
|
|
|
|
void MxDSSerialAction::SetDuration(MxLong p_duration)
|
|
|
|
{
|
|
|
|
this->m_duration = p_duration;
|
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100cac10
|
2023-06-29 04:10:08 -04:00
|
|
|
MxDSSerialAction::~MxDSSerialAction()
|
|
|
|
{
|
2023-09-25 15:53:57 -04:00
|
|
|
if (this->m_cursor)
|
|
|
|
delete this->m_cursor;
|
|
|
|
|
|
|
|
this->m_cursor = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100cac90
|
|
|
|
void MxDSSerialAction::CopyFrom(MxDSSerialAction &p_dsSerialAction)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100caca0
|
|
|
|
MxDSSerialAction &MxDSSerialAction::operator=(MxDSSerialAction &p_dsSerialAction)
|
|
|
|
{
|
|
|
|
if (this == &p_dsSerialAction)
|
|
|
|
return *this;
|
|
|
|
|
|
|
|
MxDSMultiAction::operator=(p_dsSerialAction);
|
|
|
|
this->CopyFrom(p_dsSerialAction);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100cacd0
|
|
|
|
MxDSAction *MxDSSerialAction::Clone()
|
|
|
|
{
|
|
|
|
MxDSSerialAction *clone = new MxDSSerialAction();
|
|
|
|
|
|
|
|
if (clone)
|
|
|
|
*clone = *this;
|
|
|
|
|
|
|
|
return clone;
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
2023-09-25 15:53:57 -04:00
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100cad60
|
|
|
|
MxLong MxDSSerialAction::GetDuration()
|
|
|
|
{
|
|
|
|
if (this->m_duration)
|
|
|
|
return this->m_duration;
|
|
|
|
|
|
|
|
MxDSActionListCursor cursor(this->m_actions);
|
|
|
|
MxDSAction *action;
|
|
|
|
|
|
|
|
while (cursor.Next(action)) {
|
|
|
|
if (!action)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
this->m_duration += action->GetDuration() + action->GetStartTime();
|
|
|
|
|
|
|
|
if (action->IsA("MxDSMediaAction")) {
|
|
|
|
MxLong sustainTime = ((MxDSMediaAction*) action)->GetSustainTime();
|
|
|
|
|
|
|
|
if (sustainTime && sustainTime != -1)
|
|
|
|
this->m_duration += sustainTime;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return this->m_duration;
|
|
|
|
}
|