Added the SDL_VIDEO_YUV_DIRECT hack for better performance when the
authorSam Lantinga <slouken@lokigames.com>
Mon, 25 Jun 2001 22:16:44 +0000
changeset 81 1a2723474f12
parent 80 8806bc1eb80e
child 82 2bddc38a9f5d
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.
src/video/SDL_yuv.c
--- 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)) ) {