diff --git a/LEGO1/lego/legoomni/include/legobuildingmanager.h b/LEGO1/lego/legoomni/include/legobuildingmanager.h index 782dccb9..8c9c8cec 100644 --- a/LEGO1/lego/legoomni/include/legobuildingmanager.h +++ b/LEGO1/lego/legoomni/include/legobuildingmanager.h @@ -66,7 +66,7 @@ class LegoBuildingManager : public MxCore { static void SetCustomizeAnimFile(const char* p_value); void Init(); - void FUN_1002fa00(); + void LoadWorldInfo(); void CreateBuilding(MxS32 p_index, LegoWorld* p_world); void Reset(); MxResult Write(LegoStorage* p_storage); @@ -77,7 +77,7 @@ class LegoBuildingManager : public MxCore { MxBool SwitchMove(LegoEntity* p_entity); MxBool SwitchMood(LegoEntity* p_entity); MxU32 GetAnimationId(LegoEntity* p_entity); - MxU32 GetSoundId(LegoEntity* p_entity, MxBool); + MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_state); MxBool FUN_10030000(LegoEntity* p_entity); MxBool FUN_10030030(MxS32 p_index); MxBool FUN_10030110(LegoBuildingInfo* p_data); diff --git a/LEGO1/lego/legoomni/include/legoplantmanager.h b/LEGO1/lego/legoomni/include/legoplantmanager.h index 6f02774b..48f69521 100644 --- a/LEGO1/lego/legoomni/include/legoplantmanager.h +++ b/LEGO1/lego/legoomni/include/legoplantmanager.h @@ -39,7 +39,7 @@ class LegoPlantManager : public MxCore { MxBool SwitchMood(LegoEntity* p_entity); MxU32 GetAnimationId(LegoEntity* p_entity); MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_state); - void FUN_10026c50(LegoEntity* p_entity); + MxBool FUN_10026c50(LegoEntity* p_entity); void FUN_10027120(); static void SetCustomizeAnimFile(const char* p_value); @@ -53,6 +53,7 @@ class LegoPlantManager : public MxCore { void RemovePlant(MxS32 p_index, MxS32 p_worldId); void FUN_10026860(MxS32 p_index); LegoPlantInfo* GetInfo(LegoEntity* p_entity); + MxBool FUN_10026c80(MxS32 p_index); static char* g_customizeAnimFile; static MxS32 g_maxMove[4]; diff --git a/LEGO1/lego/legoomni/include/legoplants.h b/LEGO1/lego/legoomni/include/legoplants.h index ee1ea49b..1b26b0e8 100644 --- a/LEGO1/lego/legoomni/include/legoplants.h +++ b/LEGO1/lego/legoomni/include/legoplants.h @@ -10,7 +10,7 @@ class LegoPathBoundary; // SIZE 0x54 struct LegoPlantInfo { // See LegoOmni::RegisterWorlds for IDs - enum Worlds { + enum World { c_act1 = 1 << 0, c_imain = 1 << 1, c_ielev = 1 << 4, diff --git a/LEGO1/lego/legoomni/src/common/legobuildingmanager.cpp b/LEGO1/lego/legoomni/src/common/legobuildingmanager.cpp index 00cfa8dc..b69a3f52 100644 --- a/LEGO1/lego/legoomni/src/common/legobuildingmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legobuildingmanager.cpp @@ -257,7 +257,7 @@ void LegoBuildingManager::Init() // FUNCTION: LEGO1 0x1002fa00 // FUNCTION: BETA10 0x10063ad1 -void LegoBuildingManager::FUN_1002fa00() +void LegoBuildingManager::LoadWorldInfo() { MxS32 i; LegoWorld* world = CurrentWorld(); diff --git a/LEGO1/lego/legoomni/src/common/legoplantmanager.cpp b/LEGO1/lego/legoomni/src/common/legoplantmanager.cpp index 723a3981..18d26315 100644 --- a/LEGO1/lego/legoomni/src/common/legoplantmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legoplantmanager.cpp @@ -424,6 +424,7 @@ MxU32 LegoPlantManager::GetSoundId(LegoEntity* p_entity, MxBool p_state) } // FUNCTION: LEGO1 0x10026be0 +// FUNCTION: BETA10 0x100c62bc void LegoPlantManager::SetCustomizeAnimFile(const char* p_value) { if (g_customizeAnimFile != NULL) { @@ -442,10 +443,60 @@ void LegoPlantManager::SetCustomizeAnimFile(const char* p_value) } } -// STUB: LEGO1 0x10026c50 -void LegoPlantManager::FUN_10026c50(LegoEntity* p_entity) +// FUNCTION: LEGO1 0x10026c50 +// FUNCTION: BETA10 0x100c6349 +MxBool LegoPlantManager::FUN_10026c50(LegoEntity* p_entity) { - // TODO + LegoPlantInfo* info = GetInfo(p_entity); + + if (info == NULL) { + return FALSE; + } + + return FUN_10026c80(info - g_plantInfo); +} + +// FUNCTION: LEGO1 0x10026c80 +// FUNCTION: BETA10 0x100c63eb +MxBool LegoPlantManager::FUN_10026c80(MxS32 p_index) +{ + if (p_index >= sizeOfArray(g_plantInfo)) { + return FALSE; + } + + LegoPlantInfo* info = &g_plantInfo[p_index]; + + if (info == NULL) { + return FALSE; + } + + MxBool result = TRUE; + + if (info->m_unk0x16 < 0) { + info->m_unk0x16 = g_unk0x100f16c0[info->m_variant]; + } + + if (info->m_unk0x16 > 0) { + LegoROI* roi = info->m_entity->GetROI(); + info->m_unk0x16--; + + if (info->m_unk0x16 == 1) { + info->m_unk0x16 = 0; + } + + if (info->m_unk0x16 == 0) { + roi->SetVisibility(FALSE); + } + else { + FUN_10026860(info - g_plantInfo); + info->m_entity->SetLocation(info->m_position, info->m_direction, info->m_up, FALSE); + } + } + else { + result = FALSE; + } + + return result; } // STUB: LEGO1 0x10026e00 diff --git a/LEGO1/lego/legoomni/src/entity/legoworld.cpp b/LEGO1/lego/legoomni/src/entity/legoworld.cpp index de9c3c63..b7fd9aab 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworld.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworld.cpp @@ -694,7 +694,7 @@ void LegoWorld::Enable(MxBool p_enable) if (m_worldId != -1) { PlantManager()->LoadWorldInfo(m_worldId); AnimationManager()->LoadWorldInfo(m_worldId); - BuildingManager()->FUN_1002fa00(); + BuildingManager()->LoadWorldInfo(); AnimationManager()->Resume(); } diff --git a/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp b/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp index 37488092..070f05e6 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp @@ -57,7 +57,7 @@ LegoWorldPresenter::~LegoWorldPresenter() MxS32 worldId = ((LegoWorld*) m_entity)->GetWorldId(); PlantManager()->LoadWorldInfo(worldId); AnimationManager()->LoadWorldInfo(worldId); - BuildingManager()->FUN_1002fa00(); + BuildingManager()->LoadWorldInfo(); result = ((LegoWorld*) m_entity)->VTable0x5c(); } diff --git a/LEGO1/lego/legoomni/src/worlds/elevatorbottom.cpp b/LEGO1/lego/legoomni/src/worlds/elevatorbottom.cpp index 768f5333..30a33b03 100644 --- a/LEGO1/lego/legoomni/src/worlds/elevatorbottom.cpp +++ b/LEGO1/lego/legoomni/src/worlds/elevatorbottom.cpp @@ -135,7 +135,7 @@ void ElevatorBottom::Enable(MxBool p_enable) // FUNCTION: LEGO1 0x10018310 MxBool ElevatorBottom::Escape() { - DeleteObjects(&m_atom, 500, 999); + DeleteObjects(&m_atom, ElevbottScript::c_iica31in_PlayWav, 999); m_destLocation = LegoGameState::e_infomain; return TRUE; } diff --git a/LEGO1/lego/legoomni/src/worlds/infocenterdoor.cpp b/LEGO1/lego/legoomni/src/worlds/infocenterdoor.cpp index 0673de11..f2812ecf 100644 --- a/LEGO1/lego/legoomni/src/worlds/infocenterdoor.cpp +++ b/LEGO1/lego/legoomni/src/worlds/infocenterdoor.cpp @@ -95,7 +95,7 @@ MxLong InfocenterDoor::HandleControl(LegoControlManagerNotificationParam& p_para MxLong result = 0; if (p_param.GetUnknown0x28() == 1) { - DeleteObjects(&m_atom, 500, 510); + DeleteObjects(&m_atom, InfodoorScript::c_iic037in_PlayWav, 510); switch (p_param.GetClickedObjectId()) { case InfodoorScript::c_LeftArrow_Ctl: @@ -167,7 +167,7 @@ void InfocenterDoor::Enable(MxBool p_enable) // FUNCTION: LEGO1 0x10037cd0 MxBool InfocenterDoor::Escape() { - DeleteObjects(&m_atom, 500, 510); + DeleteObjects(&m_atom, InfodoorScript::c_iic037in_PlayWav, 510); m_destLocation = LegoGameState::e_infomain; return TRUE; }