From f52db6fbdab394f19d99c40e7cd15a7ed8cfcca3 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 25 Jun 2001 22:16:44 +0000 Subject: [PATCH] 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 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/video/SDL_yuv.c b/src/video/SDL_yuv.c index 4e83f282e..7a2fb2536 100644 --- a/src/video/SDL_yuv.c +++ b/src/video/SDL_yuv.c @@ -48,13 +48,13 @@ SDL_Overlay *SDL_CreateYUVOverlay(int w, int h, Uint32 format, 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)) ) {