diff options
author | Torbjörn Andersson | 2007-04-01 14:05:50 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2007-04-01 14:05:50 +0000 |
commit | 0d78a7ca640c350c56ef7b36e75e1336f9b42d19 (patch) | |
tree | 6ebe74fcc77ca4f896e05b2820cc0facad3bae41 /engines/touche/ui.cpp | |
parent | b4211fefc8bb9a1a395f9685bbb5bc897d191b01 (diff) | |
download | scummvm-rg350-0d78a7ca640c350c56ef7b36e75e1336f9b42d19.tar.gz scummvm-rg350-0d78a7ca640c350c56ef7b36e75e1336f9b42d19.tar.bz2 scummvm-rg350-0d78a7ca640c350c56ef7b36e75e1336f9b42d19.zip |
Call updateScreen() more often in options/save/load dialog to keep mouse
movement smoother. And since this is potentially wasteful, only redraw the
entire dialog when it seems likely that it may have changed.
svn-id: r26348
Diffstat (limited to 'engines/touche/ui.cpp')
-rw-r--r-- | engines/touche/ui.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/engines/touche/ui.cpp b/engines/touche/ui.cpp index ac5cee7f6e..11da58d75f 100644 --- a/engines/touche/ui.cpp +++ b/engines/touche/ui.cpp @@ -360,8 +360,10 @@ void ToucheEngine::handleOptions(int forceDisplay) { menuData.exit = false; menuData.mode = kMenuSettingsMode; int curMode = -1; + bool doRedraw = false; while (!menuData.quit) { if (menuData.mode != curMode) { + doRedraw = true; setupMenu(menuData.mode, &menuData); curMode = menuData.mode; if (menuData.mode == kMenuLoadStateMode || menuData.mode == kMenuSaveStateMode) { @@ -376,7 +378,6 @@ void ToucheEngine::handleOptions(int forceDisplay) { } } } - redrawMenu(&menuData); Common::Event event; Common::EventManager *eventMan = _system->getEventManager(); while (eventMan->pollEvent(event)) { @@ -391,6 +392,7 @@ void ToucheEngine::handleOptions(int forceDisplay) { button = menuData.findButtonUnderCursor(event.mouse.x, event.mouse.y); if (button) { handleMenuAction(&menuData, button->action); + doRedraw = true; } break; case Common::EVENT_KEYDOWN: @@ -400,21 +402,28 @@ void ToucheEngine::handleOptions(int forceDisplay) { } else { menuData.addCharToDescription(_saveLoadCurrentSlot, (char)event.kbd.ascii); } + doRedraw = true; } break; case Common::EVENT_WHEELUP: handleMenuAction(&menuData, kActionScrollUpSaves); + doRedraw = true; break; case Common::EVENT_WHEELDOWN: handleMenuAction(&menuData, kActionScrollDownSaves); + doRedraw = true; break; default: break; } } - updateScreenArea(90, 102, 460, 196); + if (doRedraw) { + redrawMenu(&menuData); + updateScreenArea(90, 102, 460, 196); + doRedraw = false; + } _system->updateScreen(); - _system->delayMillis(50); + _system->delayMillis(10); } _fullRedrawCounter = 2; if (!menuData.exit && _flagsTable[611] != 0) { |