summaryrefslogtreecommitdiffhomepage
path: root/src/rtextures.c
diff options
context:
space:
mode:
authorRay <[email protected]>2022-03-20 12:15:51 +0100
committerRay <[email protected]>2022-03-20 12:15:51 +0100
commit0da78307458fd20e3f13260a39042ac416301eaa (patch)
treead8363602e06a4656abc9f1805187b2d9224e132 /src/rtextures.c
parentc65efecf0a24d046d0ed176ca7375afaaba3f18a (diff)
downloadraylib-0da78307458fd20e3f13260a39042ac416301eaa.tar.gz
raylib-0da78307458fd20e3f13260a39042ac416301eaa.zip
REVIEWED: Avoid some float -> double promotions
Diffstat (limited to 'src/rtextures.c')
-rw-r--r--src/rtextures.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rtextures.c b/src/rtextures.c
index 77f40ac5..9c93aedf 100644
--- a/src/rtextures.c
+++ b/src/rtextures.c
@@ -1958,25 +1958,25 @@ void ImageColorContrast(Image *image, float contrast)
for (int x = 0; x < image->width; x++)
{
float pR = (float)pixels[y*image->width + x].r/255.0f;
- pR -= 0.5;
+ pR -= 0.5f;
pR *= contrast;
- pR += 0.5;
+ pR += 0.5f;
pR *= 255;
if (pR < 0) pR = 0;
if (pR > 255) pR = 255;
float pG = (float)pixels[y*image->width + x].g/255.0f;
- pG -= 0.5;
+ pG -= 0.5f;
pG *= contrast;
- pG += 0.5;
+ pG += 0.5f;
pG *= 255;
if (pG < 0) pG = 0;
if (pG > 255) pG = 255;
float pB = (float)pixels[y*image->width + x].b/255.0f;
- pB -= 0.5;
+ pB -= 0.5f;
pB *= contrast;
- pB += 0.5;
+ pB += 0.5f;
pB *= 255;
if (pB < 0) pB = 0;
if (pB > 255) pB = 255;