Mercurial > mplayer.hg
comparison Gui/skin/skin.c @ 2781:bd851a5afcb3
uuupsz ... 1l cola ;)
author | pontscho |
---|---|
date | Fri, 09 Nov 2001 12:58:43 +0000 |
parents | 5fa8c079ee3c |
children | 182163807172 |
comparison
equal
deleted
inserted
replaced
2780:e2bae77b6c18 | 2781:bd851a5afcb3 |
---|---|
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 /* | |
136 defList->main.Mask.Width=defList->main.Bitmap.Width; | |
137 defList->main.Mask.Height=defList->main.Bitmap.Height; | |
138 defList->main.Mask.BPP=1; | |
139 defList->main.Mask.ImageSize=defList->main.Mask.Width * defList->main.Mask.Height / 8; | |
140 defList->main.Mask.Image=(char *)calloc( 1,defList->main.Mask.ImageSize ); | |
141 if ( defList->main.Mask.Image == NULL ) message( True,MSGTR_NEMFMM ); | |
142 { | |
143 int i,b,c=0; unsigned long * buf = NULL; unsigned char tmp = 0; int nothaveshape = 1; | |
144 buf=(unsigned long *)defList->main.Bitmap.Image; | |
145 for ( b=0,i=0;i < defList->main.Mask.Width * defList->main.Mask.Height;i++ ) | |
146 { | |
147 if ( buf[i] != 0x00ff00ff ) tmp=( tmp >> 1 )|128; | |
148 else { tmp=tmp >> 1; buf[i]=nothaveshape=0; } | |
149 if ( b++ == 7 ) { defList->main.Mask.Image[c++]=tmp; tmp=b=0; } | |
150 } | |
151 if ( b ) defList->main.Mask.Image[c]=tmp; | |
152 // if ( nothaveshape ) { free( defList->main.Mask.Image ); defList->main.Mask.Image=NULL; } | |
153 } | |
154 */ | |
155 Convert32to1( &defList->main.Bitmap,&defList->main.Mask,0x00ff00ff ); | 135 Convert32to1( &defList->main.Bitmap,&defList->main.Mask,0x00ff00ff ); |
136 #if 0 | |
156 { | 137 { |
157 if ( defList->main.Mask.Image != NULL ) | 138 if ( defList->main.Mask.Image != NULL ) |
158 { | 139 { |
159 txSample d; | 140 txSample d; |
160 Convert1to32( &defList->main.Mask,&d ); | 141 Convert1to32( &defList->main.Mask,&d ); |
161 tgaWriteTexture( "debug.tga",&d ); | 142 tgaWriteTexture( "debug.tga",&d ); |
162 } | 143 } |
163 } | 144 } |
145 #endif | |
164 #ifdef DEBUG | 146 #ifdef DEBUG |
165 dbprintf( 3,"[skin] mask: %dx%d\n",defList->main.Mask.Width,defList->main.Mask.Height ); | 147 dbprintf( 3,"[skin] mask: %dx%d\n",defList->main.Mask.Width,defList->main.Mask.Height ); |
166 #endif | 148 #endif |
167 #else | 149 #else |
168 defList->main.Mask.Image=NULL; | 150 defList->main.Mask.Image=NULL; |