annotate Gui/bitmap.c @ 5228:e8240da04b82

new lavc opts
author gabucino
date Wed, 20 Mar 2002 20:23:40 +0000
parents 3473ca9ef158
children 35689e1e6745
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
1
2080
f91ad6d23ce9 gcc3 warning fixed
arpi
parents: 1693
diff changeset
2 #include <stdio.h>
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
3 #include <stdlib.h>
2080
f91ad6d23ce9 gcc3 warning fixed
arpi
parents: 1693
diff changeset
4 #include <string.h>
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
5
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
6 #include "bitmap.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
7
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
8 #define BMP 1
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
9 #define TGA 2
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
10 #define PNG 3
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
11 #define TGAPACKED 4
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
12
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
13 extern char * strcat( char * dest,const char * src );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
14
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
15 int conv24to32( txSample * bf )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
16 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
17 unsigned char * tmpImage;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
18 int i,c;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
19
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
20 if ( bf->BPP == 24 )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
21 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
22 tmpImage=bf->Image;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
23 bf->ImageSize=bf->Width * bf->Height * 4;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
24 bf->BPP=32;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
25 if ( ( bf->Image=malloc( bf->ImageSize ) ) == NULL )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
26 {
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 2717
diff changeset
27 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] Not enough memory for image.\n" );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
28 return 1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
29 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
30 memset( bf->Image,0,bf->ImageSize );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 2717
diff changeset
31 for ( c=0,i=0;i < (int)(bf->Width * bf->Height * 3); )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
32 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
33 bf->Image[c++]=tmpImage[i++];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
34 bf->Image[c++]=tmpImage[i++];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
35 bf->Image[c++]=tmpImage[i++]; c++;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
36 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
37 free( tmpImage );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
38 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
39 return 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
40 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
41
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
42 void bgr2rgb( txSample * bf )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
43 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
44 unsigned char c;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
45 int i;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
46
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 2717
diff changeset
47 for ( i=0;i < (int)bf->ImageSize;i+=4 )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
48 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
49 c=bf->Image[i];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
50 bf->Image[i]=bf->Image[i+2];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
51 bf->Image[i+2]=c;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
52 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
53 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
54
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
55 void Normalize( txSample * bf )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
56 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
57 int i;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 2717
diff changeset
58 for ( i=0;i < (int)bf->ImageSize;i+=4 ) bf->Image[i+3]=0;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
59 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
60
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
61 unsigned char tmp[512];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
62
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
63 unsigned char * fExist( unsigned char * fname )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
64 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
65 FILE * fl;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
66 unsigned char ext[][6] = { ".tga\0",".TGA\0",".png\0",".PNG\0",".bmp\0",".BMP\0" };
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
67 int i;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
68
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
69 fl=fopen( fname,"rb" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
70 if ( fl != NULL )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
71 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
72 fclose( fl );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
73 return fname;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
74 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
75 for ( i=0;i<10;i++ )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
76 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
77 strcpy( tmp,fname );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
78 strcat( tmp,ext[i] );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
79 fl=fopen( tmp,"rb" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
80 if ( fl != NULL )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
81 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
82 fclose( fl );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
83 return tmp;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
84 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
85 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
86 return NULL;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
87 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
88
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
89 int aComp( unsigned char * b1,unsigned char * b2,int size )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
90 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
91 int i;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
92 for( i=0;i<size;i++ ) if ( b1[i] != b2[i] ) return 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
93 return 1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
94 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
95
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
96 int GetFileType( char * fname )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
97 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
98 FILE * fl;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
99 unsigned char buffer[10];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
100 unsigned char bmp[2] = { 0x42,0x4d };
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
101 unsigned char tga[7] = { 0x00,0x02,0x00,0x00,0x00,0x00,0x00 };
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
102 unsigned char ptga[7] = { 0x00,0x0a,0x00,0x00,0x00,0x00,0x00 };
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
103 unsigned char png[8] = { 0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a };
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
104
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
105 if ( ( fl=fopen( fname,"rb" ) ) == NULL ) return -1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
106 fread( buffer,1,10,fl );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
107 fclose( fl );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
108
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
109 if ( aComp( buffer,bmp,2 ) ) return BMP; // --- bmp
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
110 if ( aComp( &buffer[1],tga,8 ) ) return TGA; // --- tga
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
111 if ( aComp( &buffer[1],ptga,7 ) ) return TGAPACKED; // --- tga
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
112 if ( aComp( buffer,png,8 ) ) return PNG; // --- png
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
113 return 0; // --- others
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
114 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
115
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
116 int bpRead( char * fname, txSample * bf )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
117 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
118 int bgr = 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
119 int i;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
120
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
121 fname=fExist( fname );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
122 if ( fname == NULL ) return -2;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
123 switch ( GetFileType( fname ) )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
124 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
125 case BMP:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
126 i=bmpRead( fname,bf );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
127 switch ( i )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
128 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
129 case 0: break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
130 case 3: return -1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
131 default: return -3;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
132 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
133 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
134 case TGA:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
135 i=tgaRead( fname,bf );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
136 switch ( i )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
137 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
138 case 0: break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
139 case 3: return -1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
140 default: return -4;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
141 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
142 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
143 case PNG:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
144 if ( pngRead( fname,bf ) ) return -5;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
145 bgr=1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
146 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
147 case TGAPACKED:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 2717
diff changeset
148 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] sorry, packed TGA not supported.\n" );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
149 return -6;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
150 default:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
151 {
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 2717
diff changeset
152 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] Unknown file type ( %s ).\n",fname );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
153 return -7;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
154 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
155 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
156 if ( bf->BPP < 24 )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
157 {
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 2717
diff changeset
158 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] sorry, 16 or less bitmaps not supported.\n" );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
159 return -1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
160 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
161 if ( conv24to32( bf ) ) return -8;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
162 if ( bgr ) bgr2rgb( bf );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
163 Normalize( bf );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
164 return 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
165 }
2717
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
166
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
167 void Convert32to1( txSample * in,txSample * out,int adaptivlimit )
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
168 {
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
169 out->Width=in->Width;
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
170 out->Height=in->Height;
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
171 out->BPP=1;
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
172 out->ImageSize=out->Width * out->Height / 8;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 2717
diff changeset
173 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[c1to32] imagesize: %d\n",out->ImageSize );
2717
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
174 out->Image=(char *)calloc( 1,out->ImageSize );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 2717
diff changeset
175 if ( out->Image == NULL ) mp_msg( MSGT_GPLAYER,MSGL_STATUS,"nem van ram baze\n" );
2717
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
176 {
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
177 int i,b,c=0; unsigned long * buf = NULL; unsigned char tmp = 0; int nothaveshape = 1;
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
178 buf=(unsigned long *)in->Image;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 2717
diff changeset
179 for ( b=0,i=0;i < (int)(out->Width * out->Height);i++ )
2717
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
180 {
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 2717
diff changeset
181 if ( (int)buf[i] != adaptivlimit ) tmp=( tmp >> 1 )|128;
2717
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
182 else { tmp=tmp >> 1; buf[i]=nothaveshape=0; }
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
183 if ( b++ == 7 ) { out->Image[c++]=tmp; tmp=b=0; }
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
184 }
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
185 if ( b ) out->Image[c]=tmp;
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
186 if ( nothaveshape ) { free( out->Image ); out->Image=NULL; }
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
187 }
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
188 }
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
189
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
190 void Convert1to32( txSample * in,txSample * out )
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
191 {
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
192 if ( in->Image == NULL ) return;
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
193 out->Width=in->Width;
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
194 out->Height=in->Height;
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
195 out->BPP=32;
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
196 out->ImageSize=out->Width * out->Height * 4;
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
197 out->Image=(char *)calloc( 1,out->ImageSize );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 2717
diff changeset
198 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[c32to1] imagesize: %d\n",out->ImageSize );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 2717
diff changeset
199 if ( (int)out->Image == NULL ) mp_msg( MSGT_GPLAYER,MSGL_STATUS,"nem van ram baze\n" );
2717
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
200 {
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
201 int i,b,c=0; unsigned long * buf = NULL; unsigned char tmp = 0;
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
202 buf=(unsigned long *)out->Image;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 2717
diff changeset
203 for ( c=0,i=0;i < (int)(in->Width * in->Height / 8);i++ )
2717
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
204 {
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
205 tmp=in->Image[i];
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
206 for ( b=0;b<8;b++ )
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
207 {
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
208 buf[c]=0;
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
209 if ( tmp&0x1 ) buf[c]=0xffffffff;
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
210 c++; tmp=tmp>>1;
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
211 }
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
212 }
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
213 }
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2080
diff changeset
214 }