mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-20 02:08:14 +00:00
REVIEWED: Avoid some float -> double promotions
This commit is contained in:
@@ -3284,10 +3284,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.0)*((float)tint.r/255.0))*255.0f);
|
||||
colorTint.g = (unsigned char)((((float)color.g/255.0)*((float)tint.g/255.0))*255.0f);
|
||||
colorTint.b = (unsigned char)((((float)color.b/255.0)*((float)tint.b/255.0))*255.0f);
|
||||
colorTint.a = (unsigned char)((((float)color.a/255.0)*((float)tint.a/255.0))*255.0f);
|
||||
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);
|
||||
|
||||
model.materials[model.meshMaterial[i]].maps[MATERIAL_MAP_DIFFUSE].color = colorTint;
|
||||
DrawMesh(model.meshes[i], model.materials[model.meshMaterial[i]], model.transform);
|
||||
@@ -3664,7 +3664,7 @@ RayCollision GetRayCollisionModel(Ray ray, Model model)
|
||||
// NOTE: Based on https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm
|
||||
RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3)
|
||||
{
|
||||
#define EPSILON 0.000001 // A small number
|
||||
#define EPSILON 0.000001f // A small number
|
||||
|
||||
RayCollision collision = { 0 };
|
||||
Vector3 edge1 = { 0 };
|
||||
|
Reference in New Issue
Block a user