diff options
author | Max Horn | 2003-09-06 20:21:54 +0000 |
---|---|---|
committer | Max Horn | 2003-09-06 20:21:54 +0000 |
commit | 6ac86b97604a6248e2e26d6bed1d046d0ff06709 (patch) | |
tree | e6524d9e64ee32825ef2fedc6ea2c5586a88442c /gui/newgui.cpp | |
parent | bbd23e60ceae570e8bd0f220257a21b01f679355 (diff) | |
download | scummvm-rg350-6ac86b97604a6248e2e26d6bed1d046d0ff06709.tar.gz scummvm-rg350-6ac86b97604a6248e2e26d6bed1d046d0ff06709.tar.bz2 scummvm-rg350-6ac86b97604a6248e2e26d6bed1d046d0ff06709.zip |
added EVENT_SCREEN_CHANGED; small tweak to the way quit is handled in NewGui
svn-id: r10047
Diffstat (limited to 'gui/newgui.cpp')
-rw-r--r-- | gui/newgui.cpp | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/gui/newgui.cpp b/gui/newgui.cpp index 886e118263..ef75e9a575 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -91,6 +91,15 @@ NewGui::NewGui(OSystem *system) : _system(system), _screen(0), _needRedraw(false _currentKeyDown.keycode = 0; } +void NewGui::updateColors() { + // Setup some default GUI colors. + _bgcolor = _system->RGBToColor(0, 0, 0); + _color = _system->RGBToColor(96, 96, 96); + _shadowcolor = _system->RGBToColor(64, 64, 64); + _textcolor = _system->RGBToColor(32, 160, 32); + _textcolorhi = _system->RGBToColor(0, 255, 0); +} + void NewGui::runLoop() { Dialog *activeDialog = _dialogStack.top(); bool didSaveState = false; @@ -98,20 +107,11 @@ void NewGui::runLoop() { if (activeDialog == 0) return; - // Setup some default GUI colors. This has to be done here to ensure the - // overlay has been created already. Even then, one can get wrong colors, namely - // if the GUI is up and then the user toggles to full screen mode - on some system - // different color modes (555 vs 565) might be used depending on the resolution - // (e.g. that's the case on my system), so we still end up with wrong colors in those - // sitauations. At least now the user can fix it by closing and reopening the GUI. - - // TODO: Let's add a new even type which is sent whenever the backend GFX device - // changes (e.g. resized, full screen toggle, etc.). - _bgcolor = _system->RGBToColor(0, 0, 0); - _color = _system->RGBToColor(96, 96, 96); - _shadowcolor = _system->RGBToColor(64, 64, 64); - _textcolor = _system->RGBToColor(32, 160, 32); - _textcolorhi = _system->RGBToColor(0, 255, 0); + // Setup some default GUI colors. Normally this will be done whenever an + // EVENT_SCREEN_CHANGED is received. However, not all backends support + // that even at this time, so we also do it "manually" whenever a run loop + // is entered. + updateColors(); if (!_stateIsSaved) { saveState(); @@ -197,6 +197,9 @@ void NewGui::runLoop() { break; case OSystem::EVENT_QUIT: _system->quit(); + return; + case OSystem::EVENT_SCREEN_CHANGED: + updateColors(); break; } } |