[Scummvm-cvs-logs] CVS: scummvm/backends/sdl events.cpp,1.5,1.6 graphics.cpp,1.10,1.11 sdl.cpp,1.70,1.71

Max Horn fingolfin at users.sourceforge.net
Fri Jul 16 02:30:03 CEST 2004


Update of /cvsroot/scummvm/scummvm/backends/sdl
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4664

Modified Files:
	events.cpp graphics.cpp sdl.cpp 
Log Message:
Only show gfx mode change messages in the OSD if the change was initiated by the user; not if it was done automatically (e.g. because a 640x480 game was started and we auto-switch to 1x scaling)

Index: events.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/events.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- events.cpp	21 Jun 2004 02:04:18 -0000	1.5
+++ events.cpp	16 Jul 2004 09:29:09 -0000	1.6
@@ -193,6 +193,13 @@
 			// Alt-Return toggles full screen mode				
 			if (b == KBD_ALT && ev.key.keysym.sym == SDLK_RETURN) {
 				setFullscreenMode(!_full_screen);
+#ifdef USE_OSD
+				if (_full_screen)
+					displayMessageOnOSD("Fullscreen mode");
+				else
+					displayMessageOnOSD("Windowed mode");
+#endif
+
 				break;
 			}
 
@@ -266,18 +273,35 @@
 				// Ctrl-Alt-a toggles aspect ratio correction
 				if (ev.key.keysym.sym == 'a') {
 					setFeatureState(kFeatureAspectRatioCorrection, !_adjustAspectRatio);
+#ifdef USE_OSD
+					char buffer[128];
+					if (_adjustAspectRatio)
+						sprintf(buffer, "Enabled aspect ratio correction\n%d x %d -> %d x %d",
+							_screenWidth, _screenHeight,
+							_hwscreen->w, _hwscreen->h
+							);
+					else
+						sprintf(buffer, "Disabled aspect ratio correction\n%d x %d -> %d x %d",
+							_screenWidth, _screenHeight,
+							_hwscreen->w, _hwscreen->h
+							);
+					displayMessageOnOSD(buffer);
+#endif
+
 					break;
 				}
 
+
+				int newMode = -1;
+				
 				// Increase/decrease the scale factor
 				// TODO: Shall we 'wrap around' here?
 				if (ev.key.keysym.sym == SDLK_EQUALS || ev.key.keysym.sym == SDLK_PLUS || ev.key.keysym.sym == SDLK_MINUS ||
 					ev.key.keysym.sym == SDLK_KP_PLUS || ev.key.keysym.sym == SDLK_KP_MINUS) {
 					factor += (ev.key.keysym.sym == SDLK_MINUS || ev.key.keysym.sym == SDLK_KP_MINUS) ? -1 : +1;
 					if (0 <= factor && factor < 4 && s_gfxModeSwitchTable[_scalerType][factor] >= 0) {
-						setGraphicsMode(s_gfxModeSwitchTable[_scalerType][factor]);
+						newMode = s_gfxModeSwitchTable[_scalerType][factor];
 					}
-					break;
 				}
 				
 				const bool isNormalNumber = (SDLK_1 <= ev.key.keysym.sym && ev.key.keysym.sym <= SDLK_9);
@@ -291,9 +315,36 @@
 						assert(factor > 0);
 						factor--;
 					}
-					setGraphicsMode(s_gfxModeSwitchTable[_scalerType][factor]);
-					break;
+					newMode = s_gfxModeSwitchTable[_scalerType][factor];
 				}
+				
+				if (newMode >= 0) {
+					setGraphicsMode(newMode);
+#ifdef USE_OSD
+					if (_osdSurface) {
+						const char *newScalerName = 0;
+						const GraphicsMode *g = getSupportedGraphicsModes();
+						while (g->name) {
+							if (g->id == _mode) {
+								newScalerName = g->description;
+								break;
+							}
+							g++;
+						}
+						if (newScalerName) {
+							char buffer[128];
+							sprintf(buffer, "Active graphics filter: %s\n%d x %d -> %d x %d",
+								newScalerName,
+								_screenWidth, _screenHeight,
+								_hwscreen->w, _hwscreen->h
+								);
+							displayMessageOnOSD(buffer);
+						}
+					}
+#endif
+
+				}
+				break;
 			}
 
 #ifdef LINUPY

Index: graphics.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/graphics.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- graphics.cpp	5 May 2004 02:30:15 -0000	1.10
+++ graphics.cpp	16 Jul 2004 09:29:09 -0000	1.11
@@ -121,30 +121,6 @@
 	if (!_screen)
 		return true;
 
-#ifdef USE_OSD
-	if (_osdSurface) {
-		const char *newScalerName = 0;
-		const GraphicsMode *g = s_supportedGraphicsModes;
-		while (g->name) {
-			if (g->id == mode) {
-				newScalerName = g->description;
-				break;
-			}
-			g++;
-		}
-		if (newScalerName) {
-			char buffer[128];
-			sprintf(buffer, "Active graphics filter: %s\n%d x %d -> %d x %d",
-				newScalerName,
-				_screenWidth, _screenHeight,
-				_hwscreen->w, _hwscreen->h
-				);
-			displayMessageOnOSD(buffer);
-		}
-	}
-#endif
-
-
 	// Blit everything to the screen
 	_forceFull = true;
 	internUpdateScreen();
@@ -519,13 +495,6 @@
 		}
 #endif
 			
-#ifdef USE_OSD
-		if (_full_screen)
-			displayMessageOnOSD("Fullscreen mode");
-		else
-			displayMessageOnOSD("Windowed mode");
-#endif
-
 		// Blit everything to the screen
 		internUpdateScreen();
 		

Index: sdl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl.cpp,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- sdl.cpp	9 May 2004 14:27:53 -0000	1.70
+++ sdl.cpp	16 Jul 2004 09:29:09 -0000	1.71
@@ -163,21 +163,6 @@
 			_adjustAspectRatio ^= true;
 			hotswap_gfx_mode();
 			
-#ifdef USE_OSD
-			char buffer[128];
-			if (_adjustAspectRatio)
-				sprintf(buffer, "Enabled aspect ratio correction\n%d x %d -> %d x %d",
-					_screenWidth, _screenHeight,
-					_hwscreen->w, _hwscreen->h
-					);
-			else
-				sprintf(buffer, "Disabled aspect ratio correction\n%d x %d -> %d x %d",
-					_screenWidth, _screenHeight,
-					_hwscreen->w, _hwscreen->h
-					);
-			displayMessageOnOSD(buffer);
-#endif
-
 			// Blit everything to the screen
 			internUpdateScreen();
 			





More information about the Scummvm-git-logs mailing list