comparison Gui/skin/skin.c @ 2717:5fa8c079ee3c

fix small xshape bug
author pontscho
date Mon, 05 Nov 2001 17:00:42 +0000
parents 0653e90b3118
children bd851a5afcb3
comparison
equal deleted inserted replaced
2716:5e10c7239819 2717:5fa8c079ee3c
130 strcpy( tmp,path ); strcat( tmp,fname ); 130 strcpy( tmp,path ); strcat( tmp,fname );
131 if ( skinBPRead( tmp,&defList->main.Bitmap ) ) return 1; 131 if ( skinBPRead( tmp,&defList->main.Bitmap ) ) return 1;
132 defList->main.width=defList->main.Bitmap.Width; 132 defList->main.width=defList->main.Bitmap.Width;
133 defList->main.height=defList->main.Bitmap.Height; 133 defList->main.height=defList->main.Bitmap.Height;
134 #ifdef HAVE_XSHAPE 134 #ifdef HAVE_XSHAPE
135 /*
135 defList->main.Mask.Width=defList->main.Bitmap.Width; 136 defList->main.Mask.Width=defList->main.Bitmap.Width;
136 defList->main.Mask.Height=defList->main.Bitmap.Height; 137 defList->main.Mask.Height=defList->main.Bitmap.Height;
137 defList->main.Mask.BPP=1; 138 defList->main.Mask.BPP=1;
138 defList->main.Mask.ImageSize=defList->main.Mask.Width * defList->main.Mask.Height / 8; 139 defList->main.Mask.ImageSize=defList->main.Mask.Width * defList->main.Mask.Height / 8;
139 defList->main.Mask.Image=(char *)calloc( 1,defList->main.Mask.ImageSize ); 140 defList->main.Mask.Image=(char *)calloc( 1,defList->main.Mask.ImageSize );
146 if ( buf[i] != 0x00ff00ff ) tmp=( tmp >> 1 )|128; 147 if ( buf[i] != 0x00ff00ff ) tmp=( tmp >> 1 )|128;
147 else { tmp=tmp >> 1; buf[i]=nothaveshape=0; } 148 else { tmp=tmp >> 1; buf[i]=nothaveshape=0; }
148 if ( b++ == 7 ) { defList->main.Mask.Image[c++]=tmp; tmp=b=0; } 149 if ( b++ == 7 ) { defList->main.Mask.Image[c++]=tmp; tmp=b=0; }
149 } 150 }
150 if ( b ) defList->main.Mask.Image[c]=tmp; 151 if ( b ) defList->main.Mask.Image[c]=tmp;
151 if ( nothaveshape ) { free( defList->main.Mask.Image ); defList->main.Mask.Image=NULL; } 152 // if ( nothaveshape ) { free( defList->main.Mask.Image ); defList->main.Mask.Image=NULL; }
153 }
154 */
155 Convert32to1( &defList->main.Bitmap,&defList->main.Mask,0x00ff00ff );
156 {
157 if ( defList->main.Mask.Image != NULL )
158 {
159 txSample d;
160 Convert1to32( &defList->main.Mask,&d );
161 tgaWriteTexture( "debug.tga",&d );
162 }
152 } 163 }
153 #ifdef DEBUG 164 #ifdef DEBUG
154 dbprintf( 3,"[skin] mask: %dx%d\n",defList->main.Mask.Width,defList->main.Mask.Height ); 165 dbprintf( 3,"[skin] mask: %dx%d\n",defList->main.Mask.Width,defList->main.Mask.Height );
155 #endif 166 #endif
156 #else 167 #else