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:
Misha
2023-12-26 17:42:29 -05:00
committed by GitHub
parent ceca2aac31
commit 22d72893f9
9 changed files with 102 additions and 8 deletions

View File

@@ -2,12 +2,14 @@
#include "decomp.h"
#include "define.h"
#include "legoobjectfactory.h"
#include "legoomni.h"
#include "mxactionnotificationparam.h"
#include "mxautolocker.h"
#include "mxcompositepresenter.h"
#include "mxdsanim.h"
#include "mxdssound.h"
#include "mxentity.h"
#include "mxnotificationmanager.h"
#include "mxparam.h"
#include "mxstreamer.h"
@@ -304,6 +306,27 @@ const char* PresenterNameDispatch(const MxDSAction& p_action)
return name;
}
// FUNCTION: LEGO1 0x100b5410
MxEntity* MxPresenter::CreateEntityBackend(const char* p_name)
{
char buffer[512];
char buffer2[512];
strcpy(buffer, p_name);
MxU16 extraLen = m_action->GetExtraLength();
buffer[0] = extraLen;
buffer[1] = extraLen >> 8;
if (extraLen) {
extraLen &= MAXWORD;
memcpy(buffer2 + 2, m_action->GetExtraData(), extraLen);
buffer2[extraLen + 2] = 0;
KeyValueStringParse(buffer, g_strOBJECT, buffer2 + 2);
}
return (MxEntity*) ObjectFactory()->Create(buffer);
}
// FUNCTION: LEGO1 0x100b54c0
MxBool MxPresenter::IsEnabled()
{