From 07fe0eb362558cd332c03d17236b71cfd68590ba Mon Sep 17 00:00:00 2001 From: Alexander Zubov Date: Fri, 1 May 2026 05:09:35 +0200 Subject: [PATCH] Fix color type in DrawGridEx function --- src/raylib.h | 2 +- src/rmodels.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index 36ca4af0c..4d4e9a51c 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1587,7 +1587,7 @@ RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); RLAPI void DrawPlaneEx(Vector3 centerPos, Vector2 size, Color color, Vector3 normal, Vector3 tangent); // Draw a plane with extended parameters RLAPI void DrawRay(Ray ray, Color color); // Draw a ray line RLAPI void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) -RLAPI void DrawGridEx(int slices, float spacing, Vector3 color, Vector3 position, Vector3 normal, Vector3 tangent); // Draw a grid with extended parameters +RLAPI void DrawGridEx(int slices, float spacing, Color color, Vector3 position, Vector3 normal, Vector3 tangent); // Draw a grid with extended parameters //------------------------------------------------------------------------------------ // Model 3d Loading and Drawing Functions (Module: models) diff --git a/src/rmodels.c b/src/rmodels.c index be8db0946..70aa4caf8 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -1127,7 +1127,7 @@ void DrawGrid(int slices, float spacing) } // Draw a grid with extended parameters -void DrawGridEx(int slices, float spacing, Vector3 color, Vector3 position, Vector3 normal, Vector3 tangent) +void DrawGridEx(int slices, float spacing, Color color, Vector3 position, Vector3 normal, Vector3 tangent) { int halfSlices = slices / 2; @@ -1138,8 +1138,7 @@ void DrawGridEx(int slices, float spacing, Vector3 color, Vector3 position, Vect t = Vector3CrossProduct(n, b); // Ensure normal and tangent vectors are orthogonal rlBegin(RL_LINES); - rlColor3f(color.x, color.y, color.z); - + rlColor4ub(color.r, color.g, color.b, color.a); for (int i = -halfSlices; i <= halfSlices; i++) { float f = (float)i * spacing;