From 7070b70e1b8a76af64fb30bcfacf7510d2d98249 Mon Sep 17 00:00:00 2001 From: Le Juez Victor <90587919+Bigfoot71@users.noreply.github.com> Date: Thu, 23 May 2024 02:33:27 +0200 Subject: [PATCH] simplifies color multiplication `DrawModelEx` --- src/rmodels.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rmodels.c b/src/rmodels.c index 2ef030186..76b9240b5 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -3546,10 +3546,10 @@ void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rota Color color = model.materials[model.meshMaterial[i]].maps[MATERIAL_MAP_DIFFUSE].color; Color colorTint = WHITE; - colorTint.r = (unsigned char)((((float)color.r/255.0f)*((float)tint.r/255.0f))*255.0f); - colorTint.g = (unsigned char)((((float)color.g/255.0f)*((float)tint.g/255.0f))*255.0f); - colorTint.b = (unsigned char)((((float)color.b/255.0f)*((float)tint.b/255.0f))*255.0f); - colorTint.a = (unsigned char)((((float)color.a/255.0f)*((float)tint.a/255.0f))*255.0f); + colorTint.r = (unsigned char)((color.r*tint.r)/255); + colorTint.g = (unsigned char)((color.g*tint.g)/255); + colorTint.b = (unsigned char)((color.b*tint.b)/255); + colorTint.a = (unsigned char)((color.a*tint.a)/255); model.materials[model.meshMaterial[i]].maps[MATERIAL_MAP_DIFFUSE].color = colorTint; DrawMesh(model.meshes[i], model.materials[model.meshMaterial[i]], model.transform);