From b07caec28964bcda2a880cd774a10876ce6da45d Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Fri, 24 May 2024 13:08:35 -0400 Subject: [PATCH] Implement/match Isle::UpdateGlobe --- LEGO1/lego/legoomni/include/isle.h | 2 +- LEGO1/lego/legoomni/src/worlds/isle.cpp | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/LEGO1/lego/legoomni/include/isle.h b/LEGO1/lego/legoomni/include/isle.h index ae7e1af7..425680b5 100644 --- a/LEGO1/lego/legoomni/include/isle.h +++ b/LEGO1/lego/legoomni/include/isle.h @@ -66,7 +66,7 @@ class Isle : public LegoWorld { MxLong HandleType19Notification(MxParam& p_param); MxLong HandleTransitionEnd(); void HandleElevatorEndAction(); - void FUN_10031590(); + void UpdateGlobe(); void FUN_10032620(); void FUN_100330e0(); void FUN_10033350(); diff --git a/LEGO1/lego/legoomni/src/worlds/isle.cpp b/LEGO1/lego/legoomni/src/worlds/isle.cpp index a1bbe9aa..21aeb3dd 100644 --- a/LEGO1/lego/legoomni/src/worlds/isle.cpp +++ b/LEGO1/lego/legoomni/src/worlds/isle.cpp @@ -399,15 +399,15 @@ MxLong Isle::HandleClick(LegoControlManagerEvent& p_param) Start(&action); break; case IsleScript::c_Observe_RCab_Ctl: - FUN_10031590(); + UpdateGlobe(); break; case IsleScript::c_Observe_GlobeLArrow_Ctl: UpdateLightPosition(-1); - FUN_10031590(); + UpdateGlobe(); break; case IsleScript::c_Observe_GlobeRArrow_Ctl: UpdateLightPosition(1); - FUN_10031590(); + UpdateGlobe(); break; case IsleScript::c_Observe_Draw1_Ctl: case IsleScript::c_Observe_Draw2_Ctl: @@ -443,10 +443,18 @@ MxLong Isle::HandleClick(LegoControlManagerEvent& p_param) return 0; } -// STUB: LEGO1 0x10031590 -void Isle::FUN_10031590() +// FUNCTION: LEGO1 0x10031590 +void Isle::UpdateGlobe() { - // TODO + MxS32 lightPosition = atoi(VariableTable()->GetVariable("lightposition")); + + for (MxS32 i = 0; i < 6; i++) { + MxStillPresenter* presenter = (MxStillPresenter*) Find(*g_isleScript, IsleScript::c_Observe_Globe1_Bitmap + i); + + if (presenter != NULL) { + presenter->Enable(i == lightPosition); + } + } } // STUB: LEGO1 0x100315f0