mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 16:34:06 +00:00
Finish LegoEntityPresenter (#363)
* Lego entity implementation * Finish LegoEntityPresenter::ReadyTickle * Update legoentitypresenter.h * use empty * Formatting --------- Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "legoentitypresenter.h"
|
||||
|
||||
#include "islepathactor.h"
|
||||
#include "legoomni.h"
|
||||
#include "legovideomanager.h"
|
||||
|
||||
@@ -14,7 +15,7 @@ LegoEntityPresenter::LegoEntityPresenter()
|
||||
// FUNCTION: LEGO1 0x100535c0
|
||||
void LegoEntityPresenter::Init()
|
||||
{
|
||||
m_unk0x4c = 0;
|
||||
m_objectBackend = 0;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100535d0
|
||||
@@ -24,9 +25,9 @@ LegoEntityPresenter::~LegoEntityPresenter()
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10053630
|
||||
undefined4 LegoEntityPresenter::VTable0x6c(undefined4 p_unk0x4c)
|
||||
undefined4 LegoEntityPresenter::SetBackend(LegoEntity* p_backend)
|
||||
{
|
||||
m_unk0x4c = p_unk0x4c;
|
||||
m_objectBackend = p_backend;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -45,3 +46,52 @@ void LegoEntityPresenter::Destroy()
|
||||
{
|
||||
Destroy(FALSE);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10053680
|
||||
MxResult LegoEntityPresenter::StartAction(MxStreamController* p_controller, MxDSAction* p_action)
|
||||
{
|
||||
MxResult result = MxCompositePresenter::StartAction(p_controller, p_action);
|
||||
|
||||
if (VideoManager()) {
|
||||
VideoManager()->AddPresenter(*this);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100536c0
|
||||
void LegoEntityPresenter::ReadyTickle()
|
||||
{
|
||||
if (GetCurrentWorld()) {
|
||||
m_objectBackend = (LegoEntity*) MxPresenter::CreateEntityBackend("LegoEntity");
|
||||
if (m_objectBackend) {
|
||||
m_objectBackend->Create(*m_action);
|
||||
m_objectBackend->SetLocation(m_action->GetLocation(), m_action->GetDirection(), m_action->GetUp(), TRUE);
|
||||
ParseExtra();
|
||||
}
|
||||
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
|
||||
m_currentTickleState = TickleState_Starting;
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10053720
|
||||
void LegoEntityPresenter::RepeatingTickle()
|
||||
{
|
||||
if (m_list.empty()) {
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10053750
|
||||
void LegoEntityPresenter::ParseExtra()
|
||||
{
|
||||
char data[512];
|
||||
MxU16 len = m_action->GetExtraLength();
|
||||
if (len) {
|
||||
memcpy(data, m_action->GetExtraData(), len);
|
||||
data[len] = 0;
|
||||
|
||||
len &= MAXWORD;
|
||||
m_objectBackend->ParseAction(data);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user