summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/textures.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/textures.c b/src/textures.c
index df7b35be..1a8af614 100644
--- a/src/textures.c
+++ b/src/textures.c
@@ -1107,8 +1107,9 @@ void ImageAlphaClear(Image *image, Color color, float threshold)
if ((image->data == NULL) || (image->width == 0) || (image->height == 0)) return;
Color *pixels = GetImageData(*image);
+ unsigned char thresholdValue = (unsigned char)(threshold*255.0f);
- for (int i = 0; i < image->width*image->height; i++) if (pixels[i].a <= (unsigned char)(threshold*255.0f)) pixels[i] = color;
+ for (int i = 0; i < image->width*image->height; i++) if (pixels[i].a <= thresholdValue) pixels[i] = color;
RL_FREE(image->data);
int format = image->format;