diff options
author | Johannes Schickel | 2013-10-21 00:21:51 +0200 |
---|---|---|
committer | Kamil Zbróg | 2013-10-24 12:59:16 +0100 |
commit | c820e212ebf146e51bcc3285da325195d6afa536 (patch) | |
tree | f9524b357a8c2fa2dccc6ba4dbf1ba735da8d87d /backends/platform/sdl/sdl.cpp | |
parent | 960b47dbded2668051da8f5b0e4267d167f2403e (diff) | |
download | scummvm-rg350-c820e212ebf146e51bcc3285da325195d6afa536.tar.gz scummvm-rg350-c820e212ebf146e51bcc3285da325195d6afa536.tar.bz2 scummvm-rg350-c820e212ebf146e51bcc3285da325195d6afa536.zip |
SDL: Get rid of _glModesCount.
Diffstat (limited to 'backends/platform/sdl/sdl.cpp')
-rw-r--r-- | backends/platform/sdl/sdl.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index b0ebc476e1..620d3c58ee 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -69,8 +69,7 @@ OSystem_SDL::OSystem_SDL() _desktopHeight(0), _graphicsModes(), _graphicsMode(0), - _sdlModesCount(0), - _glModesCount(0), + _firstGLMode(0), #endif _inited(false), _initedSDL(false), @@ -179,7 +178,7 @@ void OSystem_SDL::initBackend() { int i = 0; while (mode->name) { if (scumm_stricmp(mode->name, gfxMode.c_str()) == 0) { - _graphicsMode = i + _sdlModesCount; + _graphicsMode = i + _firstGLMode; use_opengl = true; } @@ -544,10 +543,10 @@ const OSystem::GraphicsMode *OSystem_SDL::getSupportedGraphicsModes() const { int OSystem_SDL::getDefaultGraphicsMode() const { // Return the default graphics mode from the current graphics manager - if (_graphicsMode < _sdlModesCount) + if (_graphicsMode < _firstGLMode) return _graphicsManager->getDefaultGraphicsMode(); else - return _graphicsManager->getDefaultGraphicsMode() + _sdlModesCount; + return _graphicsManager->getDefaultGraphicsMode() + _firstGLMode; } bool OSystem_SDL::setGraphicsMode(int mode) { @@ -574,14 +573,14 @@ bool OSystem_SDL::setGraphicsMode(int mode) { // If the new mode and the current mode are not from the same graphics // manager, delete and create the new mode graphics manager - if (_graphicsMode >= _sdlModesCount && mode < _sdlModesCount) { + if (_graphicsMode >= _firstGLMode && mode < _firstGLMode) { debug(1, "switching to plain SDL graphics"); _graphicsManager->deactivateManager(); delete _graphicsManager; _graphicsManager = new SurfaceSdlGraphicsManager(_eventSource); switchedManager = true; - } else if (_graphicsMode < _sdlModesCount && mode >= _sdlModesCount) { + } else if (_graphicsMode < _firstGLMode && mode >= _firstGLMode) { debug(1, "switching to OpenGL graphics"); _graphicsManager->deactivateManager(); delete _graphicsManager; @@ -642,19 +641,16 @@ void OSystem_SDL::setupGraphicsModes() { const OSystem::GraphicsMode *sdlGraphicsModes = SurfaceSdlGraphicsManager::supportedGraphicsModes(); const OSystem::GraphicsMode *openglGraphicsModes = OpenGLSdlGraphicsManager::supportedGraphicsModes(); - _sdlModesCount = 0; - _glModesCount = 0; // Count the number of graphics modes const OSystem::GraphicsMode *srcMode = sdlGraphicsModes; while (srcMode->name) { - _sdlModesCount++; _graphicsModes.push_back(*srcMode); srcMode++; } + _firstGLMode = _graphicsModes.size(); srcMode = openglGraphicsModes; while (srcMode->name) { - _glModesCount++; _graphicsModes.push_back(*srcMode); srcMode++; } |