diff options
author | Oystein Eftevaag | 2006-03-19 05:55:26 +0000 |
---|---|---|
committer | Oystein Eftevaag | 2006-03-19 05:55:26 +0000 |
commit | e636a25a3313da26225e0f5518a67f54092e78e1 (patch) | |
tree | 0aa02962d3e408c10b69b7d666d66ad0b1695f7a /engines | |
parent | 6632a4df53bd6cd94d85057ceae10f14108a67e4 (diff) | |
download | scummvm-rg350-e636a25a3313da26225e0f5518a67f54092e78e1.tar.gz scummvm-rg350-e636a25a3313da26225e0f5518a67f54092e78e1.tar.bz2 scummvm-rg350-e636a25a3313da26225e0f5518a67f54092e78e1.zip |
Adds button press animations to the menu, and resets the cursor when the Dialog of Death pops up. Also, mouse clicks are now registered on button up instead of button down, as in the original
svn-id: r21377
Diffstat (limited to 'engines')
-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; |