mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-21 15:21:15 +00:00
Bootstrap MxDSMultiAction
This commit is contained in:
parent
1d3c1bdbd1
commit
c8f67bb2bb
@ -109,6 +109,7 @@ add_library(lego1 SHARED
|
|||||||
LEGO1/mxdiskstreamprovider.cpp
|
LEGO1/mxdiskstreamprovider.cpp
|
||||||
LEGO1/mxdisplaysurface.cpp
|
LEGO1/mxdisplaysurface.cpp
|
||||||
LEGO1/mxdsaction.cpp
|
LEGO1/mxdsaction.cpp
|
||||||
|
LEGO1/mxdsactionlist.cpp
|
||||||
LEGO1/mxdsanim.cpp
|
LEGO1/mxdsanim.cpp
|
||||||
LEGO1/mxdschunk.cpp
|
LEGO1/mxdschunk.cpp
|
||||||
LEGO1/mxdsevent.cpp
|
LEGO1/mxdsevent.cpp
|
||||||
|
|||||||
14
LEGO1/mxdsactionlist.cpp
Normal file
14
LEGO1/mxdsactionlist.cpp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#include "mxdsactionlist.h"
|
||||||
|
#include "mxdsaction.h"
|
||||||
|
|
||||||
|
DECOMP_SIZE_ASSERT(MxDSActionList, 0x1c);
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100c9c90
|
||||||
|
MxS8 MxDSActionList::Compare(MxDSAction *p_var0, MxDSAction *p_var1)
|
||||||
|
{
|
||||||
|
if (p_var1 == p_var0)
|
||||||
|
return 0;
|
||||||
|
if (p_var1 <= p_var0)
|
||||||
|
return 1;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
25
LEGO1/mxdsactionlist.h
Normal file
25
LEGO1/mxdsactionlist.h
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#ifndef MXDSACTIONLIST_H
|
||||||
|
#define MXDSACTIONLIST_H
|
||||||
|
|
||||||
|
#include "decomp.h"
|
||||||
|
#include "mxlist.h"
|
||||||
|
|
||||||
|
class MxDSAction;
|
||||||
|
|
||||||
|
// VTABLE 0x100dced8
|
||||||
|
// SIZE 0x1c
|
||||||
|
class MxDSActionList : public MxList<MxDSAction>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MxDSActionList() {
|
||||||
|
unk18 = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual MxS8 Compare(MxDSAction *, MxDSAction *); // +0x14
|
||||||
|
|
||||||
|
undefined unk18;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef MxListCursorChild<MxDSAction> MxDSActionListCursor;
|
||||||
|
|
||||||
|
#endif // MXDSACTIONLIST_H
|
||||||
@ -3,12 +3,49 @@
|
|||||||
// OFFSET: LEGO1 0x100c9b90
|
// OFFSET: LEGO1 0x100c9b90
|
||||||
MxDSMultiAction::MxDSMultiAction()
|
MxDSMultiAction::MxDSMultiAction()
|
||||||
{
|
{
|
||||||
// TODO
|
|
||||||
this->SetType(MxDSType_MultiAction);
|
this->SetType(MxDSType_MultiAction);
|
||||||
|
this->m_actions = new MxDSActionList;
|
||||||
|
this->m_actions->SetDestroy(MxDSMultiAction::DestroyListElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100ca060 STUB
|
// OFFSET: LEGO1 0x100c9cb0
|
||||||
|
void MxDSMultiAction::DestroyListElement(MxDSAction *p_action)
|
||||||
|
{
|
||||||
|
if (p_action)
|
||||||
|
delete p_action;
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100ca060
|
||||||
MxDSMultiAction::~MxDSMultiAction()
|
MxDSMultiAction::~MxDSMultiAction()
|
||||||
{
|
{
|
||||||
// TODO
|
if (this->m_actions)
|
||||||
|
delete this->m_actions;
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100ca5e0
|
||||||
|
undefined4 MxDSMultiAction::unk14()
|
||||||
|
{
|
||||||
|
undefined4 result = MxDSObject::unk14();
|
||||||
|
|
||||||
|
MxDSActionListCursor cursor(this->m_actions);
|
||||||
|
MxDSAction *action;
|
||||||
|
while (cursor.Next(action))
|
||||||
|
result += action->unk14();
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: LEGO1 0x100ca6c0
|
||||||
|
MxU32 MxDSMultiAction::GetSizeOnDisk()
|
||||||
|
{
|
||||||
|
MxU32 totalSizeOnDisk = MxDSAction::GetSizeOnDisk() + 16;
|
||||||
|
|
||||||
|
MxDSActionListCursor cursor(this->m_actions);
|
||||||
|
MxDSAction *action;
|
||||||
|
while (cursor.Next(action))
|
||||||
|
totalSizeOnDisk += action->GetSizeOnDisk();
|
||||||
|
|
||||||
|
this->m_sizeOnDisk = totalSizeOnDisk - MxDSAction::GetSizeOnDisk();
|
||||||
|
|
||||||
|
return totalSizeOnDisk;
|
||||||
}
|
}
|
||||||
@ -2,6 +2,7 @@
|
|||||||
#define MXDSMULTIACTION_H
|
#define MXDSMULTIACTION_H
|
||||||
|
|
||||||
#include "mxdsaction.h"
|
#include "mxdsaction.h"
|
||||||
|
#include "mxdsactionlist.h"
|
||||||
|
|
||||||
// VTABLE 0x100dcef0
|
// VTABLE 0x100dcef0
|
||||||
// SIZE 0x9c
|
// SIZE 0x9c
|
||||||
@ -23,6 +24,15 @@ class MxDSMultiAction : public MxDSAction
|
|||||||
{
|
{
|
||||||
return !strcmp(name, MxDSMultiAction::ClassName()) || MxDSAction::IsA(name);
|
return !strcmp(name, MxDSMultiAction::ClassName()) || MxDSAction::IsA(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual undefined4 unk14(); // vtable+14;
|
||||||
|
virtual MxU32 GetSizeOnDisk(); // vtable+18;
|
||||||
|
|
||||||
|
private:
|
||||||
|
MxU32 m_sizeOnDisk;
|
||||||
|
MxDSActionList *m_actions;
|
||||||
|
|
||||||
|
static void DestroyListElement(MxDSAction *p_action);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MXDSMULTIACTION_H
|
#endif // MXDSMULTIACTION_H
|
||||||
|
|||||||
@ -60,6 +60,7 @@ class MxList : protected MxListParent<T>
|
|||||||
|
|
||||||
void Append(T*);
|
void Append(T*);
|
||||||
MxU32 GetCount() { return m_count; }
|
MxU32 GetCount() { return m_count; }
|
||||||
|
void SetDestroy(void (*p_customDestructor)(T *)) { this->m_customDestructor = p_customDestructor; }
|
||||||
|
|
||||||
friend class MxListCursor<T>;
|
friend class MxListCursor<T>;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user