Implement Infocenter::InitializeBitmaps (#478)

This commit is contained in:
Misha
2024-01-21 12:38:22 -05:00
committed by GitHub
parent e61530d5a0
commit 7b0d4dd502
6 changed files with 121 additions and 11 deletions

View File

@@ -5,13 +5,19 @@
#include "radio.h" #include "radio.h"
class InfocenterState; class InfocenterState;
class MxStillPresenter;
// SIZE 0x18 // SIZE 0x18
struct InfocenterUnkDataEntry { struct InfocenterMapEntry {
// FUNCTION: LEGO1 0x1006ec80 // FUNCTION: LEGO1 0x1006ec80
InfocenterUnkDataEntry() {} InfocenterMapEntry() {}
undefined m_pad[0x18]; MxStillPresenter* m_presenter; // 0x00
undefined4 m_unk0x04; // 0x04
undefined4 m_unk0x08; // 0x08
undefined4 m_unk0x0c; // 0x0c
undefined4 m_unk0x10; // 0x10
undefined4 m_unk0x14; // 0x14
}; };
// VTABLE: LEGO1 0x100d9338 // VTABLE: LEGO1 0x100d9338
@@ -31,6 +37,22 @@ public:
enum InfomainScript { enum InfomainScript {
c_noInfomain = -1, c_noInfomain = -1,
c_leftArrowCtl = 1,
c_rightArrowCtl = 2,
c_infoCtl = 3,
c_boatCtl = 10,
c_raceCtl = 11,
c_pizzaCtl = 12,
c_gasCtl = 13,
c_medCtl = 14,
c_copCtl = 15,
c_radioCtl = 18,
c_mamaCtl = 21,
c_papaCtl = 22,
c_pepperCtl = 23,
c_nickCtl = 24,
c_lauraCtl = 25,
c_welcomeDialogue = 500, c_welcomeDialogue = 500,
c_goodJobDialogue = 501, c_goodJobDialogue = 501,
@@ -167,9 +189,9 @@ private:
Cutscene m_currentCutscene; // 0x108 Cutscene m_currentCutscene; // 0x108
Radio m_radio; // 0x10c Radio m_radio; // 0x10c
undefined4 m_unk0x11c; // 0x11c undefined4 m_unk0x11c; // 0x11c
InfocenterUnkDataEntry m_entries[7]; // 0x120 InfocenterMapEntry m_mapAreas[7]; // 0x120
MxS16 m_unk0x1c8; // 0x1c8 MxS16 m_unk0x1c8; // 0x1c8
undefined4 m_unk0x1cc; // 0x1cc MxStillPresenter* m_frameHotBitmap; // 0x1cc
MxS16 m_infoManDialogueTimer; // 0x1d0 MxS16 m_infoManDialogueTimer; // 0x1d0
MxS16 m_bookAnimationTimer; // 0x1d2 MxS16 m_bookAnimationTimer; // 0x1d2
MxU16 m_unk0x1d4; // 0x1d4 MxU16 m_unk0x1d4; // 0x1d4

View File

@@ -60,6 +60,7 @@ public:
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); MxPresenter* FindPresenter(const char* p_presenter, const char* p_name);
MxPresenter* FUN_10021790(MxAtomId& p_atom, MxS32 p_entityId);
// SYNTHETIC: LEGO1 0x1001dee0 // SYNTHETIC: LEGO1 0x1001dee0
// LegoWorld::`scalar deleting destructor' // LegoWorld::`scalar deleting destructor'

View File

@@ -25,6 +25,8 @@ public:
return !strcmp(p_name, Radio::ClassName()) || MxCore::IsA(p_name); return !strcmp(p_name, Radio::ClassName()) || MxCore::IsA(p_name);
} }
void Initialize(MxBool p_und);
// SYNTHETIC: LEGO1 0x1002c970 // SYNTHETIC: LEGO1 0x1002c970
// Radio::`scalar deleting destructor' // Radio::`scalar deleting destructor'

View File

