changeset 10169:46badb3d0b1c

simplyfied it and fixed some 10ls (but sadly xshape still don't works)
author alex
date Fri, 23 May 2003 17:23:35 +0000
parents 22572f1dafa3
children 2f9e8ff57e9e
files Gui/bitmap.c
diffstat 1 files changed, 4 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/bitmap.c	Fri May 23 17:04:24 2003 +0000
+++ b/Gui/bitmap.c	Fri May 23 17:23:35 2003 +0000
@@ -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;