Merge remote-tracking branch 'isle/master'

This commit is contained in:
Christian Semmler 2025-07-06 08:29:53 -07:00
commit 1ee2f45e7c
No known key found for this signature in database
GPG Key ID: 086DAA1360BEEE5C
9 changed files with 90 additions and 84 deletions

View File

@ -66,27 +66,33 @@ public:
return !strcmp(p_name, LegoControlManager::ClassName()) || MxCore::IsA(p_name);
}
void FUN_10028df0(MxPresenterList* p_presenterList);
void SetPresenterList(MxPresenterList* p_presenterList);
void Register(MxCore* p_listener);
void Unregister(MxCore* p_listener);
MxBool FUN_10029210(LegoEventNotificationParam& p_param, MxPresenter* p_presenter);
void FUN_100293c0(MxU32 p_objectId, const char* p_atom, MxS16 p_unk0x4e);
MxControlPresenter* FUN_100294e0(MxS32 p_x, MxS32 p_y);
MxBool FUN_10029630();
MxBool FUN_10029750();
void FUN_100292e0();
MxBool HandleButtonDown(LegoEventNotificationParam& p_param, MxPresenter* p_presenter);
void UpdateEnabledChild(MxU32 p_objectId, const char* p_atom, MxS16 p_enabledChild);
MxControlPresenter* GetControlAt(MxS32 p_x, MxS32 p_y);
MxBool HandleButtonDown();
MxBool HandleButtonUp();
void Notify();
undefined4 GetUnknown0x0c() { return m_unk0x0c; }
undefined GetUnknown0x10() { return m_unk0x10; }
MxU32 HandleUpNextTickle() { return m_handleUpNextTickle; }
MxBool IsSecondButtonDown() { return m_secondButtonDown; }
// SYNTHETIC: LEGO1 0x10028d40
// LegoControlManager::`scalar deleting destructor'
private:
undefined4 m_unk0x08; // 0x08
undefined4 m_unk0x0c; // 0x0c
MxBool m_unk0x10; // 0x10
MxPresenter* m_unk0x14; // 0x14
enum {
e_idle = 0,
e_waitNextTickle = 1,
e_tickled = 2,
};
MxU32 m_buttonDownState; // 0x08
MxU32 m_handleUpNextTickle; // 0x0c
MxBool m_secondButtonDown; // 0x10
MxPresenter* m_handledPresenter; // 0x14
LegoControlManagerNotificationParam m_event; // 0x18
MxPresenterList* m_presenterList; // 0x44
LegoNotifyList m_notifyList; // 0x48

View File

@ -22,8 +22,8 @@ class LegoCameraController;
class LegoControlManager;
class LegoWorld;
extern MxS32 g_unk0x100f31b0;
extern const char* g_unk0x100f31b4;
extern MxS32 g_clickedObjectId;
extern const char* g_clickedAtom;
// VTABLE: LEGO1 0x100d87b8
// class MxCollection<LegoEventNotificationParam>

View File

