Implement LegoWorld::FUN_100213a0

This commit is contained in:
Christian Semmler 2024-01-26 12:03:18 -05:00
parent 5f413165cc
commit b68f8a5c6d
7 changed files with 79 additions and 18 deletions

View File

@ -40,7 +40,7 @@ class LegoAnimPresenter : public MxVideoPresenter {
virtual void PutFrame() override; // vtable+0x6c virtual void PutFrame() override; // vtable+0x6c
virtual MxResult VTable0x88(MxStreamChunk* p_chunk); // vtable+0x88 virtual MxResult VTable0x88(MxStreamChunk* p_chunk); // vtable+0x88
// 6 more virtual functions here const char* GetActionObjectName();
protected: protected:
void Init(); void Init();

View File

@ -65,7 +65,7 @@ class LegoWorld : public LegoEntity {
void FUN_10073400(); void FUN_10073400();
void FUN_10073430(); void FUN_10073430();
MxS32 GetCurrPathInfo(LegoPathBoundary** p_path, MxS32& p_value); MxS32 GetCurrPathInfo(LegoPathBoundary** p_path, MxS32& p_value);
MxPresenter* FindPresenter(const char* p_presenter, const char* p_name); MxCore* FUN_100213a0(const char* p_class, const char* p_name);
MxPresenter* FUN_10021790(MxAtomId& p_atom, MxS32 p_entityId); MxPresenter* FUN_10021790(MxAtomId& p_atom, MxS32 p_entityId);
// SYNTHETIC: LEGO1 0x1001dee0 // SYNTHETIC: LEGO1 0x1001dee0

View File

@ -1,5 +1,6 @@
#include "legoworld.h" #include "legoworld.h"
#include "legoanimpresenter.h"
#include "legocontrolmanager.h" #include "legocontrolmanager.h"
#include "legoinputmanager.h" #include "legoinputmanager.h"
#include "legoomni.h" #include "legoomni.h"
@ -162,10 +163,60 @@ void LegoWorld::EndAction(MxCore* p_object)
{ {
} }
// STUB: LEGO1 0x100213a0 // FUNCTION: LEGO1 0x100213a0
MxPresenter* LegoWorld::FindPresenter(const char* p_presenter, const char* p_name) MxCore* LegoWorld::FUN_100213a0(const char* p_class, const char* p_name)
{ {
if (!strcmp(p_class, "MxControlPresenter")) {
MxPresenterListCursor cursor(&m_list0xb8);
MxPresenter* presenter;
while (cursor.Next(presenter)) {
MxDSAction* action = presenter->GetAction();
if (!strcmp(action->GetObjectName(), p_name))
return presenter;
}
return NULL; return NULL;
}
else if (!strcmp(p_class, "MxEntity")) {
LegoEntityListCursor cursor(m_entityList);
LegoEntity* entity;
while (cursor.Next(entity)) {
if (!p_name)
return entity;
LegoROI* roi = entity->GetROI();
if (roi && !strcmpi(roi->GetUnknown0xe4(), p_name))
return entity;
}
return NULL;
}
else if (!strcmp(p_class, "LegoAnimPresenter")) {
MxPresenterListCursor cursor(&m_list0x80);
MxPresenter* presenter;
while (cursor.Next(presenter)) {
if (!strcmpi(((LegoAnimPresenter*) presenter)->GetActionObjectName(), p_name))
return presenter;
}
return NULL;
}
else {
for (MxPresenterSet::iterator it = m_set0xa8.begin(); it != m_set0xa8.end(); it++) {
if ((*it)->IsA(p_class) && (*it)->IsA("MxPresenter")) {
MxPresenter* presenter = (MxPresenter*) *it;
MxDSAction* action = presenter->GetAction();
if (!strcmp(action->GetObjectName(), p_name))
return *it;
}
}
return NULL;
}
} }
// STUB: LEGO1 0x10021790 // STUB: LEGO1 0x10021790

View File

@ -305,8 +305,8 @@ void Infocenter::VTable0x50()
m_unk0x1d4 = 0; m_unk0x1d4 = 0;
m_unk0x1d6 = 0; m_unk0x1d6 = 0;
MxStillPresenter* bg = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Background_Bitmap"); MxStillPresenter* bg = (MxStillPresenter*) FUN_100213a0("MxStillPresenter", "Background_Bitmap");
MxStillPresenter* bgRed = (MxStillPresenter*) FindPresenter("MxStillPresenter", "BackgroundRed_Bitmap"); MxStillPresenter* bgRed = (MxStillPresenter*) FUN_100213a0("MxStillPresenter", "BackgroundRed_Bitmap");
switch (GameState()->GetUnknown10()) { switch (GameState()->GetUnknown10()) {
case 0: case 0:
@ -382,56 +382,56 @@ void Infocenter::InitializeBitmaps()
FUN_10021790(m_atom, c_lauraCtl)->Enable(TRUE); FUN_10021790(m_atom, c_lauraCtl)->Enable(TRUE);
FUN_10021790(m_atom, c_radioCtl)->Enable(TRUE); FUN_10021790(m_atom, c_radioCtl)->Enable(TRUE);
m_mapAreas[0].m_presenter = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Info_A_Bitmap"); m_mapAreas[0].m_presenter = (MxStillPresenter*) FUN_100213a0("MxStillPresenter", "Info_A_Bitmap");
m_mapAreas[0].m_unk0x08 = 391; m_mapAreas[0].m_unk0x08 = 391;
m_mapAreas[0].m_unk0x0c = 182; m_mapAreas[0].m_unk0x0c = 182;
m_mapAreas[0].m_unk0x10 = 427; m_mapAreas[0].m_unk0x10 = 427;
m_mapAreas[0].m_unk0x14 = 230; m_mapAreas[0].m_unk0x14 = 230;
m_mapAreas[0].m_unk0x04 = 3; m_mapAreas[0].m_unk0x04 = 3;
m_mapAreas[1].m_presenter = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Boat_A_Bitmap"); m_mapAreas[1].m_presenter = (MxStillPresenter*) FUN_100213a0("MxStillPresenter", "Boat_A_Bitmap");
m_mapAreas[1].m_unk0x08 = 304; m_mapAreas[1].m_unk0x08 = 304;
m_mapAreas[1].m_unk0x0c = 225; m_mapAreas[1].m_unk0x0c = 225;
m_mapAreas[1].m_unk0x10 = 350; m_mapAreas[1].m_unk0x10 = 350;
m_mapAreas[1].m_unk0x14 = 268; m_mapAreas[1].m_unk0x14 = 268;
m_mapAreas[1].m_unk0x04 = 10; m_mapAreas[1].m_unk0x04 = 10;
m_mapAreas[2].m_presenter = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Race_A_Bitmap"); m_mapAreas[2].m_presenter = (MxStillPresenter*) FUN_100213a0("MxStillPresenter", "Race_A_Bitmap");
m_mapAreas[2].m_unk0x08 = 301; m_mapAreas[2].m_unk0x08 = 301;
m_mapAreas[2].m_unk0x0c = 133; m_mapAreas[2].m_unk0x0c = 133;
m_mapAreas[2].m_unk0x10 = 347; m_mapAreas[2].m_unk0x10 = 347;
m_mapAreas[2].m_unk0x14 = 181; m_mapAreas[2].m_unk0x14 = 181;
m_mapAreas[2].m_unk0x04 = 11; m_mapAreas[2].m_unk0x04 = 11;
m_mapAreas[3].m_presenter = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Pizza_A_Bitmap"); m_mapAreas[3].m_presenter = (MxStillPresenter*) FUN_100213a0("MxStillPresenter", "Pizza_A_Bitmap");
m_mapAreas[3].m_unk0x08 = 289; m_mapAreas[3].m_unk0x08 = 289;
m_mapAreas[3].m_unk0x0c = 182; m_mapAreas[3].m_unk0x0c = 182;
m_mapAreas[3].m_unk0x10 = 335; m_mapAreas[3].m_unk0x10 = 335;
m_mapAreas[3].m_unk0x14 = 225; m_mapAreas[3].m_unk0x14 = 225;
m_mapAreas[3].m_unk0x04 = 12; m_mapAreas[3].m_unk0x04 = 12;
m_mapAreas[4].m_presenter = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Gas_A_Bitmap"); m_mapAreas[4].m_presenter = (MxStillPresenter*) FUN_100213a0("MxStillPresenter", "Gas_A_Bitmap");
m_mapAreas[4].m_unk0x10 = 391; m_mapAreas[4].m_unk0x10 = 391;
m_mapAreas[4].m_unk0x08 = 350; m_mapAreas[4].m_unk0x08 = 350;
m_mapAreas[4].m_unk0x0c = 161; m_mapAreas[4].m_unk0x0c = 161;
m_mapAreas[4].m_unk0x14 = 209; m_mapAreas[4].m_unk0x14 = 209;
m_mapAreas[4].m_unk0x04 = 13; m_mapAreas[4].m_unk0x04 = 13;
m_mapAreas[5].m_presenter = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Med_A_Bitmap"); m_mapAreas[5].m_presenter = (MxStillPresenter*) FUN_100213a0("MxStillPresenter", "Med_A_Bitmap");
m_mapAreas[5].m_unk0x08 = 392; m_mapAreas[5].m_unk0x08 = 392;
m_mapAreas[5].m_unk0x0c = 130; m_mapAreas[5].m_unk0x0c = 130;
m_mapAreas[5].m_unk0x10 = 438; m_mapAreas[5].m_unk0x10 = 438;
m_mapAreas[5].m_unk0x14 = 176; m_mapAreas[5].m_unk0x14 = 176;
m_mapAreas[5].m_unk0x04 = 14; m_mapAreas[5].m_unk0x04 = 14;
m_mapAreas[6].m_presenter = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Cop_A_Bitmap"); m_mapAreas[6].m_presenter = (MxStillPresenter*) FUN_100213a0("MxStillPresenter", "Cop_A_Bitmap");
m_mapAreas[6].m_unk0x08 = 396; m_mapAreas[6].m_unk0x08 = 396;
m_mapAreas[6].m_unk0x0c = 229; m_mapAreas[6].m_unk0x0c = 229;
m_mapAreas[6].m_unk0x10 = 442; m_mapAreas[6].m_unk0x10 = 442;
m_mapAreas[6].m_unk0x14 = 272; m_mapAreas[6].m_unk0x14 = 272;
m_mapAreas[6].m_unk0x04 = 15; m_mapAreas[6].m_unk0x04 = 15;
m_frameHotBitmap = (MxStillPresenter*) FindPresenter("MxStillPresenter", "FrameHot_Bitmap"); m_frameHotBitmap = (MxStillPresenter*) FUN_100213a0("MxStillPresenter", "FrameHot_Bitmap");
FUN_10070dc0(TRUE); FUN_10070dc0(TRUE);
} }

View File

@ -173,6 +173,12 @@ void LegoAnimPresenter::Destroy()
Destroy(FALSE); Destroy(FALSE);
} }
// FUNCTION: LEGO1 0x1006b8f0
const char* LegoAnimPresenter::GetActionObjectName()
{
return m_action->GetObjectName();
}
// STUB: LEGO1 0x1006bac0 // STUB: LEGO1 0x1006bac0
void LegoAnimPresenter::ParseExtra() void LegoAnimPresenter::ParseExtra()
{ {

View File

@ -40,6 +40,7 @@ class LegoROI : public ViewROI {
void FUN_100a46b0(Matrix4& p_transform); void FUN_100a46b0(Matrix4& p_transform);
void FUN_100a58f0(Matrix4& p_transform); void FUN_100a58f0(Matrix4& p_transform);
inline const char* GetUnknown0xe4() { return m_unk0xe4; }
inline LegoEntity* GetUnknown0x104() { return m_unk0x104; } inline LegoEntity* GetUnknown0x104() { return m_unk0x104; }
inline void SetUnknown0x104(LegoEntity* p_unk0x104) { m_unk0x104 = p_unk0x104; } inline void SetUnknown0x104(LegoEntity* p_unk0x104) { m_unk0x104 = p_unk0x104; }
@ -47,7 +48,9 @@ class LegoROI : public ViewROI {
// LegoROI::`scalar deleting destructor' // LegoROI::`scalar deleting destructor'
private: private:
undefined m_pad[0x24]; // 0xe0 undefined4 m_unk0xe0; // 0xe0
const char* m_unk0xe4; // 0xe4
undefined m_unk0xe8[0x1c]; // 0xe8
LegoEntity* m_unk0x104; // 0x104 LegoEntity* m_unk0x104; // 0x104
int m_time; // 0x108 int m_time; // 0x108
}; };

View File

@ -51,6 +51,7 @@ class MxDSObject : public MxCore {
inline Type GetType() const { return (Type) this->m_type; } inline Type GetType() const { return (Type) this->m_type; }
inline const char* GetSourceName() const { return this->m_sourceName; } inline const char* GetSourceName() const { return this->m_sourceName; }
inline const char* GetObjectName() const { return this->m_objectName; }
inline MxU32 GetObjectId() { return this->m_objectId; } inline MxU32 GetObjectId() { return this->m_objectId; }
inline const MxAtomId& GetAtomId() { return this->m_atomId; } inline const MxAtomId& GetAtomId() { return this->m_atomId; }
inline MxS16 GetUnknown24() { return this->m_unk0x24; } inline MxS16 GetUnknown24() { return this->m_unk0x24; }