@@ -163,6 +163,12 @@ MxPresenter* LegoWorld::FindPresenter(const char* p_presenter, const char* p_nam
return NULL; return NULL;
} }
// STUB: LEGO1 0x10021790
MxPresenter* LegoWorld::FUN_10021790(MxAtomId& p_atom, MxS32 p_entityId)
{
return NULL;
}
// STUB: LEGO1 0x10021a70 // STUB: LEGO1 0x10021a70
void LegoWorld::VTable0x68(MxBool p_add) void LegoWorld::VTable0x68(MxBool p_add)
{ {

View File

@@ -16,7 +16,7 @@
#include "mxtransitionmanager.h" #include "mxtransitionmanager.h"
DECOMP_SIZE_ASSERT(Infocenter, 0x1d8) DECOMP_SIZE_ASSERT(Infocenter, 0x1d8)
DECOMP_SIZE_ASSERT(InfocenterUnkDataEntry, 0x18) DECOMP_SIZE_ASSERT(InfocenterMapEntry, 0x18)
// GLOBAL: LEGO1 0x100f76a0 // GLOBAL: LEGO1 0x100f76a0
const char* g_object2x4red = "2x4red"; const char* g_object2x4red = "2x4red";
@@ -30,13 +30,13 @@ Infocenter::Infocenter()
m_unk0xfc = 0; m_unk0xfc = 0;
m_unk0x11c = 0; m_unk0x11c = 0;
m_infocenterState = NULL; m_infocenterState = NULL;
m_unk0x1cc = 0; m_frameHotBitmap = 0;
m_unk0x11c = 0; m_unk0x11c = 0;
m_unk0x104 = 0; m_unk0x104 = 0;
m_currentInfomainScript = c_noInfomain; m_currentInfomainScript = c_noInfomain;
m_currentCutscene = e_noIntro; m_currentCutscene = e_noIntro;
memset(&m_entries, 0, sizeof(m_entries)); memset(&m_mapAreas, 0, sizeof(m_mapAreas));
m_unk0x1c8 = -1; m_unk0x1c8 = -1;
SetAppCursor(1); SetAppCursor(1);
@@ -310,7 +310,7 @@ void Infocenter::VTable0x50()
switch (GameState()->GetUnknown10()) { switch (GameState()->GetUnknown10()) {
case 0: case 0:
// bg->Enable(1); // TODO: Uncomment once LegoWorld::FindPresenter and LegoWorld::VTable0x58 are implemented. bg->Enable(1);
InitializeBitmaps(); InitializeBitmaps();
switch (m_infocenterState->GetUnknown0x74()) { switch (m_infocenterState->GetUnknown0x74()) {
case 3: case 3:
@@ -360,10 +360,80 @@ void Infocenter::VTable0x50()
} }
} }
// STUB: LEGO1 0x1006f9a0 // FUNCTION: LEGO1 0x1006f9a0
void Infocenter::InitializeBitmaps() void Infocenter::InitializeBitmaps()
{ {
// TODO: Infocenter class size is wrong m_radio.Initialize(TRUE);
FUN_10021790(m_atom, c_leftArrowCtl)->Enable(TRUE);
FUN_10021790(m_atom, c_rightArrowCtl)->Enable(TRUE);
FUN_10021790(m_atom, c_infoCtl)->Enable(TRUE);
FUN_10021790(m_atom, c_boatCtl)->Enable(TRUE);
FUN_10021790(m_atom, c_raceCtl)->Enable(TRUE);
FUN_10021790(m_atom, c_pizzaCtl)->Enable(TRUE);
FUN_10021790(m_atom, c_gasCtl)->Enable(TRUE);
FUN_10021790(m_atom, c_medCtl)->Enable(TRUE);
FUN_10021790(m_atom, c_copCtl)->Enable(TRUE);
FUN_10021790(m_atom, c_mamaCtl)->Enable(TRUE);
FUN_10021790(m_atom, c_papaCtl)->Enable(TRUE);
FUN_10021790(m_atom, c_pepperCtl)->Enable(TRUE);
FUN_10021790(m_atom, c_nickCtl)->Enable(TRUE);
FUN_10021790(m_atom, c_lauraCtl)->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_unk0x08 = 391;
m_mapAreas[0].m_unk0x0c = 182;
m_mapAreas[0].m_unk0x10 = 427;
m_mapAreas[0].m_unk0x14 = 230;
m_mapAreas[0].m_unk0x04 = 3;
m_mapAreas[1].m_presenter = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Boat_A_Bitmap");
m_mapAreas[1].m_unk0x08 = 304;
m_mapAreas[1].m_unk0x0c = 225;
m_mapAreas[1].m_unk0x10 = 350;
m_mapAreas[1].m_unk0x14 = 268;
m_mapAreas[1].m_unk0x04 = 10;
m_mapAreas[2].m_presenter = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Race_A_Bitmap");
m_mapAreas[2].m_unk0x08 = 301;
m_mapAreas[2].m_unk0x0c = 133;
m_mapAreas[2].m_unk0x10 = 347;
m_mapAreas[2].m_unk0x14 = 181;
m_mapAreas[2].m_unk0x04 = 11;
m_mapAreas[3].m_presenter = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Pizza_A_Bitmap");
m_mapAreas[3].m_unk0x08 = 289;
m_mapAreas[3].m_unk0x0c = 182;
m_mapAreas[3].m_unk0x10 = 335;
m_mapAreas[3].m_unk0x14 = 225;
m_mapAreas[3].m_unk0x04 = 12;
m_mapAreas[4].m_presenter = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Gas_A_Bitmap");
m_mapAreas[4].m_unk0x10 = 391;
m_mapAreas[4].m_unk0x08 = 350;
m_mapAreas[4].m_unk0x0c = 161;
m_mapAreas[4].m_unk0x14 = 209;
m_mapAreas[4].m_unk0x04 = 13;
m_mapAreas[5].m_presenter = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Med_A_Bitmap");
m_mapAreas[5].m_unk0x08 = 392;
m_mapAreas[5].m_unk0x0c = 130;
m_mapAreas[5].m_unk0x10 = 438;
m_mapAreas[5].m_unk0x14 = 176;
m_mapAreas[5].m_unk0x04 = 14;
m_mapAreas[6].m_presenter = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Cop_A_Bitmap");
m_mapAreas[6].m_unk0x08 = 396;
m_mapAreas[6].m_unk0x0c = 229;
m_mapAreas[6].m_unk0x10 = 442;
m_mapAreas[6].m_unk0x14 = 272;
m_mapAreas[6].m_unk0x04 = 15;
m_frameHotBitmap = (MxStillPresenter*) FindPresenter("MxStillPresenter", "FrameHot_Bitmap");
FUN_10070dc0(TRUE);
} }
// STUB: LEGO1 0x1006fd00 // STUB: LEGO1 0x1006fd00

View File

@@ -30,6 +30,15 @@ MxLong Radio::Notify(MxParam& p_param)
return 0; return 0;
} }
// FUNCTION: LEGO1 0x1002cdc0
void Radio::Initialize(MxBool p_und)
{
if (m_unk0xc != p_und) {
m_unk0xc = p_und;
CreateRadioState();
}
}
// FUNCTION: LEGO1 0x1002cde0 // FUNCTION: LEGO1 0x1002cde0
void Radio::CreateRadioState() void Radio::CreateRadioState()
{ {