From 23a208e8e770740dc66395ad0814fb5f333ede67 Mon Sep 17 00:00:00 2001 From: KonPet <45455208+KonPet@users.noreply.github.com> Date: Sat, 6 Nov 2021 19:04:43 +0100 Subject: [PATCH] Revert "Add DrawTriangleGradient()" This reverts commit b1cfc7672cbf03981eef63f818c72a78383ffe02. --- src/raylib.h | 1 - src/rshapes.c | 41 ----------------------------------------- 2 files changed, 42 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index d31db3c3c..e5453de7e 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1174,7 +1174,6 @@ RLAPI void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) -RLAPI void DrawTriangleGradient(Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3); // Draw a gradient-filled triangle with custom vertex colors (vertex in counter-clockwise order!) RLAPI void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline (vertex in counter-clockwise order!) RLAPI void DrawTriangleFan(Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points (first vertex is the center) RLAPI void DrawTriangleStrip(Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points diff --git a/src/rshapes.c b/src/rshapes.c index 2f95a3c40..9ad5a3d54 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -1323,47 +1323,6 @@ void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color) #endif } -// Draw a gradient-filled triangle -// NOTE: Vertex must be provided in counter-clockwise order -void DrawTriangleGradient(Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3) -{ - rlCheckRenderBatchLimit(4); - -#if defined(SUPPORT_QUADS_DRAW_MODE) - rlSetTexture(texShapes.id); - - rlBegin(RL_QUADS); - - rlColor4ub(c1.r, c1.g, c1.b, c1.a); - rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height); - rlVertex2f(v1.x, v1.y); - - rlColor4ub(c2.r, c2.g, c2.b, c2.a); - rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); - rlVertex2f(v2.x, v2.y); - - rlColor4ub(c2.r, c2.g, c2.b, c2.a); - rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height); - rlVertex2f(v2.x, v2.y); - - rlColor4ub(c3.r, c3.g, c3.b, c3.a); - rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height); - rlVertex2f(v3.x, v3.y); - rlEnd(); - - rlSetTexture(0); -#else - rlBegin(RL_TRIANGLES); - rlColor4ub(c1.r, c1.g, c1.b, c1.a); - rlVertex2f(v1.x, v1.y); - rlColor4ub(c2.r, c2.g, c2.b, c2.a); - rlVertex2f(v2.x, v2.y); - rlColor4ub(c3.r, c3.g, c3.b, c3.a); - rlVertex2f(v3.x, v3.y); - rlEnd(); -#endif -} - // Draw a triangle using lines // NOTE: Vertex must be provided in counter-clockwise order void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color)