2023-06-29 04:10:08 -04:00
|
|
|
#include "legophonemepresenter.h"
|
|
|
|
|
2024-04-16 10:07:13 -04:00
|
|
|
#include "legocharactermanager.h"
|
|
|
|
#include "misc.h"
|
|
|
|
#include "misc/legocontainer.h"
|
|
|
|
#include "mxcompositepresenter.h"
|
|
|
|
|
2024-03-22 21:30:58 -04:00
|
|
|
DECOMP_SIZE_ASSERT(LegoPhonemePresenter, 0x88)
|
2023-08-28 05:38:46 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x1004e180
|
2023-06-29 04:10:08 -04:00
|
|
|
LegoPhonemePresenter::LegoPhonemePresenter()
|
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
Init();
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x1004e340
|
2023-11-21 03:44:45 -05:00
|
|
|
LegoPhonemePresenter::~LegoPhonemePresenter()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x1004e3b0
|
2023-06-29 04:10:08 -04:00
|
|
|
void LegoPhonemePresenter::Init()
|
|
|
|
{
|
2023-12-13 05:48:14 -05:00
|
|
|
m_unk0x68 = 0;
|
2024-04-16 10:07:13 -04:00
|
|
|
m_textureInfo = NULL;
|
|
|
|
m_unk0x70 = FALSE;
|
|
|
|
m_unk0x84 = FALSE;
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
2024-01-20 18:04:46 -05:00
|
|
|
|
2024-04-16 10:07:13 -04:00
|
|
|
// FUNCTION: LEGO1 0x1004e3d0
|
2024-01-20 18:04:46 -05:00
|
|
|
void LegoPhonemePresenter::StartingTickle()
|
|
|
|
{
|
2024-04-16 10:07:13 -04:00
|
|
|
MxFlcPresenter::StartingTickle();
|
|
|
|
|
|
|
|
if (m_textureInfo == NULL) {
|
|
|
|
MxU16 extraLength;
|
|
|
|
char* extraData;
|
|
|
|
|
|
|
|
m_action->GetExtra(extraLength, extraData);
|
|
|
|
|
|
|
|
if (extraData != NULL) {
|
|
|
|
m_roiName = extraData;
|
|
|
|
m_roiName.ToUpperCase();
|
|
|
|
|
|
|
|
LegoROI *entityROI, *head;
|
|
|
|
|
|
|
|
if (m_compositePresenter != NULL && m_compositePresenter->IsA("LegoAnimMMPresenter")) {
|
|
|
|
entityROI = FindROI(m_roiName.GetData());
|
|
|
|
m_unk0x84 = TRUE;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
entityROI = CharacterManager()->GetROI(m_roiName.GetData(), TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
head = entityROI->FindChildROI("head", entityROI);
|
|
|
|
head->GetTexture(m_textureInfo);
|
2024-02-06 17:53:35 -05:00
|
|
|
|
2024-04-16 10:07:13 -04:00
|
|
|
LegoPhonemeList* phonemeList = VideoManager()->GetPhonemeList();
|
|
|
|
LegoPhoneme* phoneme = new LegoPhoneme(m_roiName.GetData(), 1);
|
|
|
|
|
|
|
|
LegoPhonemeListCursor cursor(phonemeList);
|
|
|
|
|
|
|
|
if (!cursor.Find(phoneme)) {
|
|
|
|
LegoTextureInfo* textureInfo = TextureContainer()->AddToList(m_textureInfo);
|
|
|
|
|
|
|
|
CharacterManager()->FUN_100849a0(entityROI, textureInfo);
|
|
|
|
|
|
|
|
phoneme->VTable0x0c(m_textureInfo);
|
|
|
|
phoneme->VTable0x14(textureInfo);
|
|
|
|
phonemeList->Append(phoneme);
|
|
|
|
m_textureInfo = textureInfo;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
LegoPhoneme* newPhoneme = phoneme;
|
|
|
|
cursor.Current(phoneme);
|
|
|
|
delete newPhoneme;
|
|
|
|
|
|
|
|
phoneme->VTable0x04(phoneme->VTable0x00() + 1);
|
|
|
|
cursor.SetValue(phoneme);
|
|
|
|
|
|
|
|
m_unk0x70 = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-01-20 18:04:46 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x1004e800
|
|
|
|
void LegoPhonemePresenter::LoadFrame(MxStreamChunk* p_chunk)
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x1004e840
|
|
|
|
void LegoPhonemePresenter::PutFrame()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x1004e870
|
|
|
|
void LegoPhonemePresenter::EndAction()
|
|
|
|
{
|
|
|
|
// TODO
|
2024-02-06 17:53:35 -05:00
|
|
|
|
|
|
|
if (m_action != NULL) {
|
|
|
|
MxFlcPresenter::EndAction();
|
|
|
|
}
|
2024-01-20 18:04:46 -05:00
|
|
|
}
|