[Mplayer-cvslog] CVS: main/Gui/bitmap bitmap.c,1.4,1.5

Arpi of Ize arpi at mplayerhq.hu
Sun May 12 03:09:12 CEST 2002


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

Modified Files:
	bitmap.c 
Log Message:
bigendian fix by Colin Leroy <colin at colino.net>

Index: bitmap.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/bitmap/bitmap.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- bitmap.c	23 Feb 2002 15:12:51 -0000	1.4
+++ bitmap.c	12 May 2002 01:09:10 -0000	1.5
@@ -30,9 +30,16 @@
    memset( bf->Image,0,bf->ImageSize );
    for ( c=0,i=0;i < (int)(bf->Width * bf->Height * 3); )
     {
-     bf->Image[c++]=tmpImage[i++];
-     bf->Image[c++]=tmpImage[i++];
-     bf->Image[c++]=tmpImage[i++]; c++;
+#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 );
   }
@@ -55,7 +62,11 @@
 void Normalize( txSample * bf )
 {
  int           i;
+#ifndef WORDS_BIGENDIAN 
  for ( i=0;i < (int)bf->ImageSize;i+=4 ) bf->Image[i+3]=0;
+#else
+ for ( i=0;i < (int)bf->ImageSize;i+=4 ) bf->Image[i]=0; 
+#endif
 }
 
 unsigned char tmp[512];




More information about the MPlayer-cvslog mailing list