diff options
| author | Johannes Schickel | 2009-07-05 14:11:54 +0000 | 
|---|---|---|
| committer | Johannes Schickel | 2009-07-05 14:11:54 +0000 | 
| commit | 4956052ca4d0d9e6fa0d50d3ceaaf442dae5d3aa (patch) | |
| tree | 57fb44d4ad4bd5e33f34e08b9d55c3fd732a7aad | |
| parent | d424bee608ea2c1adc5720f081c9e221b2969e26 (diff) | |
| download | scummvm-rg350-4956052ca4d0d9e6fa0d50d3ceaaf442dae5d3aa.tar.gz scummvm-rg350-4956052ca4d0d9e6fa0d50d3ceaaf442dae5d3aa.tar.bz2 scummvm-rg350-4956052ca4d0d9e6fa0d50d3ceaaf442dae5d3aa.zip  | |
Got rid of HACK, which was used to setup new cursor on theme change.
svn-id: r42137
| -rw-r--r-- | gui/GuiManager.cpp | 31 | ||||
| -rw-r--r-- | gui/GuiManager.h | 4 | 
2 files changed, 12 insertions, 23 deletions
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(); diff --git a/gui/GuiManager.h b/gui/GuiManager.h index 102d612699..ab5c653549 100644 --- a/gui/GuiManager.h +++ b/gui/GuiManager.h @@ -120,9 +120,7 @@ protected:  	// mouse cursor state  	int		_cursorAnimateCounter;  	int		_cursorAnimateTimer; -	byte		_cursor[2048]; - -	bool _themeChange; +	byte	_cursor[2048];  	void initKeymap();  | 
