[Scummvm-cvs-logs] SF.net SVN: scummvm:[42137] scummvm/trunk/gui
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Sun Jul 5 16:11:54 CEST 2009
Revision: 42137
http://scummvm.svn.sourceforge.net/scummvm/?rev=42137&view=rev
Author: lordhoto
Date: 2009-07-05 14:11:54 +0000 (Sun, 05 Jul 2009)
Log Message:
-----------
Got rid of HACK, which was used to setup new cursor on theme change.
Modified Paths:
--------------
scummvm/trunk/gui/GuiManager.cpp
scummvm/trunk/gui/GuiManager.h
Modified: scummvm/trunk/gui/GuiManager.cpp
===================================================================
--- scummvm/trunk/gui/GuiManager.cpp 2009-07-05 13:07:11 UTC (rev 42136)
+++ scummvm/trunk/gui/GuiManager.cpp 2009-07-05 14:11:54 UTC (rev 42137)
@@ -72,7 +72,6 @@
error("Failed to load any GUI theme, aborting");
}
}
- _themeChange = false;
}
GuiManager::~GuiManager() {
@@ -143,12 +142,20 @@
// 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 @@
// _theme->refresh();
- _themeChange = false;
_redrawStatus = kRedrawFull;
redraw();
}
@@ -285,21 +291,6 @@
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();
Modified: scummvm/trunk/gui/GuiManager.h
===================================================================
--- scummvm/trunk/gui/GuiManager.h 2009-07-05 13:07:11 UTC (rev 42136)
+++ scummvm/trunk/gui/GuiManager.h 2009-07-05 14:11:54 UTC (rev 42137)
@@ -120,10 +120,8 @@
// mouse cursor state
int _cursorAnimateCounter;
int _cursorAnimateTimer;
- byte _cursor[2048];
+ byte _cursor[2048];
- bool _themeChange;
-
void initKeymap();
void saveState();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list