diff src/video/SDL_yuv.c @ 81:1a2723474f12

Added the SDL_VIDEO_YUV_DIRECT hack for better performance when the requested video mode is 16 bpp but the real video mode is 32 bpp.
author Sam Lantinga <slouken@lokigames.com>
date Mon, 25 Jun 2001 22:16:44 +0000
parents 74212992fb08
children e8157fcb3114
line wrap: on
line diff
--- a/src/video/SDL_yuv.c	Sat Jun 23 22:02:27 2001 +0000
+++ b/src/video/SDL_yuv.c	Mon Jun 25 22:16:44 2001 +0000
@@ -48,13 +48,13 @@
 	overlay = NULL;
 
 	/* Display directly on video surface, if possible */
-#if 0
-	if ( (display == SDL_PublicSurface) &&
-	     ((SDL_VideoSurface->format->BytesPerPixel == 2) ||
-	      (SDL_VideoSurface->format->BytesPerPixel == 4)) ) {
-		display = SDL_VideoSurface;
+	if ( getenv("SDL_VIDEO_YUV_DIRECT") ) {
+		if ( (display == SDL_PublicSurface) &&
+		     ((SDL_VideoSurface->format->BytesPerPixel == 2) ||
+		      (SDL_VideoSurface->format->BytesPerPixel == 4)) ) {
+			display = SDL_VideoSurface;
+		}
 	}
-#endif
         yuv_hwaccel = getenv("SDL_VIDEO_YUV_HWACCEL");
 	if ( ((display == SDL_VideoSurface) && video->CreateYUVOverlay) &&
 	     (!yuv_hwaccel || (atoi(yuv_hwaccel) > 0)) ) {