# HG changeset patch # User atmosfear # Date 989592107 0 # Node ID 372042df5c777924fa4fe361b5b92f617ebfb8fe # Parent 479f753a66ae7d3b2dbe0c03f7b1bf7c88d8f3a5 Added support for flipped BGR/RGB via -flip cmdline switch. diff -r 479f753a66ae -r 372042df5c77 libvo/vo_x11.c --- a/libvo/vo_x11.c Fri May 11 14:40:19 2001 +0000 +++ b/libvo/vo_x11.c Fri May 11 14:41:47 2001 +0000 @@ -89,6 +89,8 @@ static int gXErrorFlag; static int CompletionType=-1; +static int Flip_Flag; + static void InstallXErrorHandler() { //XSetErrorHandler( HandleXError ); @@ -111,9 +113,10 @@ int e=vo_x11_check_events(mDisplay); } -static uint32_t init( uint32_t width,uint32_t height,uint32_t d_width,uint32_t d_height,uint32_t fullscreen,char *title,uint32_t format ) +static uint32_t init( uint32_t width,uint32_t height,uint32_t d_width,uint32_t d_height,uint32_t flags,char *title,uint32_t format ) { int screen; + int fullscreen=0; int interval, prefer_blank, allow_exp, nothing; unsigned int fg,bg; char *hello=( title == NULL ) ? "X11 render" : title; @@ -148,6 +151,9 @@ hint.y=0; hint.width=image_width; hint.height=image_height; + + if( flags&0x01 ) fullscreen = 1; + if( flags&0x08 ) Flip_Flag = 1; #ifdef HAVE_XF86VM if (fullscreen) { @@ -434,6 +440,7 @@ } else { + int i; int sbpp=( ( image_format&0xFF )+7 )/8; int dbpp=( bpp+7 )/8; char *d=ImageData; @@ -490,7 +497,19 @@ } else #endif - { memcpy( d,s,sbpp*image_width*image_height ); } + { + if( Flip_Flag ) + { + s+=sbpp*image_width*image_height; + for( i=0;i < image_height;i++ ) + { + s-=sbpp*image_width; + memcpy( d,s,sbpp*image_width ); + d+=sbpp*image_width; + } + } + else memcpy( d,s,sbpp*image_width*image_height ); + } } else {