Changeset 23805
- Timestamp:
- 09/20/13 18:29:19 (10 years ago)
- Location:
- titan/titan
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/titan/skin.h
r23286 r23805 1924 1924 int pictype = 0; //0 = png, 1 = jpg HW, 2 = jpg SW 1925 1925 unsigned long tmpcol = 0; 1926 unsigned char r = 0, g = 0, b = 0 ;1926 unsigned char r = 0, g = 0, b = 0, ralpha = 0; 1927 1927 1928 1928 length = strlen(filename); … … 2053 2053 { 2054 2054 tmpcol = skinfb->fblong[x]; 2055 alpha_composite(r, src[0], src[3], (tmpcol & 0xff0000) >> 16); 2056 alpha_composite(g, src[1], src[3], (tmpcol & 0x00ff00) >> 8); 2057 alpha_composite(b, src[2], src[3], tmpcol & 0xff); 2055 ralpha = 255 - src[3]; 2056 alpha_composite(r, src[0], src[3], ralpha, (tmpcol & 0xff0000) >> 16); 2057 alpha_composite(g, src[1], src[3], ralpha, (tmpcol & 0x00ff00) >> 8); 2058 alpha_composite(b, src[2], src[3], ralpha, tmpcol & 0xff); 2058 2059 skinfb->fblong[x] = (255 << 24) | r << 16 | g << 8 | b; 2059 2060 } … … 2225 2226 FTC_SBit sbit; 2226 2227 unsigned long tmpcol = 0, tmpcol1 = 0; 2227 long buffercol = 0;2228 2228 unsigned char red, green, blue, r, g, b; 2229 2229 unsigned char* src = NULL; 2230 unsigned char ralpha = 0; 2230 2231 2231 2232 if(currentchar == 32) space = 1; … … 2285 2286 for(x = y; x < pxw; x++) 2286 2287 { 2287 buffercol = src[0]; 2288 src++; 2289 if(buffercol > min) 2288 if(src[0] > min) 2290 2289 { 2291 2290 //renderquality 255-0 = best 2292 if( buffercol> max)2291 if(src[0] > max) 2293 2292 skinfb->fblong[x] = tmpcol; 2294 2293 else 2295 2294 { 2296 2295 tmpcol1 = skinfb->fblong[x]; 2297 alpha_composite(r, red, buffercol, (tmpcol1 & 0xff0000) >> 16); 2298 alpha_composite(g, green, buffercol, (tmpcol1 & 0x00ff00) >> 8); 2299 alpha_composite(b, blue, buffercol, tmpcol1 & 0xff); 2296 ralpha = 255 - src[0]; 2297 alpha_composite(r, red, src[0], ralpha, (tmpcol1 & 0xff0000) >> 16); 2298 alpha_composite(g, green, src[0], ralpha, (tmpcol1 & 0x00ff00) >> 8); 2299 alpha_composite(b, blue, src[0], ralpha, tmpcol1 & 0xff); 2300 2300 skinfb->fblong[x] = transparent << 24 | r << 16 | g << 8 | b; 2301 2301 } 2302 2302 } 2303 src++; 2303 2304 } 2304 2305 } -
titan/titan/struct.h
r23781 r23805 175 175 #define bcdtoint(i) ((((i & 0xf0) >> 4) * 10) + (i & 0x0f)) 176 176 177 #define alpha_composite(composite, fg, alpha, bg) { \177 #define alpha_composite(composite, fg, alpha, ralpha, bg) { \ 178 178 unsigned short temp = ((unsigned short)(fg)*(unsigned short)(alpha) + \ 179 (unsigned short)(bg)*(unsigned short)( 255 - (unsigned short)(alpha)) + \179 (unsigned short)(bg)*(unsigned short)(ralpha) + \ 180 180 (unsigned short)128); \ 181 181 (composite) = (unsigned char)((temp + (temp >> 8)) >> 8); }
Note: See TracChangeset
for help on using the changeset viewer.