@ -47,7 +47,7 @@ public:
void ReadyTickle() override; // vtable+0x18
void ParseExtra() override; // vtable+0x30
MxResult FUN_1007ff70(MxDSChunk& p_chunk, LegoEntity* p_entity, MxBool p_roiVisible, LegoWorld* p_world);
MxResult CreateROI(MxDSChunk& p_chunk, LegoEntity* p_entity, MxBool p_roiVisible, LegoWorld* p_world);
void Reset()
{

View File

@ -17,10 +17,10 @@ DECOMP_SIZE_ASSERT(LegoEventNotificationParam, 0x20)
LegoControlManager::LegoControlManager()
{
m_presenterList = NULL;
m_unk0x08 = 0;
m_unk0x0c = 0;
m_unk0x10 = FALSE;
m_unk0x14 = NULL;
m_buttonDownState = e_idle;
m_handleUpNextTickle = 0;
m_secondButtonDown = FALSE;
m_handledPresenter = NULL;
TickleManager()->RegisterClient(this, 10);
}
@ -31,11 +31,11 @@ LegoControlManager::~LegoControlManager()
}
// FUNCTION: LEGO1 0x10028df0
void LegoControlManager::FUN_10028df0(MxPresenterList* p_presenterList)
void LegoControlManager::SetPresenterList(MxPresenterList* p_presenterList)
{
m_presenterList = p_presenterList;
g_unk0x100f31b0 = -1;
g_unk0x100f31b4 = NULL;
g_clickedObjectId = -1;
g_clickedAtom = NULL;
}
// FUNCTION: LEGO1 0x10028e10
@ -56,10 +56,10 @@ void LegoControlManager::Unregister(MxCore* p_listener)
}
// FUNCTION: LEGO1 0x10029210
MxBool LegoControlManager::FUN_10029210(LegoEventNotificationParam& p_param, MxPresenter* p_presenter)
MxBool LegoControlManager::HandleButtonDown(LegoEventNotificationParam& p_param, MxPresenter* p_presenter)
{
if (m_presenterList != NULL && m_presenterList->GetNumElements() != 0) {
m_unk0x14 = p_presenter;
m_handledPresenter = p_presenter;
if (p_param.GetNotification() == c_notificationButtonUp ||
p_param.GetNotification() == c_notificationButtonDown) {
@ -71,28 +71,28 @@ MxBool LegoControlManager::FUN_10029210(LegoEventNotificationParam& p_param, MxP
m_event.SetKey(p_param.GetKey());
if (p_param.GetNotification() == c_notificationButtonUp) {
if (m_unk0x10 == TRUE) {
m_unk0x10 = FALSE;
if (m_secondButtonDown == TRUE) {
m_secondButtonDown = FALSE;
return TRUE;
}
if (g_unk0x100f31b0 != -1 && g_unk0x100f31b4 != NULL) {
if (m_unk0x08 == 2) {
return FUN_10029750();
if (g_clickedObjectId != -1 && g_clickedAtom != NULL) {
if (m_buttonDownState == e_tickled) {
return HandleButtonUp();
}
else {
m_unk0x0c = 1;
m_handleUpNextTickle = 1;
return TRUE;
}
}
}
else if (p_param.GetNotification() == c_notificationButtonDown) {
if (m_unk0x0c == 1) {
m_unk0x10 = TRUE;
if (m_handleUpNextTickle == 1) {
m_secondButtonDown = TRUE;
return TRUE;
}
else {
return FUN_10029630();
return HandleButtonDown();
}
}
}
@ -100,15 +100,15 @@ MxBool LegoControlManager::FUN_10029210(LegoEventNotificationParam& p_param, MxP
return FALSE;
}
else {
g_unk0x100f31b0 = -1;
g_unk0x100f31b4 = NULL;
g_clickedObjectId = -1;
g_clickedAtom = NULL;
return FALSE;
}
}
// FUNCTION: LEGO1 0x100292e0
void LegoControlManager::FUN_100292e0()
void LegoControlManager::Notify()
{
LegoNotifyListCursor cursor(&m_notifyList);
MxCore* target;
@ -121,7 +121,7 @@ void LegoControlManager::FUN_100292e0()
}
// FUNCTION: LEGO1 0x100293c0
void LegoControlManager::FUN_100293c0(MxU32 p_objectId, const char* p_atom, MxS16 p_unk0x4e)
void LegoControlManager::UpdateEnabledChild(MxU32 p_objectId, const char* p_atom, MxS16 p_enabledChild)
{
if (m_presenterList) {
MxPresenterListCursor cursor(m_presenterList);
@ -131,11 +131,11 @@ void LegoControlManager::FUN_100293c0(MxU32 p_objectId, const char* p_atom, MxS1
MxDSAction* action = control->GetAction();
if (action->GetObjectId() == p_objectId && action->GetAtomId().GetInternal() == p_atom) {
((MxControlPresenter*) control)->UpdateEnabledChild(p_unk0x4e);
((MxControlPresenter*) control)->UpdateEnabledChild(p_enabledChild);
if (((MxControlPresenter*) control)->GetEnabledChild() == 0) {
g_unk0x100f31b0 = -1;
g_unk0x100f31b4 = NULL;
g_clickedObjectId = -1;
g_clickedAtom = NULL;
break;
}
}
@ -145,7 +145,7 @@ void LegoControlManager::FUN_100293c0(MxU32 p_objectId, const char* p_atom, MxS1
// FUNCTION: LEGO1 0x100294e0
// FUNCTION: BETA10 0x1007c92f
MxControlPresenter* LegoControlManager::FUN_100294e0(MxS32 p_x, MxS32 p_y)
MxControlPresenter* LegoControlManager::GetControlAt(MxS32 p_x, MxS32 p_y)
{
if (m_presenterList) {
MxPresenterListCursor cursor(m_presenterList);
@ -167,29 +167,29 @@ MxControlPresenter* LegoControlManager::FUN_100294e0(MxS32 p_x, MxS32 p_y)
// FUNCTION: LEGO1 0x10029600
MxResult LegoControlManager::Tickle()
{
if (m_unk0x08 == 2 && m_unk0x0c == 1) {
if (m_buttonDownState == e_tickled && m_handleUpNextTickle == 1) {
m_event.SetNotification(c_notificationButtonUp);
FUN_10029750();
HandleButtonUp();
return 0;
}
else if (m_unk0x08 == 1) {
m_unk0x08 = 2;
else if (m_buttonDownState == e_waitNextTickle) {
m_buttonDownState = e_tickled;
}
return 0;
}
// FUNCTION: LEGO1 0x10029630
MxBool LegoControlManager::FUN_10029630()
MxBool LegoControlManager::HandleButtonDown()
{
MxPresenterListCursor cursor(m_presenterList);
MxPresenter* presenter;
while (cursor.Next(presenter)) {
if (((MxControlPresenter*) presenter)->Notify(&m_event, m_unk0x14)) {
g_unk0x100f31b0 = m_event.m_clickedObjectId;
g_unk0x100f31b4 = m_event.GetClickedAtom();
FUN_100292e0();
m_unk0x08 = 1;
if (((MxControlPresenter*) presenter)->Notify(&m_event, m_handledPresenter)) {
g_clickedObjectId = m_event.m_clickedObjectId;
g_clickedAtom = m_event.GetClickedAtom();
Notify();
m_buttonDownState = e_waitNextTickle;
return TRUE;
}
}
@ -198,29 +198,29 @@ MxBool LegoControlManager::FUN_10029630()
}
// FUNCTION: LEGO1 0x10029750
MxBool LegoControlManager::FUN_10029750()
MxBool LegoControlManager::HandleButtonUp()
{
MxPresenterListCursor cursor(m_presenterList);
MxPresenter* presenter;
while (cursor.Next(presenter)) {
if (presenter->GetAction() && presenter->GetAction()->GetObjectId() == g_unk0x100f31b0 &&
presenter->GetAction()->GetAtomId().GetInternal() == g_unk0x100f31b4) {
if (((MxControlPresenter*) presenter)->Notify(&m_event, m_unk0x14)) {
FUN_100292e0();
if (presenter->GetAction() && presenter->GetAction()->GetObjectId() == g_clickedObjectId &&
presenter->GetAction()->GetAtomId().GetInternal() == g_clickedAtom) {
if (((MxControlPresenter*) presenter)->Notify(&m_event, m_handledPresenter)) {
Notify();
}
g_unk0x100f31b0 = -1;
g_unk0x100f31b4 = NULL;
g_clickedObjectId = -1;
g_clickedAtom = NULL;
m_unk0x08 = 0;
m_unk0x0c = 0;
m_buttonDownState = e_idle;
m_handleUpNextTickle = 0;
return TRUE;
}
}
g_unk0x100f31b0 = -1;
g_unk0x100f31b4 = NULL;
g_clickedObjectId = -1;
g_clickedAtom = NULL;
return FALSE;
}

View File

@ -83,7 +83,7 @@ MxResult LegoWorld::Create(MxDSAction& p_dsAction)
}
SetCurrentWorld(this);
ControlManager()->FUN_10028df0(&m_controlPresenters);
ControlManager()->SetPresenterList(&m_controlPresenters);
}
SetIsWorldActive(TRUE);
@ -98,7 +98,7 @@ void LegoWorld::Destroy(MxBool p_fromDestructor)
m_destroyed = TRUE;
if (CurrentWorld() == this) {
ControlManager()->FUN_10028df0(NULL);
ControlManager()->SetPresenterList(NULL);
SetCurrentWorld(NULL);
}
@ -724,7 +724,7 @@ void LegoWorld::Enable(MxBool p_enable)
}
SetCurrentWorld(this);
ControlManager()->FUN_10028df0(&m_controlPresenters);
ControlManager()->SetPresenterList(&m_controlPresenters);
InputManager()->SetCamera(m_cameraController);
if (m_cameraController) {
@ -781,7 +781,7 @@ void LegoWorld::Enable(MxBool p_enable)
}
if (CurrentWorld() && CurrentWorld() == this) {
ControlManager()->FUN_10028df0(NULL);
ControlManager()->SetPresenterList(NULL);
Lego()->SetCurrentWorld(NULL);
}

View File

@ -393,7 +393,7 @@ MxResult LegoWorldPresenter::LoadWorldModel(ModelDbModel& p_model, SDL_IOStream*
}
modelPresenter.SetAction(&action);
modelPresenter.FUN_1007ff70(chunk, createdEntity, p_model.m_visible, p_world);
modelPresenter.CreateROI(chunk, createdEntity, p_model.m_visible, p_world);
delete[] buff;
return SUCCESS;

View File

@ -17,10 +17,10 @@ DECOMP_SIZE_ASSERT(LegoNotifyListCursor, 0x10)
DECOMP_SIZE_ASSERT(LegoEventQueue, 0x18)
// GLOBAL: LEGO1 0x100f31b0
MxS32 g_unk0x100f31b0 = -1;
MxS32 g_clickedObjectId = -1;
// GLOBAL: LEGO1 0x100f31b4
const char* g_unk0x100f31b4 = NULL;
const char* g_clickedAtom = NULL;
// GLOBAL: LEGO1 0x100f67b8
MxBool g_unk0x100f67b8 = TRUE;
@ -354,23 +354,23 @@ MxBool LegoInputManager::ProcessOneEvent(LegoEventNotificationParam& p_param)
if (presenter->GetDisplayZ() < 0) {
processRoi = FALSE;
if (m_controlManager->FUN_10029210(p_param, presenter)) {
if (m_controlManager->HandleButtonDown(p_param, presenter)) {
return TRUE;
}
}
else {
LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY());
if (roi == NULL && m_controlManager->FUN_10029210(p_param, presenter)) {
if (roi == NULL && m_controlManager->HandleButtonDown(p_param, presenter)) {
return TRUE;
}
}
}
}
else if (p_param.GetNotification() == c_notificationButtonUp) {
if (g_unk0x100f31b0 != -1 || m_controlManager->GetUnknown0x10() ||
m_controlManager->GetUnknown0x0c() == 1) {
MxBool result = m_controlManager->FUN_10029210(p_param, NULL);
if (g_clickedObjectId != -1 || m_controlManager->IsSecondButtonDown() ||
m_controlManager->HandleUpNextTickle() == 1) {
MxBool result = m_controlManager->HandleButtonDown(p_param, NULL);
StopAutoDragTimer();
m_unk0x80 = FALSE;
@ -522,8 +522,8 @@ void LegoInputManager::StopAutoDragTimer()
void LegoInputManager::EnableInputProcessing()
{
m_unk0x88 = FALSE;
g_unk0x100f31b0 = -1;
g_unk0x100f31b4 = NULL;
g_clickedObjectId = -1;
g_clickedAtom = NULL;
}
MxResult LegoInputManager::GetNavigationTouchStates(MxU32& p_keyStates)

View File

@ -197,7 +197,7 @@ done:
// FUNCTION: LEGO1 0x1007ff70
// FUNCTION: BETA10 0x10099061
MxResult LegoModelPresenter::FUN_1007ff70(
MxResult LegoModelPresenter::CreateROI(
MxDSChunk& p_chunk,
LegoEntity* p_entity,
MxBool p_roiVisible,

View File

@ -342,7 +342,7 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
}
if (action->GetObjectId() == InfomainScript::c_iicx26in_RunAnim - Lego()->IsVersion10()) {
ControlManager()->FUN_100293c0(InfomainScript::c_BigInfo_Ctl, action->GetAtomId().GetInternal(), 0);
ControlManager()->UpdateEnabledChild(InfomainScript::c_BigInfo_Ctl, action->GetAtomId().GetInternal(), 0);
m_unk0x1d6 = 0;
}
@ -754,7 +754,7 @@ MxLong Infocenter::HandleKeyPress(SDL_Keycode p_key)
MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
{
if (m_dragPresenter) {
MxControlPresenter* control = InputManager()->GetControlManager()->FUN_100294e0(p_x - 1, p_y - 1);
MxControlPresenter* control = InputManager()->GetControlManager()->GetControlAt(p_x - 1, p_y - 1);
switch (m_dragPresenter->GetAction()->GetObjectId()) {
case InfomainScript::c_PepperHot_Bitmap:
@ -1243,16 +1243,16 @@ MxResult Infocenter::Tickle()
m_unk0x1d6 += 100;
if (m_unk0x1d6 > 3400 && m_unk0x1d6 < 3650) {
ControlManager()->FUN_100293c0(InfomainScript::c_BigInfo_Ctl, m_atomId.GetInternal(), 1);
ControlManager()->UpdateEnabledChild(InfomainScript::c_BigInfo_Ctl, m_atomId.GetInternal(), 1);
}
else if (m_unk0x1d6 > 3650 && m_unk0x1d6 < 3900) {
ControlManager()->FUN_100293c0(InfomainScript::c_BigInfo_Ctl, m_atomId.GetInternal(), 0);
ControlManager()->UpdateEnabledChild(InfomainScript::c_BigInfo_Ctl, m_atomId.GetInternal(), 0);
}
else if (m_unk0x1d6 > 3900 && m_unk0x1d6 < 4150) {
ControlManager()->FUN_100293c0(InfomainScript::c_BigInfo_Ctl, m_atomId.GetInternal(), 1);
ControlManager()->UpdateEnabledChild(InfomainScript::c_BigInfo_Ctl, m_atomId.GetInternal(), 1);
}
else if (m_unk0x1d6 > 4400) {
ControlManager()->FUN_100293c0(InfomainScript::c_BigInfo_Ctl, m_atomId.GetInternal(), 0);
ControlManager()->UpdateEnabledChild(InfomainScript::c_BigInfo_Ctl, m_atomId.GetInternal(), 0);
m_unk0x1d6 = 0;
}
}