diff --git a/LEGO1/lego/legoomni/include/legoeventnotificationparam.h b/LEGO1/lego/legoomni/include/legoeventnotificationparam.h index cdd771e3..2499454f 100644 --- a/LEGO1/lego/legoomni/include/legoeventnotificationparam.h +++ b/LEGO1/lego/legoomni/include/legoeventnotificationparam.h @@ -13,10 +13,10 @@ class LegoROI; class LegoEventNotificationParam : public MxNotificationParam { public: enum { - c_lButtonState = 0x01, - c_rButtonState = 0x02, - c_modKey1 = 0x04, - c_modKey2 = 0x08, + c_lButtonState = 1, + c_rButtonState = 2, + c_modKey1 = 4, + c_modKey2 = 8, }; // FUNCTION: LEGO1 0x10028690 diff --git a/LEGO1/lego/legoomni/include/legonotify.h b/LEGO1/lego/legoomni/include/legonotify.h deleted file mode 100644 index ed4218b2..00000000 --- a/LEGO1/lego/legoomni/include/legonotify.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef LEGONOTIFY_H -#define LEGONOTIFY_H - -enum LegoEventNotificationParamType { - c_lButtonState = 1, - c_rButtonState = 2, - c_modKey1 = 4, - c_modKey2 = 8, -}; - -#endif // LEGONOTIFY_H diff --git a/LEGO1/lego/legoomni/include/legoutils.h b/LEGO1/lego/legoomni/include/legoutils.h index 118b6c1d..09e2d72e 100644 --- a/LEGO1/lego/legoomni/include/legoutils.h +++ b/LEGO1/lego/legoomni/include/legoutils.h @@ -7,6 +7,23 @@ #include +#define WM_ISLE_SETCURSOR 0x5400 + +enum Cursor { + e_cursorArrow = 0, + e_cursorBusy, + e_cursorNo, + e_cursorUnused3, + e_cursorUnused4, + e_cursorUnused5, + e_cursorUnused6, + e_cursorUnused7, + e_cursorUnused8, + e_cursorUnused9, + e_cursorUnused10, + e_cursorNone +}; + class MxAtomId; class LegoEntity; class LegoFile; @@ -28,7 +45,7 @@ void PlayCamAnim(LegoPathActor* p_actor, MxBool p_unused, MxU32 p_location, MxBo void FUN_1003eda0(); MxBool RemoveFromCurrentWorld(const MxAtomId& p_atomId, MxS32 p_id); void FUN_1003ef00(MxBool p_enable); -void SetAppCursor(WPARAM p_wparam); +void SetAppCursor(Cursor p_cursor); MxBool FUN_1003ef60(); MxBool RemoveFromWorld(MxAtomId& p_entityAtom, MxS32 p_entityId, MxAtomId& p_worldAtom, MxS32 p_worldEntityId); MxS32 UpdateLightPosition(MxS32 p_increase); diff --git a/LEGO1/lego/legoomni/src/common/legoutils.cpp b/LEGO1/lego/legoomni/src/common/legoutils.cpp index 60d96755..62783224 100644 --- a/LEGO1/lego/legoomni/src/common/legoutils.cpp +++ b/LEGO1/lego/legoomni/src/common/legoutils.cpp @@ -449,9 +449,9 @@ void FUN_1003ef00(MxBool p_enable) } // FUNCTION: LEGO1 0x1003ef40 -void SetAppCursor(WPARAM p_wparam) +void SetAppCursor(Cursor p_cursor) { - PostMessageA(MxOmni::GetInstance()->GetWindowHandle(), 0x5400, p_wparam, 0); + PostMessageA(MxOmni::GetInstance()->GetWindowHandle(), WM_ISLE_SETCURSOR, p_cursor, 0); } // FUNCTION: LEGO1 0x1003ef60 diff --git a/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp b/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp index 90a37ef2..bb252592 100644 --- a/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp @@ -124,7 +124,7 @@ MxResult MxTransitionManager::StartTransition( LegoVideoManager* videoManager = VideoManager(); videoManager->SetRender3D(FALSE); - SetAppCursor(1); + SetAppCursor(e_cursorBusy); return SUCCESS; } return FAILURE; diff --git a/LEGO1/lego/legoomni/src/entity/legocameracontroller.cpp b/LEGO1/lego/legoomni/src/entity/legocameracontroller.cpp index da455eab..b07bb02a 100644 --- a/LEGO1/lego/legoomni/src/entity/legocameracontroller.cpp +++ b/LEGO1/lego/legoomni/src/entity/legocameracontroller.cpp @@ -2,7 +2,6 @@ #include "3dmanager/lego3dmanager.h" #include "legoinputmanager.h" -#include "legonotify.h" #include "legosoundmanager.h" #include "legovideomanager.h" #include "misc.h" @@ -109,10 +108,10 @@ void LegoCameraController::OnRButtonUp(MxPoint32 p_point) // FUNCTION: LEGO1 0x10012230 void LegoCameraController::OnMouseMove(MxU8 p_modifier, MxPoint32 p_point) { - if (p_modifier & c_lButtonState) { + if (p_modifier & LegoEventNotificationParam::c_lButtonState) { LeftDrag(p_point.GetX(), p_point.GetY()); } - else if (p_modifier & c_rButtonState) { + else if (p_modifier & LegoEventNotificationParam::c_rButtonState) { RightDrag(p_point.GetX(), p_point.GetY()); } } diff --git a/LEGO1/lego/legoomni/src/entity/legoworld.cpp b/LEGO1/lego/legoomni/src/entity/legoworld.cpp index 5d4dcd00..71ffefae 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworld.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworld.cpp @@ -766,7 +766,7 @@ MxResult LegoWorld::Tickle() switch (m_startupTicks) { case e_start: m_worldStarted = TRUE; - SetAppCursor(0); + SetAppCursor(e_cursorArrow); ReadyWorld(); return TRUE; case e_two: diff --git a/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp b/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp index c5526864..1cd0aba3 100644 --- a/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp +++ b/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp @@ -340,7 +340,7 @@ MxBool LegoInputManager::ProcessOneEvent(LegoEventNotificationParam& p_param) if (m_unk0x335 != 0) { if (p_param.GetType() == c_notificationButtonDown) { - LegoEventNotificationParam notification(c_notificationKeyPress, NULL, 0, 0, 0, ' '); + LegoEventNotificationParam notification(c_notificationKeyPress, NULL, 0, 0, 0, VK_SPACE); LegoNotifyListCursor cursor(m_keyboardNotifyList); MxCore* target; diff --git a/LEGO1/lego/legoomni/src/main/legomain.cpp b/LEGO1/lego/legoomni/src/main/legomain.cpp index 7b559faa..ba6d7d84 100644 --- a/LEGO1/lego/legoomni/src/main/legomain.cpp +++ b/LEGO1/lego/legoomni/src/main/legomain.cpp @@ -254,7 +254,7 @@ MxResult LegoOmni::Create(MxOmniCreateParam& p_param) } m_notificationManager->Register(this); - SetAppCursor(1); + SetAppCursor(e_cursorBusy); m_gameState->SetCurrentAct(LegoGameState::e_act1); result = SUCCESS; @@ -582,12 +582,12 @@ MxLong LegoOmni::Notify(MxParam& p_param) void LegoOmni::StartTimer() { MxOmni::StartTimer(); - SetAppCursor(2); + SetAppCursor(e_cursorNo); } // FUNCTION: LEGO1 0x1005b650 void LegoOmni::StopTimer() { MxOmni::StopTimer(); - SetAppCursor(0); + SetAppCursor(e_cursorArrow); } diff --git a/LEGO1/lego/legoomni/src/worlds/infocenter.cpp b/LEGO1/lego/legoomni/src/worlds/infocenter.cpp index 942551bd..8308cf11 100644 --- a/LEGO1/lego/legoomni/src/worlds/infocenter.cpp +++ b/LEGO1/lego/legoomni/src/worlds/infocenter.cpp @@ -57,7 +57,7 @@ Infocenter::Infocenter() memset(&m_mapAreas, 0, sizeof(m_mapAreas)); m_unk0x1c8 = -1; - SetAppCursor(1); + SetAppCursor(e_cursorBusy); NotificationManager()->Register(this); m_infoManDialogueTimer = 0; @@ -1183,7 +1183,7 @@ void Infocenter::PlayCutscene(Cutscene p_entityId, MxBool p_scale) VideoManager()->EnableFullScreenMovie(TRUE, p_scale); InputManager()->SetUnknown336(TRUE); InputManager()->SetUnknown335(TRUE); - SetAppCursor(0xb); // Hide cursor + SetAppCursor(e_cursorNone); VideoManager()->GetDisplaySurface()->ClearScreen(); if (m_currentCutscene != e_noIntro) { @@ -1205,7 +1205,7 @@ void Infocenter::StopCutscene() VideoManager()->EnableFullScreenMovie(FALSE); InputManager()->SetUnknown335(FALSE); - SetAppCursor(0); // Restore cursor to arrow + SetAppCursor(e_cursorArrow); FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); } @@ -1405,7 +1405,7 @@ void Infocenter::StartCredits() GetViewManager()->RemoveAll(NULL); InvokeAction(Extra::e_opendisk, *g_creditsScript, CreditsScript::c_LegoCredits, NULL); - SetAppCursor(0); + SetAppCursor(e_cursorArrow); } // FUNCTION: LEGO1 0x10071250 diff --git a/LEGO1/lego/legoomni/src/worlds/isle.cpp b/LEGO1/lego/legoomni/src/worlds/isle.cpp index f99cf6fc..78d05c70 100644 --- a/LEGO1/lego/legoomni/src/worlds/isle.cpp +++ b/LEGO1/lego/legoomni/src/worlds/isle.cpp @@ -816,7 +816,7 @@ void Isle::Enable(MxBool p_enable) break; } - SetAppCursor(0); + SetAppCursor(e_cursorArrow); if (m_act1state->m_unk0x018 != 8 && (m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_elevride) && @@ -952,7 +952,7 @@ MxLong Isle::HandleTransitionEnd() VariableTable()->SetVariable("VISIBILITY", "Show Gas"); AnimationManager()->Resume(); FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); - SetAppCursor(0); + SetAppCursor(e_cursorArrow); SetIsWorldActive(TRUE); break; case LegoGameState::e_unk33: @@ -962,7 +962,7 @@ MxLong Isle::HandleTransitionEnd() VariableTable()->SetVariable("VISIBILITY", "Show Policsta"); AnimationManager()->Resume(); FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); - SetAppCursor(0); + SetAppCursor(e_cursorArrow); SetIsWorldActive(TRUE); break; case LegoGameState::e_polidoor: @@ -1073,7 +1073,7 @@ void Isle::FUN_10032d30( } FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); - SetAppCursor(0); + SetAppCursor(e_cursorArrow); m_destLocation = LegoGameState::e_undefined; m_act1state->m_unk0x01f = FALSE; }