Skip to content

Commit

Permalink
Beta match MxDSStreamingAction (#1314)
Browse files Browse the repository at this point in the history
* Beta match MxDSStreamingAction

* Call the operator directly
  • Loading branch information
disinvite authored Jan 6, 2025
1 parent 93815ca commit 2cdbd1b
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 53 deletions.
20 changes: 6 additions & 14 deletions LEGO1/omni/include/mxdsstreamingaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
class MxDSBuffer;

// VTABLE: LEGO1 0x100dd088
// VTABLE: BETA10 0x101c2850
// SIZE 0xb4
class MxDSStreamingAction : public MxDSAction {
public:
Expand All @@ -14,20 +15,10 @@ class MxDSStreamingAction : public MxDSAction {
~MxDSStreamingAction() override;

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;
}

MxBool HasId(MxU32 p_objectId) override; // vtable+34;

MxResult Init();

MxBool HasId(MxU32 p_objectId) override; // vtable+0x34;

void Init();
void SetInternalAction(MxDSAction* p_dsAction);
void FUN_100cd2d0();

Expand Down Expand Up @@ -70,6 +61,7 @@ class MxDSStreamingAction : public MxDSAction {
void ClearUnknowna0() { m_unk0xa0 = NULL; }

// SYNTHETIC: LEGO1 0x100cd0b0
// SYNTHETIC: BETA10 0x101565f0
// MxDSStreamingAction::`scalar deleting destructor'

private:
Expand Down
81 changes: 42 additions & 39 deletions LEGO1/omni/src/action/mxdsstreamingaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,94 +5,97 @@
DECOMP_SIZE_ASSERT(MxDSStreamingAction, 0xb4)

// FUNCTION: LEGO1 0x100cd010
// FUNCTION: BETA10 0x1015f380
MxDSStreamingAction::MxDSStreamingAction(MxDSAction& p_dsAction, MxU32 p_offset)
{
Init();

*this = p_dsAction;
this->m_unk0x94 = p_offset;
this->m_bufferOffset = p_offset;
MxDSAction::operator=(p_dsAction);
m_unk0x94 = p_offset;
m_bufferOffset = p_offset;
}

// FUNCTION: LEGO1 0x100cd090
// FUNCTION: BETA10 0x101565a0
MxBool MxDSStreamingAction::HasId(MxU32 p_objectId)
{
if (this->m_internalAction) {
return this->m_internalAction->HasId(p_objectId);
}
return FALSE;
return m_internalAction ? m_internalAction->HasId(p_objectId) : FALSE;
}

// FUNCTION: LEGO1 0x100cd0d0
// FUNCTION: BETA10 0x101564a0
MxDSStreamingAction::MxDSStreamingAction(MxDSStreamingAction& p_dsStreamingAction)
{
Init();
CopyFrom(p_dsStreamingAction);
}

// FUNCTION: LEGO1 0x100cd150
// FUNCTION: BETA10 0x1015f41d
MxDSStreamingAction::~MxDSStreamingAction()
{
if (this->m_unk0xa0) {
delete this->m_unk0xa0;
if (m_unk0xa0) {
delete m_unk0xa0;
}
if (this->m_unk0xa4) {
delete this->m_unk0xa4;
if (m_unk0xa4) {
delete m_unk0xa4;
}
if (this->m_internalAction) {
delete this->m_internalAction;
if (m_internalAction) {
delete m_internalAction;
}
}

// FUNCTION: LEGO1 0x100cd1e0
MxResult MxDSStreamingAction::Init()
// FUNCTION: BETA10 0x1015f53c
void MxDSStreamingAction::Init()
{
this->m_unk0x94 = 0;
this->m_bufferOffset = 0;
this->m_unk0x9c = 0;
this->m_unk0xa0 = NULL;
this->m_unk0xa4 = NULL;
this->m_unk0xa8 = 0;
this->m_unk0xac = 2;
this->m_internalAction = NULL;
return SUCCESS;
m_unk0x94 = 0;
m_bufferOffset = 0;
m_unk0x9c = 0;
m_unk0xa0 = NULL;
m_unk0xa4 = NULL;
m_unk0xa8 = 0;
m_unk0xac = 2;
m_internalAction = NULL;
}

// FUNCTION: LEGO1 0x100cd220
// FUNCTION: BETA10 0x1015f5b9
MxDSStreamingAction* MxDSStreamingAction::CopyFrom(MxDSStreamingAction& p_dsStreamingAction)
{
*this = p_dsStreamingAction;
this->m_unk0x94 = p_dsStreamingAction.m_unk0x94;
this->m_bufferOffset = p_dsStreamingAction.m_bufferOffset;
this->m_unk0x9c = p_dsStreamingAction.m_unk0x9c;
this->m_unk0xa0 = NULL;
this->m_unk0xa4 = NULL;
this->m_unk0xac = p_dsStreamingAction.m_unk0xac;
this->m_unk0xa8 = p_dsStreamingAction.m_unk0xa8;
MxDSAction::operator=(p_dsStreamingAction);
m_unk0x94 = p_dsStreamingAction.m_unk0x94;
m_bufferOffset = p_dsStreamingAction.m_bufferOffset;
m_unk0x9c = p_dsStreamingAction.m_unk0x9c;
m_unk0xa0 = NULL;
m_unk0xa4 = NULL;
m_unk0xac = p_dsStreamingAction.m_unk0xac;
m_unk0xa8 = p_dsStreamingAction.m_unk0xa8;
SetInternalAction(p_dsStreamingAction.m_internalAction ? p_dsStreamingAction.m_internalAction->Clone() : NULL);

return this;
}

// FUNCTION: LEGO1 0x100cd2a0
// FUNCTION: BETA10 0x1015f698
void MxDSStreamingAction::SetInternalAction(MxDSAction* p_dsAction)
{
if (this->m_internalAction) {
delete this->m_internalAction;
if (m_internalAction) {
delete m_internalAction;
}
this->m_internalAction = p_dsAction;
m_internalAction = p_dsAction;
}

// FUNCTION: LEGO1 0x100cd2d0
void MxDSStreamingAction::FUN_100cd2d0()
{
if (this->m_duration == -1) {
if (m_duration == -1) {
return;
}

MxLong duration = this->m_duration / this->m_loopCount;
this->m_loopCount--;
MxLong duration = m_duration / m_loopCount;
m_loopCount--;

this->m_duration -= duration;
this->m_unk0xa8 += duration;
m_duration -= duration;
m_unk0xa8 += duration;
}

0 comments on commit 2cdbd1b

Please sign in to comment.