can draw icons in truecolor!
This commit is contained in:
parent
e1473968b4
commit
f30b2a8908
1 changed files with 3 additions and 4 deletions
|
@ -338,11 +338,10 @@ void TrueRenderControl::drawImage(Surface &sf, int w, int h,
|
||||||
startx = x;
|
startx = x;
|
||||||
|
|
||||||
for (i = 0, c = 0, e = w*h; i < e; ++i) {
|
for (i = 0, c = 0, e = w*h; i < e; ++i) {
|
||||||
printf("%d, %d\n", x, y);
|
|
||||||
unsigned char alpha = data[i] >> 24;
|
unsigned char alpha = data[i] >> 24;
|
||||||
unsigned char r = data[i];
|
unsigned char r = data[i] >> 16;
|
||||||
unsigned char g = data[i] >> 8;
|
unsigned char g = data[i] >> 8;
|
||||||
unsigned char b = data[i] >> 16;
|
unsigned char b = data[i];
|
||||||
|
|
||||||
// background color
|
// background color
|
||||||
unsigned char bgr = bg[i] >> default_red_shift;
|
unsigned char bgr = bg[i] >> default_red_shift;
|
||||||
|
@ -353,7 +352,7 @@ void TrueRenderControl::drawImage(Surface &sf, int w, int h,
|
||||||
g = bgg + (g - bgg) * alpha >> 8;
|
g = bgg + (g - bgg) * alpha >> 8;
|
||||||
b = bgb + (b - bgb) * alpha >> 8;
|
b = bgb + (b - bgb) * alpha >> 8;
|
||||||
|
|
||||||
bg[i] = (r << default_red_shift) & (g << default_green_shift) &
|
bg[i] = (r << default_red_shift) | (g << default_green_shift) |
|
||||||
(b << default_blue_shift);
|
(b << default_blue_shift);
|
||||||
|
|
||||||
if (++c >= w) {
|
if (++c >= w) {
|
||||||
|
|
Loading…
Reference in a new issue