mirror of
https://github.com/isledecomp/isle.git
synced 2026-05-03 21:43:57 +00:00
Implement/match MxDSSerialAction
This commit is contained in:
parent
6dd94d3626
commit
6b648d0039
@ -96,8 +96,8 @@ void MxDSAction::Deserialize(char **p_source, MxS16 p_unk24)
|
|||||||
|
|
||||||
this->m_flags = *(MxU32*) *p_source;
|
this->m_flags = *(MxU32*) *p_source;
|
||||||
*p_source += sizeof(MxU32);
|
*p_source += sizeof(MxU32);
|
||||||
this->m_startTime = *(DWORD*) *p_source;
|
this->m_startTime = *(MxLong*) *p_source;
|
||||||
*p_source += sizeof(DWORD);
|
*p_source += sizeof(MxLong);
|
||||||
this->m_duration = *(MxLong*) *p_source;
|
this->m_duration = *(MxLong*) *p_source;
|
||||||
*p_source += sizeof(MxLong);
|
*p_source += sizeof(MxLong);
|
||||||
this->m_loopCount = *(MxS32*) *p_source;
|
this->m_loopCount = *(MxS32*) *p_source;
|
||||||
|
|||||||
@ -53,6 +53,7 @@ class MxDSAction : public MxDSObject
|
|||||||
inline void SetFlags(MxU32 m_flags) { this->m_flags = m_flags; }
|
inline void SetFlags(MxU32 m_flags) { this->m_flags = m_flags; }
|
||||||
inline char *GetExtraData() { return m_extraData; }
|
inline char *GetExtraData() { return m_extraData; }
|
||||||
inline MxU16 GetExtraLength() const { return m_extraLength; }
|
inline MxU16 GetExtraLength() const { return m_extraLength; }
|
||||||
|
inline MxLong GetStartTime() const { return m_startTime; }
|
||||||
inline const MxVector3Data &GetLocation() const { return m_location; }
|
inline const MxVector3Data &GetLocation() const { return m_location; }
|
||||||
inline void SetOmni(MxOmni *p_omni) { m_omni = p_omni; }
|
inline void SetOmni(MxOmni *p_omni) { m_omni = p_omni; }
|
||||||
|
|
||||||
@ -61,7 +62,7 @@ class MxDSAction : public MxDSObject
|
|||||||
private:
|
private:
|
||||||
MxU32 m_sizeOnDisk;
|
MxU32 m_sizeOnDisk;
|
||||||
MxU32 m_flags;
|
MxU32 m_flags;
|
||||||
DWORD m_startTime;
|
MxLong m_startTime;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
MxLong m_duration;
|
MxLong m_duration;
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
#include "mxdsaction.h"
|
#include "mxdsaction.h"
|
||||||
|
|
||||||
DECOMP_SIZE_ASSERT(MxDSActionList, 0x1c);
|
DECOMP_SIZE_ASSERT(MxDSActionList, 0x1c);
|
||||||
|
DECOMP_SIZE_ASSERT(MxDSActionListCursor, 0x10);
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100c9c90
|
// OFFSET: LEGO1 0x100c9c90
|
||||||
MxS8 MxDSActionList::Compare(MxDSAction *p_var0, MxDSAction *p_var1)
|
MxS8 MxDSActionList::Compare(MxDSAction *p_var0, MxDSAction *p_var1)
|
||||||
|
|||||||
@ -34,6 +34,7 @@ class MxDSMediaAction : public MxDSAction
|
|||||||
void CopyMediaSrcPath(const char *p_mediaSrcPath);
|
void CopyMediaSrcPath(const char *p_mediaSrcPath);
|
||||||
|
|
||||||
inline MxS32 GetMediaFormat() const { return this->m_mediaFormat; }
|
inline MxS32 GetMediaFormat() const { return this->m_mediaFormat; }
|
||||||
|
inline MxLong GetSustainTime() const { return this->m_sustainTime; }
|
||||||
private:
|
private:
|
||||||
MxU32 m_sizeOnDisk;
|
MxU32 m_sizeOnDisk;
|
||||||
char *m_mediaSrcPath;
|
char *m_mediaSrcPath;
|
||||||
|
|||||||
@ -30,6 +30,8 @@ class MxDSMultiAction : public MxDSAction
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
MxU32 m_sizeOnDisk;
|
MxU32 m_sizeOnDisk;
|
||||||
|
|
||||||
|
protected:
|
||||||
MxDSActionList *m_actions;
|
MxDSActionList *m_actions;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1,16 +1,80 @@
|
|||||||
#include "mxdsserialaction.h"
|
#include "mxdsserialaction.h"
|
||||||
|
#include "mxdsmediaaction.h"
|
||||||
|
|
||||||
DECOMP_SIZE_ASSERT(MxDSSerialAction, 0xa8)
|
DECOMP_SIZE_ASSERT(MxDSSerialAction, 0xa8)
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100ca9d0
|
// OFFSET: LEGO1 0x100ca9d0
|
||||||
MxDSSerialAction::MxDSSerialAction()
|
MxDSSerialAction::MxDSSerialAction()
|
||||||
{
|
{
|
||||||
// TODO
|
|
||||||
this->SetType(MxDSType_SerialAction);
|
this->SetType(MxDSType_SerialAction);
|
||||||
|
this->m_cursor = new MxDSActionListCursor(this->m_actions);
|
||||||
|
this->m_unk0xa0 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100cac10 STUB
|
// OFFSET: LEGO1 0x100caac0
|
||||||
|
void MxDSSerialAction::SetDuration(MxLong p_duration)
|
||||||
|
{
|
||||||
|
this->m_duration = p_duration;
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100cac10
|
||||||
MxDSSerialAction::~MxDSSerialAction()
|
MxDSSerialAction::~MxDSSerialAction()
|
||||||
{
|
{
|
||||||
// TODO
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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;
|
||||||
|
}
|
||||||
@ -12,6 +12,9 @@ class MxDSSerialAction : public MxDSMultiAction
|
|||||||
MxDSSerialAction();
|
MxDSSerialAction();
|
||||||
virtual ~MxDSSerialAction() override;
|
virtual ~MxDSSerialAction() override;
|
||||||
|
|
||||||
|
void CopyFrom(MxDSSerialAction &p_dsSerialAction);
|
||||||
|
MxDSSerialAction &operator=(MxDSSerialAction &p_dsSerialAction);
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100caad0
|
// OFFSET: LEGO1 0x100caad0
|
||||||
inline virtual const char *ClassName() const override // vtable+0x0c
|
inline virtual const char *ClassName() const override // vtable+0x0c
|
||||||
{
|
{
|
||||||
@ -25,7 +28,12 @@ class MxDSSerialAction : public MxDSMultiAction
|
|||||||
return !strcmp(name, MxDSSerialAction::ClassName()) || MxDSMultiAction::IsA(name);
|
return !strcmp(name, MxDSSerialAction::ClassName()) || MxDSMultiAction::IsA(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
undefined4 m_unk0x9c;
|
virtual MxLong GetDuration(); // vtable+24;
|
||||||
|
virtual void SetDuration(MxLong p_duration); // vtable+28;
|
||||||
|
virtual MxDSAction *Clone(); // vtable+2c;
|
||||||
|
|
||||||
|
private:
|
||||||
|
MxDSActionListCursor *m_cursor;
|
||||||
undefined4 m_unk0xa0;
|
undefined4 m_unk0xa0;
|
||||||
undefined4 m_unk0xa4;
|
undefined4 m_unk0xa4;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
#include "mxpresenter.h"
|
#include "mxpresenter.h"
|
||||||
|
|
||||||
DECOMP_SIZE_ASSERT(MxPresenterList, 0x18);
|
DECOMP_SIZE_ASSERT(MxPresenterList, 0x18);
|
||||||
|
DECOMP_SIZE_ASSERT(MxPresenterListCursor, 0x10);
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x1001cd00
|
// OFFSET: LEGO1 0x1001cd00
|
||||||
MxS8 MxPresenterList::Compare(MxPresenter *p_var0, MxPresenter *p_var1)
|
MxS8 MxPresenterList::Compare(MxPresenter *p_var0, MxPresenter *p_var1)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user