diff options
author | Alejandro Marzini | 2010-08-13 05:16:42 +0000 |
---|---|---|
committer | Alejandro Marzini | 2010-08-13 05:16:42 +0000 |
commit | 610f041930ee899a3667aa5b203c31c88d5df911 (patch) | |
tree | c09cee57fa306a38bba39f73d7f5e9fe86938879 /backends/graphics | |
parent | d84428e678fb04325253c05e6651192c62930f08 (diff) | |
download | scummvm-rg350-610f041930ee899a3667aa5b203c31c88d5df911.tar.gz scummvm-rg350-610f041930ee899a3667aa5b203c31c88d5df911.tar.bz2 scummvm-rg350-610f041930ee899a3667aa5b203c31c88d5df911.zip |
OPENGL: Remove unnecessary best fullscreen mode detection code.
svn-id: r52056
Diffstat (limited to 'backends/graphics')
-rw-r--r-- | backends/graphics/openglsdl/openglsdl-graphics.cpp | 29 | ||||
-rw-r--r-- | backends/graphics/openglsdl/openglsdl-graphics.h | 1 |
2 files changed, 4 insertions, 26 deletions
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index d04eb27d26..da51de7c9b 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -36,8 +36,7 @@ OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager() _lastFullscreenModeWidth(0), _lastFullscreenModeHeight(0), _desktopWidth(0), - _desktopHeight(0), - _desktopAspectRatio(0) { + _desktopHeight(0) { // Initialize SDL video subsystem if (SDL_InitSubSystem(SDL_INIT_VIDEO) == -1) { @@ -52,7 +51,6 @@ OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager() if (videoInfo->current_w > 0 && videoInfo->current_h > 0) { _desktopWidth = videoInfo->current_w; _desktopHeight = videoInfo->current_h; - _desktopAspectRatio = videoInfo->current_w * 10000 / videoInfo->current_h; } if (ConfMan.hasKey("last_fullscreen_mode_width") && ConfMan.hasKey("last_fullscreen_mode_height")) { @@ -233,12 +231,9 @@ bool OpenGLSdlGraphicsManager::setupFullscreenMode() { SDL_Rect const* const*availableModes = SDL_ListModes(NULL, SDL_FULLSCREEN | SDL_OPENGL); // If -1, autodetect the fullscreen mode - // The first one to select will be the last used fullscreen mode - // The second one the desktop resolution. - // In the rare case that there is no fullscreen mode with same desktop resolution, - // or when the desktop data could not be obtained, the smallest one with the same - // aspect ratio as desktop will be selected. - // Finaly, if all other fail, the one with smallest metric will be selected. + // The last used fullscreen mode will be prioritized, if there is no last fullscreen + // mode, the desktop resolution will be used, and in case the desktop resolution + // is not available as a fullscreen mode, the one with smallest metric will be selected. if (_videoMode.activeFullscreenMode == -1) { // Desktop resolution int desktopModeIndex = -1; @@ -248,11 +243,6 @@ bool OpenGLSdlGraphicsManager::setupFullscreenMode() { int bestModeIndex = 0; uint bestMetric = (uint)-1; - // Best Aspect Ratio mode (Same ASR as desktop and less metric) - const SDL_Rect *bestASRMode = NULL; - int bestASRModeIndex = 0; - uint bestASRMetric = (uint)-1; - // Iterate over all available fullscreen modes for (int i = 0; const SDL_Rect *mode = availableModes[i]; i++) { // Try to setup the last used fullscreen mode @@ -277,11 +267,6 @@ bool OpenGLSdlGraphicsManager::setupFullscreenMode() { bestMetric = metric; bestModeIndex = i; } - if ((uint)(mode->w * 10000 / mode->h) == _desktopAspectRatio) { - bestASRMode = mode; - bestASRModeIndex = i; - bestASRMetric = metric; - } } if (desktopModeIndex >= 0) { @@ -290,12 +275,6 @@ bool OpenGLSdlGraphicsManager::setupFullscreenMode() { _videoMode.activeFullscreenMode = desktopModeIndex; return true; - } else if (bestASRMode) { - _videoMode.hardwareWidth = bestASRMode->w; - _videoMode.hardwareHeight = bestASRMode->h; - - _videoMode.activeFullscreenMode = bestASRModeIndex; - return true; } else if (bestMode) { _videoMode.hardwareWidth = bestMode->w; _videoMode.hardwareHeight = bestMode->h; diff --git a/backends/graphics/openglsdl/openglsdl-graphics.h b/backends/graphics/openglsdl/openglsdl-graphics.h index a837cc7ca3..1a54dccbcd 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.h +++ b/backends/graphics/openglsdl/openglsdl-graphics.h @@ -90,7 +90,6 @@ protected: int _lastFullscreenModeHeight; int _desktopWidth; int _desktopHeight; - uint _desktopAspectRatio; // Hardware screen SDL_Surface *_hwscreen; |