aboutsummaryrefslogtreecommitdiffstats
path: root/fb-gui.c
diff options
context:
space:
mode:
authorkraxel <kraxel>2006-08-13 17:53:48 +0000
committerkraxel <kraxel>2006-08-13 17:53:48 +0000
commit3e07a22545ccf71b2bdd755b9f308ae52eac334c (patch)
treea87f481dacfcf3561f0f5b14cbdff09e2c3f8204 /fb-gui.c
parentea123857b645bacb2c3832e2a39326b3afe3c70d (diff)
downloadfbida-3e07a22545ccf71b2bdd755b9f308ae52eac334c.tar.gz
performance tweaks
Diffstat (limited to 'fb-gui.c')
-rw-r--r--fb-gui.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fb-gui.c b/fb-gui.c
index 7f87156..2d04685 100644
--- a/fb-gui.c
+++ b/fb-gui.c
@@ -350,8 +350,10 @@ void shadow_merge_rgbdata(int x, int y, int pixels, int weight,
unsigned char *dest = shadow[y] + 3*x;
int i = 3*pixels;
+ weight = weight * 256 / 100;
+
while (i-- > 0)
- *(dest++) += *(rgb++) * weight / 100;
+ *(dest++) += *(rgb++) * weight >> 8;
sdirty[y]++;
}
@@ -376,13 +378,15 @@ void shadow_darkify(int x1, int x2, int y1,int y2, int percent)
if (y2 >= sheight)
y2 = sheight;
+ percent = percent * 256 / 100;
+
for (y = y1; y <= y2; y++) {
sdirty[y]++;
ptr = shadow[y];
ptr += 3*x1;
x = 3*(x2-x1+1);
while (x-- > 0) {
- *ptr = *ptr * percent / 100;
+ *ptr = (*ptr * percent) >> 8;
ptr++;
}
}