Browse Source

[rmodels] Multiplication of colors in `DrawModelEx` which can be simplified (#4002)

* simplifies color multiplication `DrawModelEx`

* add explicit casts
pull/4012/head
Le Juez Victor 7 months ago
committed by GitHub
parent
commit
797de0f9ad
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      src/rmodels.c

+ 4
- 4
src/rmodels.c View File

@ -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)(((p">(float)color.r/255.0f)*((float)tint.ro">/255.0f))*255.0f);
colorTint.g = (unsigned char)(((p">(float)color.g/255.0f)*((float)tint.go">/255.0f))*255.0f);
colorTint.b = (unsigned char)(((p">(float)color.b/255.0f)*((float)tint.bo">/255.0f))*255.0f);
colorTint.a = (unsigned char)(((p">(float)color.a/255.0f)*((float)tint.ao">/255.0f))*255.0f);
colorTint.r = (unsigned char)(((kt">int)color.r*(int)tint.rp">)/255);
colorTint.g = (unsigned char)(((kt">int)color.g*(int)tint.gp">)/255);
colorTint.b = (unsigned char)(((kt">int)color.b*(int)tint.bp">)/255);
colorTint.a = (unsigned char)(((kt">int)color.a*(int)tint.ap">)/255);
model.materials[model.meshMaterial[i]].maps[MATERIAL_MAP_DIFFUSE].color = colorTint;
DrawMesh(model.meshes[i], model.materials[model.meshMaterial[i]], model.transform);

Loading…
Cancel
Save