diff options
author | Johannes Schickel | 2011-03-17 20:35:04 +0100 |
---|---|---|
committer | Johannes Schickel | 2011-03-17 21:20:20 +0100 |
commit | 8d35d91bdf3eab421233c6b971d6dec39b2f45b0 (patch) | |
tree | 0f9947f2f46780a1c5f08a67f94b9bb6a8cf647e /backends/graphics/opengl/opengl-graphics.cpp | |
parent | f490e6f361e55c2347b51611eb8f03a721630421 (diff) | |
download | scummvm-rg350-8d35d91bdf3eab421233c6b971d6dec39b2f45b0.tar.gz scummvm-rg350-8d35d91bdf3eab421233c6b971d6dec39b2f45b0.tar.bz2 scummvm-rg350-8d35d91bdf3eab421233c6b971d6dec39b2f45b0.zip |
OPENGL: Cleanup switchDisplayMode.
Diffstat (limited to 'backends/graphics/opengl/opengl-graphics.cpp')
-rw-r--r-- | backends/graphics/opengl/opengl-graphics.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index 0729ff331c..e0c65dd309 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -1376,19 +1376,19 @@ const char *OpenGLGraphicsManager::getCurrentModeName() { } void OpenGLGraphicsManager::switchDisplayMode(int mode) { - if (_oldVideoMode.setup && _oldVideoMode.mode == mode) + assert(_transactionMode == kTransactionActive); + + if (_videoMode.mode == mode) return; - if (_transactionMode == kTransactionActive) { - if (mode == -1) // If -1, switch to next mode - _videoMode.mode = (_videoMode.mode + 1) % 4; - else if (mode == -2) // If -2, switch to previous mode - _videoMode.mode = (_videoMode.mode + 3) % 4; - else - _videoMode.mode = mode; + if (mode == -1) // If -1, switch to next mode + _videoMode.mode = (_videoMode.mode + 1) % 4; + else if (mode == -2) // If -2, switch to previous mode + _videoMode.mode = (_videoMode.mode + 3) % 4; + else + _videoMode.mode = mode; - _transactionDetails.needRefresh = true; - } + _transactionDetails.needRefresh = true; } #ifdef USE_OSD |