Fix color type in DrawGridEx function

This commit is contained in:
Alexander Zubov 2026-05-01 05:09:35 +02:00
parent 82a39b3723
commit 07fe0eb362
2 changed files with 3 additions and 4 deletions

View File

@ -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)

View File

@ -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;