diff options
author | kraxel <kraxel> | 2006-08-13 17:53:48 +0000 |
---|---|---|
committer | kraxel <kraxel> | 2006-08-13 17:53:48 +0000 |
commit | 3e07a22545ccf71b2bdd755b9f308ae52eac334c (patch) | |
tree | a87f481dacfcf3561f0f5b14cbdff09e2c3f8204 /fb-gui.c | |
parent | ea123857b645bacb2c3832e2a39326b3afe3c70d (diff) | |
download | fbida-3e07a22545ccf71b2bdd755b9f308ae52eac334c.tar.gz |
performance tweaks
Diffstat (limited to 'fb-gui.c')
-rw-r--r-- | fb-gui.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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++; } } |