diff options
author | Johannes Schickel | 2006-10-08 20:37:39 +0000 |
---|---|---|
committer | Johannes Schickel | 2006-10-08 20:37:39 +0000 |
commit | ab7bced4fd3233ee3d347712789ac4921dda1af2 (patch) | |
tree | 7fc3271ce8b1c7c4d773eeba99fff9328554417a /gui | |
parent | cfe6d9725cfbba51fa5593b805cb617cb20f3b03 (diff) | |
download | scummvm-rg350-ab7bced4fd3233ee3d347712789ac4921dda1af2.tar.gz scummvm-rg350-ab7bced4fd3233ee3d347712789ac4921dda1af2.tar.bz2 scummvm-rg350-ab7bced4fd3233ee3d347712789ac4921dda1af2.zip |
Final fix for wrong cursor palettes in SCUMM games after using the GUI.
svn-id: r24233
Diffstat (limited to 'gui')
-rw-r--r-- | gui/newgui.cpp | 36 | ||||
-rw-r--r-- | gui/newgui.h | 2 |
2 files changed, 24 insertions, 14 deletions
diff --git a/gui/newgui.cpp b/gui/newgui.cpp index 71c50721cc..516bd0d1ab 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -86,6 +86,7 @@ void GuiObject::reflowLayout() { NewGui::NewGui() : _needRedraw(false), _stateIsSaved(false), _cursorAnimateCounter(0), _cursorAnimateTimer(0) { _theme = 0; + _useStdCursor = false; _system = g_system; _lastScreenChangeID = _system->getScreenChangeID(); @@ -126,6 +127,15 @@ bool NewGui::loadNewTheme(const Common::String &style) { Common::ConfigFile cfg; Common::String oldTheme = (_theme != 0) ? _theme->getStylefileName() : ""; + + if (_theme) + _theme->disable(); + + if (_useStdCursor) { + PaletteMan.popCursorPalette(); + CursorMan.popCursor(); + } + delete _theme; if (style.compareToIgnoreCase("classic (builtin)") == 0) { @@ -205,12 +215,11 @@ void NewGui::runLoop() { saveState(); _theme->enable(); didSaveState = true; - } - bool useStandardCurs = !_theme->ownCursor(); - - if (useStandardCurs) - setupCursor(); + _useStdCursor = !_theme->ownCursor(); + if (_useStdCursor) + setupCursor(); + } while (!_dialogStack.empty() && activeDialog == _dialogStack.top()) { if (_needRedraw) { @@ -223,7 +232,7 @@ void NewGui::runLoop() { activeDialog->handleTickle(); - if (useStandardCurs) + if (_useStdCursor) animateCursor(); _theme->drawAll(); _system->updateScreen(); @@ -240,12 +249,9 @@ void NewGui::runLoop() { // HACK to change the cursor to the new themes one if (_themeChange) { _theme->enable(); - PaletteMan.popCursorPalette(); - - CursorMan.popCursor(); - useStandardCurs = !_theme->ownCursor(); - if (useStandardCurs) + _useStdCursor = !_theme->ownCursor(); + if (_useStdCursor) setupCursor(); _theme->refresh(); @@ -325,12 +331,11 @@ void NewGui::runLoop() { } _theme->closeDialog(); - if (useStandardCurs) - PaletteMan.popCursorPalette(); if (didSaveState) { _theme->disable(); restoreState(); + _useStdCursor = false; } } @@ -347,7 +352,10 @@ void NewGui::saveState() { } void NewGui::restoreState() { - CursorMan.popCursor(); + if (_useStdCursor) { + CursorMan.popCursor(); + PaletteMan.popCursorPalette(); + } _system->updateScreen(); diff --git a/gui/newgui.h b/gui/newgui.h index f40a33ebd2..d1e0150d53 100644 --- a/gui/newgui.h +++ b/gui/newgui.h @@ -94,6 +94,8 @@ protected: bool _stateIsSaved; + bool _useStdCursor; + // for continuous events (keyDown) struct { uint16 ascii; |