From 4956052ca4d0d9e6fa0d50d3ceaaf442dae5d3aa Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 5 Jul 2009 14:11:54 +0000 Subject: Got rid of HACK, which was used to setup new cursor on theme change. svn-id: r42137 --- gui/GuiManager.cpp | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) (limited to 'gui/GuiManager.cpp') diff --git a/gui/GuiManager.cpp b/gui/GuiManager.cpp index cf8b7b2d9d..21b437fb6e 100644 --- a/gui/GuiManager.cpp +++ b/gui/GuiManager.cpp @@ -72,7 +72,6 @@ GuiManager::GuiManager() : _redrawStatus(kRedrawDisabled), error("Failed to load any GUI theme, aborting"); } } - _themeChange = false; } GuiManager::~GuiManager() { @@ -143,12 +142,20 @@ bool GuiManager::loadNewTheme(Common::String id, ThemeEngine::GraphicsMode gfx) // Enable the new theme // _theme = newTheme; - _themeChange = true; + _useStdCursor = !_theme->ownCursor(); + + // If _stateIsSaved is set, we know that a Theme is already initialized, + // thus we initialize the new theme properly + if (_stateIsSaved) { + _theme->enable(); + + if (_useStdCursor) + setupCursor(); + } // refresh all dialogs - for (int i = 0; i < _dialogStack.size(); ++i) { + for (int i = 0; i < _dialogStack.size(); ++i) _dialogStack[i]->reflowLayout(); - } // We need to redraw immediately. Otherwise // some other event may cause a widget to be @@ -233,7 +240,6 @@ void GuiManager::runLoop() { // _theme->refresh(); - _themeChange = false; _redrawStatus = kRedrawFull; redraw(); } @@ -285,21 +291,6 @@ void GuiManager::runLoop() { Common::Point mouse(event.mouse.x - activeDialog->_x, event.mouse.y - activeDialog->_y); - // HACK to change the cursor to the new themes one - if (_themeChange) { - _theme->enable(); - - _useStdCursor = !_theme->ownCursor(); - if (_useStdCursor) - setupCursor(); - -// _theme->refresh(); - - _themeChange = false; - _redrawStatus = kRedrawFull; - redraw(); - } - if (lastRedraw + waitTime < _system->getMillis()) { _theme->updateScreen(); _system->updateScreen(); -- cgit v1.2.3 From c353e8de1fb1afae67fdc69f06db4d399caa2ed5 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 5 Jul 2009 14:12:04 +0000 Subject: Removed pushing of EVENT_SCREEN_CHANGED on theme load. This event should only be pushed by the backend. svn-id: r42138 --- gui/GuiManager.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'gui/GuiManager.cpp') diff --git a/gui/GuiManager.cpp b/gui/GuiManager.cpp index 21b437fb6e..b97a62109b 100644 --- a/gui/GuiManager.cpp +++ b/gui/GuiManager.cpp @@ -164,10 +164,6 @@ bool GuiManager::loadNewTheme(Common::String id, ThemeEngine::GraphicsMode gfx) redraw(); _system->updateScreen(); - Common::Event event; - event.type = Common::EVENT_SCREEN_CHANGED; - _system->getEventManager()->pushEvent(event); - return true; } -- cgit v1.2.3