mirror of
https://github.com/isledecomp/isle-portable.git
synced 2024-11-22 15:37:55 -05:00
begin LegoAnimMMPresenter (#706)
This commit is contained in:
parent
d8fedab090
commit
3ce1e4985e
2 changed files with 105 additions and 9 deletions
|
@ -3,6 +3,8 @@
|
|||
|
||||
#include "mxcompositepresenter.h"
|
||||
|
||||
class LegoWorld;
|
||||
|
||||
// VTABLE: LEGO1 0x100d7de8
|
||||
// SIZE 0x74
|
||||
class LegoAnimMMPresenter : public MxCompositePresenter {
|
||||
|
@ -38,6 +40,19 @@ class LegoAnimMMPresenter : public MxCompositePresenter {
|
|||
// LegoAnimMMPresenter::`scalar deleting destructor'
|
||||
|
||||
MxBool FUN_1004b8b0();
|
||||
|
||||
private:
|
||||
MxPresenter* m_unk0x4c; // 0x4c
|
||||
undefined4 m_unk0x50; // 0x50
|
||||
undefined4 m_unk0x54; // 0x54
|
||||
undefined m_unk0x58; // 0x58
|
||||
undefined m_unk0x59; // 0x59
|
||||
undefined4 m_unk0x5c; // 0x5c
|
||||
undefined4 m_unk0x60; // 0x60
|
||||
LegoWorld* m_unk0x64; // 0x64
|
||||
undefined4 m_unk0x68; // 0x68
|
||||
undefined4 m_unk0x6c; // 0x6c
|
||||
undefined4 m_unk0x70; // 0x70
|
||||
};
|
||||
|
||||
#endif // LEGOANIMMMPRESENTER_H
|
||||
|
|
|
@ -1,16 +1,94 @@
|
|||
#include "legoanimmmpresenter.h"
|
||||
|
||||
// STUB: LEGO1 0x1004a8d0
|
||||
#include "decomp.h"
|
||||
#include "legovideomanager.h"
|
||||
#include "legoworld.h"
|
||||
#include "misc.h"
|
||||
#include "mxautolock.h"
|
||||
#include "mxdsmultiaction.h"
|
||||
#include "mxmisc.h"
|
||||
#include "mxnotificationmanager.h"
|
||||
#include "mxobjectfactory.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(LegoAnimMMPresenter, 0x74)
|
||||
|
||||
// FUNCTION: LEGO1 0x1004a8d0
|
||||
LegoAnimMMPresenter::LegoAnimMMPresenter()
|
||||
{
|
||||
// TODO
|
||||
m_unk0x4c = NULL;
|
||||
m_unk0x5c = 0;
|
||||
m_unk0x59 = 0;
|
||||
m_unk0x60 = 0;
|
||||
m_unk0x54 = 0;
|
||||
m_unk0x64 = NULL;
|
||||
m_unk0x68 = 0;
|
||||
m_unk0x6c = 0;
|
||||
m_unk0x70 = 0;
|
||||
m_unk0x58 = 0;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1004aaf0
|
||||
// FUNCTION: LEGO1 0x1004aaf0
|
||||
MxResult LegoAnimMMPresenter::StartAction(MxStreamController* p_controller, MxDSAction* p_action)
|
||||
{
|
||||
// TODO
|
||||
return SUCCESS;
|
||||
AUTOLOCK(m_criticalSection);
|
||||
|
||||
MxResult result = FAILURE;
|
||||
MxDSActionList* actions = ((MxDSMultiAction*) p_action)->GetActionList();
|
||||
MxObjectFactory* factory = ObjectFactory();
|
||||
MxDSActionListCursor cursor(actions);
|
||||
MxDSAction* action;
|
||||
|
||||
if (MxPresenter::StartAction(p_controller, p_action) == SUCCESS) {
|
||||
cursor.Head();
|
||||
|
||||
while (cursor.Current(action)) {
|
||||
MxBool success = FALSE;
|
||||
const char* presenterName;
|
||||
MxPresenter* presenter = NULL;
|
||||
|
||||
cursor.Next();
|
||||
|
||||
if (m_action->GetFlags() & MxDSAction::c_looping) {
|
||||
action->SetFlags(action->GetFlags() | MxDSAction::c_looping);
|
||||
}
|
||||
else if (m_action->GetFlags() & MxDSAction::c_bit3) {
|
||||
action->SetFlags(action->GetFlags() | MxDSAction::c_bit3);
|
||||
}
|
||||
|
||||
presenterName = PresenterNameDispatch(*action);
|
||||
presenter = (MxPresenter*) factory->Create(presenterName);
|
||||
|
||||
if (presenter && presenter->AddToManager() == SUCCESS) {
|
||||
presenter->SetCompositePresenter(this);
|
||||
if (presenter->StartAction(p_controller, action) == SUCCESS) {
|
||||
presenter->SetTickleState(MxPresenter::e_idle);
|
||||
|
||||
if (presenter->IsA("LegoAnimPresenter") || presenter->IsA("LegoLoopingAnimPresenter")) {
|
||||
m_unk0x4c = presenter;
|
||||
}
|
||||
success = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (success) {
|
||||
action->SetOrigin(this);
|
||||
m_list.push_back(presenter);
|
||||
}
|
||||
else if (presenter) {
|
||||
delete presenter;
|
||||
}
|
||||
}
|
||||
|
||||
m_unk0x64 = CurrentWorld();
|
||||
if (m_unk0x64) {
|
||||
m_unk0x64->Add(this);
|
||||
}
|
||||
VideoManager()->RegisterPresenter(*this);
|
||||
|
||||
result = SUCCESS;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1004aec0
|
||||
|
@ -43,10 +121,10 @@ void LegoAnimMMPresenter::RepeatingTickle()
|
|||
// TODO
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1004b2c0
|
||||
// FUNCTION: LEGO1 0x1004b2c0
|
||||
void LegoAnimMMPresenter::DoneTickle()
|
||||
{
|
||||
// TODO
|
||||
// Empty
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1004b2d0
|
||||
|
@ -56,10 +134,13 @@ MxLong LegoAnimMMPresenter::Notify(MxParam& p_param)
|
|||
return 0;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1004b360
|
||||
// FUNCTION: LEGO1 0x1004b360
|
||||
void LegoAnimMMPresenter::VTable0x60(MxPresenter* p_presenter)
|
||||
{
|
||||
// TODO
|
||||
if (m_unk0x4c == p_presenter && ((MxU8) p_presenter->GetCurrentTickleState() == MxPresenter::e_streaming ||
|
||||
(MxU8) p_presenter->GetCurrentTickleState() == MxPresenter::e_done)) {
|
||||
p_presenter->SetTickleState(MxPresenter::e_idle);
|
||||
}
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1004b390
|
||||
|
|
Loading…
Reference in a new issue