diff options
-rw-r--r-- | engines/kyra/gui.cpp | 19 | ||||
-rw-r--r-- | engines/kyra/kyra.cpp | 8 |
2 files changed, 20 insertions, 7 deletions
diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp index b386fb65da..d201d0fcd3 100644 --- a/engines/kyra/gui.cpp +++ b/engines/kyra/gui.cpp @@ -251,7 +251,9 @@ void KyraEngine::processButtonList(Button *list) { if (_mousePressFlag) { if (!(list->flags2 & 1)) { list->flags2 |= 1; + list->flags2 |= 4; processButton(list); + _screen->updateScreen(); } } else { if (list->flags2 & 1) { @@ -276,6 +278,11 @@ void KyraEngine::processButtonList(Button *list) { list->flags2 &= 0xFFFE; processButton(list); } + if (list->flags2 & 4) { + list->flags2 &= 0xFFFB; + processButton(list); + _screen->updateScreen(); + } list = list->nextButton; continue; } @@ -353,8 +360,6 @@ void KyraEngine::processMenuButton(Button *button) { if (!_displayMenu) return; - //_screen->hideMouse(); - if ( !button || (button->flags & 8)) return; @@ -374,7 +379,6 @@ void KyraEngine::processMenuButton(Button *button) { processButton(button); - //_screen->showMouse(); } int KyraEngine::drawBoxCallback(Button *button) { @@ -426,7 +430,8 @@ int KyraEngine::buttonMenuCallback(Button *caller) { _menuRestoreScreen = true; _keyboardEvent.pending = 0; _keyboardEvent.repeat = 0; - + _mousePressFlag = false; + _toplevelMenu = 0; if (_menuDirectlyToLoad) gui_loadGameMenu(0); @@ -569,16 +574,18 @@ void KyraEngine::gui_getInput() { OSystem::Event event; uint32 now = _system->getMillis(); - _mousePressFlag = false; _mouseWheel = 0; while (_system->pollEvent(event)) { switch (event.type) { case OSystem::EVENT_QUIT: quitGame(); break; - case OSystem::EVENT_LBUTTONUP: + case OSystem::EVENT_LBUTTONDOWN: _mousePressFlag = true; break; + case OSystem::EVENT_LBUTTONUP: + _mousePressFlag = false; + break; case OSystem::EVENT_MOUSEMOVE: _mouseX = event.mouse.x; _mouseY = event.mouse.y; diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp index f41ef760ed..e2f28cd8b8 100644 --- a/engines/kyra/kyra.cpp +++ b/engines/kyra/kyra.cpp @@ -683,6 +683,10 @@ void KyraEngine::mainLoop() { _deathHandler = 0xFF; snd_playWanderScoreViaMap(0, 1); snd_playSoundEffect(49); + _screen->hideMouse(); + _screen->setMouseCursor(1, 1, _shapes[4]); + destroyMouseItem(); + _screen->showMouse(); buttonMenuCallback(0); } @@ -727,7 +731,6 @@ void KyraEngine::delay(uint32 amount, bool update, bool isMainLoop) { char saveLoadSlot[20]; char savegameName[14]; - _mousePressFlag = false; uint32 start = _system->getMillis(); do { while (_system->pollEvent(event)) { @@ -765,6 +768,9 @@ void KyraEngine::delay(uint32 amount, bool update, bool isMainLoop) { break; case OSystem::EVENT_LBUTTONDOWN: _mousePressFlag = true; + break; + case OSystem::EVENT_LBUTTONUP: + _mousePressFlag = false; if (_abortWalkFlag2) { _abortWalkFlag = true; _mouseX = event.mouse.x; |