From f30b2a8908ad2df8fa56c8d12be2da9192446b7a Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 12 Feb 2003 00:10:45 +0000 Subject: [PATCH] can draw icons in truecolor! --- otk/truerendercontrol.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/otk/truerendercontrol.cc b/otk/truerendercontrol.cc index ebf47877..2b332d9b 100644 --- a/otk/truerendercontrol.cc +++ b/otk/truerendercontrol.cc @@ -338,11 +338,10 @@ void TrueRenderControl::drawImage(Surface &sf, int w, int h, startx = x; 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 r = data[i]; + unsigned char r = data[i] >> 16; unsigned char g = data[i] >> 8; - unsigned char b = data[i] >> 16; + unsigned char b = data[i]; // background color 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; 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); if (++c >= w) { -- 2.45.2