[Scummvm-cvs-logs] SF.net SVN: scummvm:[54754] scummvm/trunk/backends/graphics/openglsdl/ openglsdl-graphics.cpp

jvprat at users.sourceforge.net jvprat at users.sourceforge.net
Fri Dec 3 20:09:28 CET 2010


Revision: 54754
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54754&view=rev
Author:   jvprat
Date:     2010-12-03 19:09:27 +0000 (Fri, 03 Dec 2010)

Log Message:
-----------
OPENGL: Fix the fullscreen mode detection when SDL accepts any resolution.

Modified Paths:
--------------
    scummvm/trunk/backends/graphics/openglsdl/openglsdl-graphics.cpp

Modified: scummvm/trunk/backends/graphics/openglsdl/openglsdl-graphics.cpp
===================================================================
--- scummvm/trunk/backends/graphics/openglsdl/openglsdl-graphics.cpp	2010-12-03 19:01:52 UTC (rev 54753)
+++ scummvm/trunk/backends/graphics/openglsdl/openglsdl-graphics.cpp	2010-12-03 19:09:27 UTC (rev 54754)
@@ -241,6 +241,15 @@
 bool OpenGLSdlGraphicsManager::setupFullscreenMode() {
 	SDL_Rect const* const*availableModes = SDL_ListModes(NULL, SDL_FULLSCREEN | SDL_OPENGL);
 
+	// SDL_ListModes() returns -1 in case any dimension is okay. In that
+	// case we'll reuse the current desktop resolution for fullscreen.
+	if (availableModes == (void *)-1) {
+		_videoMode.hardwareWidth = _desktopWidth;
+		_videoMode.hardwareHeight = _desktopHeight;
+		_videoMode.activeFullscreenMode = -2;
+		return true;
+	}
+
 	// If -2, autodetect the fullscreen mode
 	// 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


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list