From a081582e3a4c27aede31c170337aed6b5a5309cc Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 27 Apr 2003 17:08:40 +0000 Subject: fix window icon rendering, was using incorrect size. --- render/image.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'render/image.c') diff --git a/render/image.c b/render/image.c index 5bd3285b..bdc51eed 100644 --- a/render/image.c +++ b/render/image.c @@ -2,14 +2,20 @@ #include "../kernel/geom.h" #include "image.h" -void image_draw(pixel32 *target, TextureRGBA *rgba, Rect *position) +void image_draw(pixel32 *target, TextureRGBA *rgba, Rect *position, + Rect *surarea) { unsigned long *draw = rgba->data; int c, sfw, sfh; - unsigned int i, e, bgi; + unsigned int i, e; sfw = position->width; sfh = position->height; + /* it would be nice if this worked, but this function is well broken in these + cercumstances. */ + g_assert(position->width == surarea->width && + position->height == surarea->height); + g_assert(rgba->data != NULL); if ((rgba->width != sfw || rgba->height != sfh) && @@ -42,7 +48,7 @@ void image_draw(pixel32 *target, TextureRGBA *rgba, Rect *position) draw = rgba->cache; /* apply the alpha channel */ - for (i = 0, c = 0, e = sfw*sfh; i < e; ++i, ++bgi) { + for (i = 0, c = 0, e = sfw*sfh; i < e; ++i) { unsigned char alpha = draw[i] >> 24; unsigned char r = draw[i] >> 16; unsigned char g = draw[i] >> 8; -- cgit v1.2.3