[Mplayer-cvslog] CVS: main/Gui bitmap.c,1.11,1.12

Alex Beregszaszi alex at mplayerhq.hu
Fri May 23 19:24:03 CEST 2003


Update of /cvsroot/mplayer/main/Gui
In directory mail:/var/tmp.root/cvs-serv30435

Modified Files:
	bitmap.c 
Log Message:
simplyfied it and fixed some 10ls (but sadly xshape still don't works)

Index: bitmap.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/bitmap.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- bitmap.c	23 May 2003 17:04:24 -0000	1.11
+++ bitmap.c	23 May 2003 17:23:35 -0000	1.12
@@ -108,16 +108,9 @@
    memset( bf->Image,0,bf->ImageSize );
    for ( c=0,i=0;i < (int)(bf->Width * bf->Height * 3); )
     {
-#ifndef WORDS_BIGENDIAN
      bf->Image[c++]=tmpImage[i++];	//red
      bf->Image[c++]=tmpImage[i++];	//green
      bf->Image[c++]=tmpImage[i++]; c++;	//blue
-#else
-     unsigned char t=tmpImage[i++];
-     bf->Image[c++]=tmpImage[i++];	//green
-     bf->Image[c++]=t;             c++;	//red
-     bf->Image[c++]=tmpImage[i++]; 	//blue
-#endif
     }
    free( tmpImage );
   }
@@ -188,11 +181,10 @@
    mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] Sorry, only 24 and 32 bpp bitmaps are supported.\n" );
    return -1;
   }
+ if ( conv24to32( bf ) ) return -8;
 #ifdef WORDS_BIGENDIAN
- if (bf->BPP == 32)
-    swab(bf->Image, bf->Image, bf->ImageSize);
+ swab(bf->Image, bf->Image, bf->ImageSize);
 #endif
- if ( conv24to32( bf ) ) return -8;
  bgr2rgb( bf );
  Normalize( bf );
  return 0;
@@ -204,7 +196,7 @@
  out->Height=in->Height;
  out->BPP=1;
  out->ImageSize=(out->Width * out->Height + 7) / 8;
- mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[c1to32] imagesize: %d\n",out->ImageSize );
+ mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[c32to1] imagesize: %d\n",out->ImageSize );
  out->Image=(char *)calloc( 1,out->ImageSize );
  if ( out->Image == NULL ) mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[c32to1] Not enough memory for image.\n" );
  {
@@ -229,7 +221,7 @@
  out->BPP=32;
  out->ImageSize=out->Width * out->Height * 4;
  out->Image=(char *)calloc( 1,out->ImageSize );
- mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[c32to1] imagesize: %d\n",out->ImageSize );
+ mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[c1to32] imagesize: %d\n",out->ImageSize );
  if ( out->Image == NULL ) mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[c1to32] Not enough memory for image.\n" );
  {
   int i,b,c=0; unsigned int * buf = NULL; unsigned char tmp = 0;



More information about the MPlayer-cvslog mailing list