summaryrefslogtreecommitdiff
path: root/render/image.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-04-27 17:08:40 +0000
committerDana Jansens <danakj@orodu.net>2003-04-27 17:08:40 +0000
commita081582e3a4c27aede31c170337aed6b5a5309cc (patch)
treef3e87d5ec7330dd1740eebf0a0cbdee8be947fb4 /render/image.c
parent02c7f2e8afbfe5ebc589415a87a2ac156c9ef5af (diff)
fix window icon rendering, was using incorrect size.
Diffstat (limited to 'render/image.c')
-rw-r--r--render/image.c12
1 files changed, 9 insertions, 3 deletions
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;