mirror of
https://github.com/isledecomp/isle.git
synced 2024-11-22 15:48:09 -05:00
Implement MxDSStreamingAction (#108)
* Implement MxDSStreamingAction * Add remaining functions * Use inline assignment operators
This commit is contained in:
parent
51ac526f8a
commit
4a2226181c
4 changed files with 140 additions and 0 deletions
|
@ -118,6 +118,7 @@ add_library(lego1 SHARED
|
|||
LEGO1/mxdsparallelaction.cpp
|
||||
LEGO1/mxdsselectaction.cpp
|
||||
LEGO1/mxdsserialaction.cpp
|
||||
LEGO1/mxdsstreamingaction.cpp
|
||||
LEGO1/mxdssound.cpp
|
||||
LEGO1/mxdssource.cpp
|
||||
LEGO1/mxdsstill.cpp
|
||||
|
|
|
@ -46,8 +46,12 @@ class MxDSAction : public MxDSObject
|
|||
MxU32 m_sizeOnDisk;
|
||||
DWORD m_flags;
|
||||
DWORD m_startTime;
|
||||
|
||||
protected:
|
||||
MxLong m_duration;
|
||||
MxS32 m_loopCount;
|
||||
|
||||
private:
|
||||
MxVector3Data m_location;
|
||||
MxVector3Data m_direction;
|
||||
MxVector3Data m_up;
|
||||
|
|
91
LEGO1/mxdsstreamingaction.cpp
Normal file
91
LEGO1/mxdsstreamingaction.cpp
Normal file
|
@ -0,0 +1,91 @@
|
|||
#include "mxdsstreamingaction.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(MxDSStreamingAction, 0xb4)
|
||||
|
||||
// OFFSET: LEGO1 0x100cd010
|
||||
MxDSStreamingAction::MxDSStreamingAction(MxDSAction &p_dsAction, MxU32 p_offset)
|
||||
{
|
||||
Init();
|
||||
|
||||
*this = p_dsAction;
|
||||
this->m_unk94 = p_offset;
|
||||
this->m_bufferOffset = p_offset;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100cd0d0
|
||||
MxDSStreamingAction::MxDSStreamingAction(MxDSStreamingAction &p_dsStreamingAction)
|
||||
{
|
||||
Init();
|
||||
CopyFrom(p_dsStreamingAction);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100cd150
|
||||
MxDSStreamingAction::~MxDSStreamingAction()
|
||||
{
|
||||
// TODO: Implement MxDSBuffer
|
||||
if (this->m_unka0)
|
||||
delete this->m_unka0;
|
||||
if (this->m_unka4)
|
||||
delete this->m_unka4;
|
||||
if (this->m_internalAction)
|
||||
delete this->m_internalAction;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100cd220
|
||||
MxDSStreamingAction *MxDSStreamingAction::CopyFrom(MxDSStreamingAction &p_dsStreamingAction)
|
||||
{
|
||||
*this = p_dsStreamingAction;
|
||||
this->m_unk94 = p_dsStreamingAction.m_unk94;
|
||||
this->m_bufferOffset = p_dsStreamingAction.m_bufferOffset;
|
||||
this->m_unk9c = p_dsStreamingAction.m_unk9c;
|
||||
this->m_unka0 = NULL;
|
||||
this->m_unka4 = NULL;
|
||||
this->m_unkac = p_dsStreamingAction.m_unkac;
|
||||
this->m_unka8 = p_dsStreamingAction.m_unka8;
|
||||
SetInternalAction(p_dsStreamingAction.m_internalAction ? p_dsStreamingAction.m_internalAction->Clone() : NULL);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100cd090
|
||||
MxBool MxDSStreamingAction::HasId(MxU32 p_objectId)
|
||||
{
|
||||
if (this->m_internalAction)
|
||||
return this->m_internalAction->HasId(p_objectId);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100cd1e0
|
||||
MxResult MxDSStreamingAction::Init()
|
||||
{
|
||||
this->m_unk94 = 0;
|
||||
this->m_bufferOffset = 0;
|
||||
this->m_unk9c = 0;
|
||||
this->m_unka0 = NULL;
|
||||
this->m_unka4 = NULL;
|
||||
this->m_unka8 = 0;
|
||||
this->m_unkac = 2;
|
||||
this->m_internalAction = NULL;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100cd2a0
|
||||
void MxDSStreamingAction::SetInternalAction(MxDSAction *p_dsAction)
|
||||
{
|
||||
if (this->m_internalAction)
|
||||
delete this->m_internalAction;
|
||||
this->m_internalAction = p_dsAction;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100cd2d0
|
||||
void MxDSStreamingAction::FUN_100CD2D0()
|
||||
{
|
||||
if (this->m_duration == -1)
|
||||
return;
|
||||
|
||||
MxLong duration = this->m_duration / this->m_loopCount;
|
||||
this->m_loopCount--;
|
||||
|
||||
this->m_duration -= duration;
|
||||
this->m_unka8 += duration;
|
||||
}
|
44
LEGO1/mxdsstreamingaction.h
Normal file
44
LEGO1/mxdsstreamingaction.h
Normal file
|
@ -0,0 +1,44 @@
|
|||
#ifndef MXDSSTREAMINGACTION_H
|
||||
#define MXDSSTREAMINGACTION_H
|
||||
|
||||
#include "mxdsaction.h"
|
||||
|
||||
class MxDSBuffer;
|
||||
|
||||
// VTABLE 0x100dd088
|
||||
// SIZE 0xb4
|
||||
class MxDSStreamingAction : public MxDSAction
|
||||
{
|
||||
public:
|
||||
MxDSStreamingAction(MxDSAction &p_dsAction, MxU32 p_offset);
|
||||
MxDSStreamingAction(MxDSStreamingAction &p_dsStreamingAction);
|
||||
virtual ~MxDSStreamingAction();
|
||||
|
||||
MxDSStreamingAction *CopyFrom(MxDSStreamingAction &p_dsStreamingAction);
|
||||
MxDSStreamingAction &operator=(MxDSAction &p_dsAction) {
|
||||
MxDSAction::operator=(p_dsAction);
|
||||
return *this;
|
||||
}
|
||||
MxDSStreamingAction &operator=(MxDSStreamingAction &p_dsStreamingAction) {
|
||||
MxDSAction::operator=(p_dsStreamingAction);
|
||||
return *this;
|
||||
}
|
||||
|
||||
virtual MxBool HasId(MxU32 p_objectId); // vtable+34;
|
||||
|
||||
MxResult Init();
|
||||
void SetInternalAction(MxDSAction *p_dsAction);
|
||||
void FUN_100CD2D0();
|
||||
|
||||
private:
|
||||
MxU32 m_unk94;
|
||||
MxU32 m_bufferOffset;
|
||||
MxS32 m_unk9c;
|
||||
MxDSBuffer *m_unka0;
|
||||
MxDSBuffer *m_unka4;
|
||||
MxLong m_unka8;
|
||||
undefined2 m_unkac;
|
||||
MxDSAction *m_internalAction;
|
||||
};
|
||||
|
||||
#endif // MXDSSTREAMINGACTION_H
|
Loading…
Reference in a new issue