[Scummvm-cvs-logs] SF.net SVN: scummvm:[34627] scummvm/trunk/backends/platform/sdl

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Mon Sep 22 19:33:30 CEST 2008


Revision: 34627
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34627&view=rev
Author:   lordhoto
Date:     2008-09-22 17:33:30 +0000 (Mon, 22 Sep 2008)

Log Message:
-----------
Fixed full screen toggling via alt+enter.

Modified Paths:
--------------
    scummvm/trunk/backends/platform/sdl/events.cpp
    scummvm/trunk/backends/platform/sdl/graphics.cpp

Modified: scummvm/trunk/backends/platform/sdl/events.cpp
===================================================================
--- scummvm/trunk/backends/platform/sdl/events.cpp	2008-09-21 19:17:27 UTC (rev 34626)
+++ scummvm/trunk/backends/platform/sdl/events.cpp	2008-09-22 17:33:30 UTC (rev 34627)
@@ -195,7 +195,9 @@
 			// Alt-Return and Alt-Enter toggle full screen mode
 			if (b == Common::KBD_ALT && (ev.key.keysym.sym == SDLK_RETURN
 			                  || ev.key.keysym.sym == SDLK_KP_ENTER)) {
+				beginGFXTransaction();
 				setFullscreenMode(!_fullscreen);
+				endGFXTransaction();
 #ifdef USE_OSD
 				if (_fullscreen)
 					displayMessageOnOSD("Fullscreen mode");

Modified: scummvm/trunk/backends/platform/sdl/graphics.cpp
===================================================================
--- scummvm/trunk/backends/platform/sdl/graphics.cpp	2008-09-21 19:17:27 UTC (rev 34626)
+++ scummvm/trunk/backends/platform/sdl/graphics.cpp	2008-09-22 17:33:30 UTC (rev 34627)
@@ -691,20 +691,14 @@
 
 void OSystem_SDL::setFullscreenMode(bool enable) {
 	Common::StackLock lock(_graphicsMutex);
+	
+	if (_fullscreen == enable)
+		return;
 
-	if (_fullscreen != enable && _transactionMode == kTransactionCommit) {
+	if (_transactionMode == kTransactionCommit) {
 		assert(_hwscreen != 0);
 		_fullscreen = enable;
 
-		if (_transactionMode == kTransactionActive) {
-			_transactionDetails.fs = enable;
-			_transactionDetails.fsChanged = true;
-
-			_transactionDetails.needHotswap = true;
-
-			return;
-		}
-
 		// Switch between fullscreen and windowed mode by invoking hotswapGFXMode().
 		// We used to use SDL_WM_ToggleFullScreen() in the past, but this caused various
 		// problems. E.g. on OS X, it was implemented incorrectly for a long time; on
@@ -713,6 +707,11 @@
 		// So, we just do it "manually" now. There shouldn't be any drawbacks to that
 		// anyway.
 		hotswapGFXMode();
+	} else if (_transactionMode == kTransactionActive) {
+		_transactionDetails.fs = enable;
+		_transactionDetails.fsChanged = true;
+
+		_transactionDetails.needHotswap = true;
 	}
 }
 


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