created DrawRectangleRoundedPro and DrawRectangleRoundedLinesPro
DrawRectangleRoundedLinesPro and DrawRectangleRoundedLinesPro have options to selected what corners to be rounded. Existing code won't break because the default options are all `true`
This commit is contained in:
parent
c7bda3d10f
commit
1474008f74
|
|
@ -2,9 +2,10 @@
|
||||||
*
|
*
|
||||||
* raylib [shapes] example - draw rectangle rounded (with gui options)
|
* raylib [shapes] example - draw rectangle rounded (with gui options)
|
||||||
*
|
*
|
||||||
* Example originally created with raylib 2.5, last time updated with raylib 2.5
|
* Example originally created with raylib 2.5, last time updated with raylib 5.1
|
||||||
*
|
*
|
||||||
* Example contributed by Vlad Adrian (@demizdor) and reviewed by Ramon Santamaria (@raysan5)
|
* Example contributed by Vlad Adrian (@demizdor) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
|
* Example extended to DrawRectangleRoundedPro and DrawRectangleRoundedLinesPro by Bruno Cabral (github.com/brccabral)
|
||||||
*
|
*
|
||||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||||
* BSD-like license that allows static linking with closed source software
|
* BSD-like license that allows static linking with closed source software
|
||||||
|
|
@ -26,7 +27,7 @@ int main(void)
|
||||||
// Initialization
|
// Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
const int screenWidth = 800;
|
const int screenWidth = 800;
|
||||||
const int screenHeight = 450;
|
const int screenHeight = 550;
|
||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - draw rectangle rounded");
|
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - draw rectangle rounded");
|
||||||
|
|
||||||
|
|
@ -40,6 +41,11 @@ int main(void)
|
||||||
bool drawRoundedRect = true;
|
bool drawRoundedRect = true;
|
||||||
bool drawRoundedLines = false;
|
bool drawRoundedLines = false;
|
||||||
|
|
||||||
|
bool topLeft = true;
|
||||||
|
bool topRight = true;
|
||||||
|
bool bottomLeft = true;
|
||||||
|
bool bottomRight = true;
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
@ -61,8 +67,8 @@ int main(void)
|
||||||
DrawRectangle(560, 0, GetScreenWidth() - 500, GetScreenHeight(), Fade(LIGHTGRAY, 0.3f));
|
DrawRectangle(560, 0, GetScreenWidth() - 500, GetScreenHeight(), Fade(LIGHTGRAY, 0.3f));
|
||||||
|
|
||||||
if (drawRect) DrawRectangleRec(rec, Fade(GOLD, 0.6f));
|
if (drawRect) DrawRectangleRec(rec, Fade(GOLD, 0.6f));
|
||||||
if (drawRoundedRect) DrawRectangleRounded(rec, roundness, (int)segments, Fade(MAROON, 0.2f));
|
if (drawRoundedRect) DrawRectangleRoundedPro(rec, roundness, (int)segments, Fade(MAROON, 0.2f), topLeft, topRight, bottomLeft, bottomRight);
|
||||||
if (drawRoundedLines) DrawRectangleRoundedLinesEx(rec, roundness, (int)segments, lineThick, Fade(MAROON, 0.4f));
|
if (drawRoundedLines) DrawRectangleRoundedLinesPro(rec, roundness, (int)segments, lineThick, Fade(MAROON, 0.4f), topLeft, topRight, bottomLeft, bottomRight);
|
||||||
|
|
||||||
// Draw GUI controls
|
// Draw GUI controls
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
@ -75,6 +81,11 @@ int main(void)
|
||||||
GuiCheckBox((Rectangle){ 640, 320, 20, 20 }, "DrawRoundedRect", &drawRoundedRect);
|
GuiCheckBox((Rectangle){ 640, 320, 20, 20 }, "DrawRoundedRect", &drawRoundedRect);
|
||||||
GuiCheckBox((Rectangle){ 640, 350, 20, 20 }, "DrawRoundedLines", &drawRoundedLines);
|
GuiCheckBox((Rectangle){ 640, 350, 20, 20 }, "DrawRoundedLines", &drawRoundedLines);
|
||||||
GuiCheckBox((Rectangle){ 640, 380, 20, 20}, "DrawRect", &drawRect);
|
GuiCheckBox((Rectangle){ 640, 380, 20, 20}, "DrawRect", &drawRect);
|
||||||
|
|
||||||
|
GuiCheckBox((Rectangle){ 640, 410, 20, 20 }, "TopLeft", &topLeft);
|
||||||
|
GuiCheckBox((Rectangle){ 640, 440, 20, 20 }, "TopRight", &topRight);
|
||||||
|
GuiCheckBox((Rectangle){ 640, 470, 20, 20 }, "BottomLeft", &bottomLeft);
|
||||||
|
GuiCheckBox((Rectangle){ 640, 500, 20, 20 }, "BottomRight", &bottomRight);
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
DrawText(TextFormat("MODE: %s", (segments >= 4)? "MANUAL" : "AUTO"), 640, 280, 10, (segments >= 4)? MAROON : DARKGRAY);
|
DrawText(TextFormat("MODE: %s", (segments >= 4)? "MANUAL" : "AUTO"), 640, 280, 10, (segments >= 4)? MAROON : DARKGRAY);
|
||||||
|
|
|
||||||
|
|
@ -1256,8 +1256,10 @@ RLAPI void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color
|
||||||
RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline
|
RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline
|
||||||
RLAPI void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); // Draw rectangle outline with extended parameters
|
RLAPI void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); // Draw rectangle outline with extended parameters
|
||||||
RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges
|
RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges
|
||||||
|
RLAPI void DrawRectangleRoundedPro(Rectangle rec, float roundness, int segments, Color color, bool topLeft, bool topRight, bool bottomLeft, bool bottomRight); // Draw rectangle with rounded edges on selected corners
|
||||||
RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle lines with rounded edges
|
RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle lines with rounded edges
|
||||||
RLAPI void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline
|
RLAPI void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline
|
||||||
|
RLAPI void DrawRectangleRoundedLinesPro(Rectangle rec, float roundness, int segments, float lineThick, Color color, bool topLeft, bool topRight, bool bottomLeft, bool bottomRight); // Draw rectangle with rounded edges outline on selected corners
|
||||||
RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!)
|
RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle (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 DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline (vertex in counter-clockwise order!)
|
||||||
RLAPI void DrawTriangleFan(const Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points (first vertex is the center)
|
RLAPI void DrawTriangleFan(const Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points (first vertex is the center)
|
||||||
|
|
|
||||||
42
src/rlgl.h
42
src/rlgl.h
|
|
@ -789,6 +789,15 @@ RLAPI void rlSetMatrixViewOffsetStereo(Matrix right, Matrix left); // Set
|
||||||
RLAPI void rlLoadDrawCube(void); // Load and draw a cube
|
RLAPI void rlLoadDrawCube(void); // Load and draw a cube
|
||||||
RLAPI void rlLoadDrawQuad(void); // Load and draw a quad
|
RLAPI void rlLoadDrawQuad(void); // Load and draw a quad
|
||||||
|
|
||||||
|
// Shapes
|
||||||
|
RLAPI void rlLine(Vector2 p1, Vector2 p2, Color color);
|
||||||
|
#if defined(SUPPORT_QUADS_DRAW_MODE)
|
||||||
|
RLAPI void rlRectangle(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, Color color, Rectangle shapeRect, Texture2D texShapes);
|
||||||
|
#else
|
||||||
|
RLAPI void rlRectangle(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, Color color);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -5118,4 +5127,37 @@ static Matrix rlMatrixInvert(Matrix mat)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void rlLine(Vector2 p1, Vector2 p2, Color color)
|
||||||
|
{
|
||||||
|
rlColor4ub(color.r, color.g, color.b, color.a);
|
||||||
|
rlVertex2f(p1.x, p1.y);
|
||||||
|
rlVertex2f(p2.x, p2.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(SUPPORT_QUADS_DRAW_MODE)
|
||||||
|
void rlRectangle(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, Color color, Rectangle shapeRect, Texture2D texShapes)
|
||||||
|
{
|
||||||
|
rlColor4ub(color.r, color.g, color.b, color.a);
|
||||||
|
rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height);
|
||||||
|
rlVertex2f(p1.x, p1.y);
|
||||||
|
rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
|
||||||
|
rlVertex2f(p2.x, p2.y);
|
||||||
|
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
|
||||||
|
rlVertex2f(p3.x, p3.y);
|
||||||
|
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height);
|
||||||
|
rlVertex2f(p4.x, p4.y);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
void rlRectangle(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, Color color)
|
||||||
|
{
|
||||||
|
rlColor4ub(color.r, color.g, color.b, color.a);
|
||||||
|
rlVertex2f(p1.x, p1.y);
|
||||||
|
rlVertex2f(p2.x, p2.y);
|
||||||
|
rlVertex2f(p3.x, p3.y);
|
||||||
|
rlVertex2f(p4.x, p4.y);
|
||||||
|
rlVertex2f(p1.x, p1.y);
|
||||||
|
rlVertex2f(p3.x, p3.y);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // RLGL_IMPLEMENTATION
|
#endif // RLGL_IMPLEMENTATION
|
||||||
|
|
|
||||||
377
src/rshapes.c
377
src/rshapes.c
|
|
@ -862,9 +862,15 @@ void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color)
|
||||||
|
|
||||||
// Draw rectangle with rounded edges
|
// Draw rectangle with rounded edges
|
||||||
void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color)
|
void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color)
|
||||||
|
{
|
||||||
|
DrawRectangleRoundedPro(rec, roundness, segments, color, true, true, true, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw rectangle with rounded edges on selected corners
|
||||||
|
void DrawRectangleRoundedPro(Rectangle rec, float roundness, int segments, Color color, bool topLeft, bool topRight, bool bottomLeft, bool bottomRight)
|
||||||
{
|
{
|
||||||
// Not a rounded rectangle
|
// Not a rounded rectangle
|
||||||
if ((roundness <= 0.0f) || (rec.width < 1) || (rec.height < 1 ))
|
if ((roundness <= 0.0f) || (rec.width < 1) || (rec.height < 1 ) || (!topLeft && !topRight && !bottomLeft && !bottomRight))
|
||||||
{
|
{
|
||||||
DrawRectangleRec(rec, color);
|
DrawRectangleRec(rec, color);
|
||||||
return;
|
return;
|
||||||
|
|
@ -912,16 +918,41 @@ void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color co
|
||||||
{(float)(rec.x + rec.width) - radius, (float)(rec.y + rec.height) - radius}, {(float)rec.x + radius, (float)(rec.y + rec.height) - radius} // P10, P11
|
{(float)(rec.x + rec.width) - radius, (float)(rec.y + rec.height) - radius}, {(float)rec.x + radius, (float)(rec.y + rec.height) - radius} // P10, P11
|
||||||
};
|
};
|
||||||
|
|
||||||
const Vector2 centers[4] = { point[8], point[9], point[10], point[11] };
|
Vector2 centers[4];
|
||||||
const float angles[4] = { 180.0f, 270.0f, 0.0f, 90.0f };
|
float angles[4];
|
||||||
|
int countCenters = 0;
|
||||||
|
if (topLeft)
|
||||||
|
{
|
||||||
|
centers[countCenters] = point[8];
|
||||||
|
angles[countCenters] = 180.0f;
|
||||||
|
++countCenters;
|
||||||
|
}
|
||||||
|
if (topRight)
|
||||||
|
{
|
||||||
|
centers[countCenters] = point[9];
|
||||||
|
angles[countCenters] = 270.0f;
|
||||||
|
++countCenters;
|
||||||
|
}
|
||||||
|
if (bottomRight)
|
||||||
|
{
|
||||||
|
centers[countCenters] = point[10];
|
||||||
|
angles[countCenters] = 0.0f;
|
||||||
|
++countCenters;
|
||||||
|
}
|
||||||
|
if (bottomLeft)
|
||||||
|
{
|
||||||
|
centers[countCenters] = point[11];
|
||||||
|
angles[countCenters] = 90.0f;
|
||||||
|
++countCenters;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(SUPPORT_QUADS_DRAW_MODE)
|
#if defined(SUPPORT_QUADS_DRAW_MODE)
|
||||||
rlSetTexture(GetShapesTexture().id);
|
rlSetTexture(GetShapesTexture().id);
|
||||||
Rectangle shapeRect = GetShapesTextureRectangle();
|
Rectangle shapeRect = GetShapesTextureRectangle();
|
||||||
|
|
||||||
rlBegin(RL_QUADS);
|
rlBegin(RL_QUADS);
|
||||||
// Draw all the 4 corners: [1] Upper Left Corner, [3] Upper Right Corner, [5] Lower Right Corner, [7] Lower Left Corner
|
// Draw the selected corners
|
||||||
for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop
|
for (int k = 0; k < countCenters; ++k) // Hope the compiler is smart enough to unroll this loop
|
||||||
{
|
{
|
||||||
float angle = angles[k];
|
float angle = angles[k];
|
||||||
const Vector2 center = centers[k];
|
const Vector2 center = centers[k];
|
||||||
|
|
@ -963,68 +994,46 @@ void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color co
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!topLeft)
|
||||||
|
{
|
||||||
|
rlRectangle((Vector2) {point[7].x, point[0].y}, point[7], point[8], point[0], color, shapeRect, texShapes);
|
||||||
|
}
|
||||||
|
if (!topRight)
|
||||||
|
{
|
||||||
|
rlRectangle(point[1], point[9], point[2], (Vector2) {point[2].x, point[1].y}, color, shapeRect, texShapes);
|
||||||
|
}
|
||||||
|
if (!bottomLeft)
|
||||||
|
{
|
||||||
|
rlRectangle(point[6], (Vector2) {point[6].x, point[5].y}, point[5], point[11], color, shapeRect, texShapes);
|
||||||
|
}
|
||||||
|
if (!bottomRight)
|
||||||
|
{
|
||||||
|
rlRectangle(point[10], point[4], (Vector2) {point[3].x, point[4].y}, point[3], color, shapeRect, texShapes);
|
||||||
|
}
|
||||||
|
|
||||||
// [2] Upper Rectangle
|
// [2] Upper Rectangle
|
||||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
rlRectangle(point[0], point[8], point[9], point[1], color, shapeRect, texShapes);
|
||||||
rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height);
|
|
||||||
rlVertex2f(point[0].x, point[0].y);
|
|
||||||
rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
|
|
||||||
rlVertex2f(point[8].x, point[8].y);
|
|
||||||
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
|
|
||||||
rlVertex2f(point[9].x, point[9].y);
|
|
||||||
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height);
|
|
||||||
rlVertex2f(point[1].x, point[1].y);
|
|
||||||
|
|
||||||
// [4] Right Rectangle
|
// [4] Right Rectangle
|
||||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
rlRectangle(point[9], point[10], point[3], point[2], color, shapeRect, texShapes);
|
||||||
rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height);
|
|
||||||
rlVertex2f(point[2].x, point[2].y);
|
|
||||||
rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
|
|
||||||
rlVertex2f(point[9].x, point[9].y);
|
|
||||||
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
|
|
||||||
rlVertex2f(point[10].x, point[10].y);
|
|
||||||
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height);
|
|
||||||
rlVertex2f(point[3].x, point[3].y);
|
|
||||||
|
|
||||||
// [6] Bottom Rectangle
|
// [6] Bottom Rectangle
|
||||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
rlRectangle(point[11], point[5], point[4], point[10], color, shapeRect, texShapes);
|
||||||
rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height);
|
|
||||||
rlVertex2f(point[11].x, point[11].y);
|
|
||||||
rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
|
|
||||||
rlVertex2f(point[5].x, point[5].y);
|
|
||||||
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
|
|
||||||
rlVertex2f(point[4].x, point[4].y);
|
|
||||||
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height);
|
|
||||||
rlVertex2f(point[10].x, point[10].y);
|
|
||||||
|
|
||||||
// [8] Left Rectangle
|
// [8] Left Rectangle
|
||||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
rlRectangle(point[7], point[6], point[11], point[8], color, shapeRect, texShapes);
|
||||||
rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height);
|
|
||||||
rlVertex2f(point[7].x, point[7].y);
|
|
||||||
rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
|
|
||||||
rlVertex2f(point[6].x, point[6].y);
|
|
||||||
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
|
|
||||||
rlVertex2f(point[11].x, point[11].y);
|
|
||||||
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height);
|
|
||||||
rlVertex2f(point[8].x, point[8].y);
|
|
||||||
|
|
||||||
// [9] Middle Rectangle
|
// [9] Middle Rectangle
|
||||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
rlRectangle(point[8], point[11], point[10], point[9], color, shapeRect, texShapes);
|
||||||
rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height);
|
|
||||||
rlVertex2f(point[8].x, point[8].y);
|
|
||||||
rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
|
|
||||||
rlVertex2f(point[11].x, point[11].y);
|
|
||||||
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
|
|
||||||
rlVertex2f(point[10].x, point[10].y);
|
|
||||||
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height);
|
|
||||||
rlVertex2f(point[9].x, point[9].y);
|
|
||||||
|
|
||||||
rlEnd();
|
rlEnd();
|
||||||
rlSetTexture(0);
|
rlSetTexture(0);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
rlBegin(RL_TRIANGLES);
|
rlBegin(RL_TRIANGLES);
|
||||||
|
|
||||||
// Draw all of the 4 corners: [1] Upper Left Corner, [3] Upper Right Corner, [5] Lower Right Corner, [7] Lower Left Corner
|
// Draw the selected corners
|
||||||
for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop
|
for (int k = 0; k < countCenters; ++k) // Hope the compiler is smart enough to unroll this loop
|
||||||
{
|
{
|
||||||
float angle = angles[k];
|
float angle = angles[k];
|
||||||
const Vector2 center = centers[k];
|
const Vector2 center = centers[k];
|
||||||
|
|
@ -1038,52 +1047,42 @@ void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color co
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!topLeft)
|
||||||
|
{
|
||||||
|
rlRectangle((Vector2) {point[7].x, point[0].y}, point[7], point[8], point[0], color);
|
||||||
|
}
|
||||||
|
if (!topRight)
|
||||||
|
{
|
||||||
|
rlRectangle(point[1], point[9], point[2], (Vector2) {point[2].x, point[1].y}, color);
|
||||||
|
}
|
||||||
|
if (!bottomLeft)
|
||||||
|
{
|
||||||
|
rlRectangle(point[6], (Vector2) {point[6].x, point[5].y}, point[5], point[11], color);
|
||||||
|
}
|
||||||
|
if (!bottomRight)
|
||||||
|
{
|
||||||
|
rlRectangle(point[10], point[4], (Vector2) {point[3].x, point[4].y}, point[3], color);
|
||||||
|
}
|
||||||
|
|
||||||
// [2] Upper Rectangle
|
// [2] Upper Rectangle
|
||||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
rlRectangle(point[0], point[8], point[9], point[1], color);
|
||||||
rlVertex2f(point[0].x, point[0].y);
|
|
||||||
rlVertex2f(point[8].x, point[8].y);
|
|
||||||
rlVertex2f(point[9].x, point[9].y);
|
|
||||||
rlVertex2f(point[1].x, point[1].y);
|
|
||||||
rlVertex2f(point[0].x, point[0].y);
|
|
||||||
rlVertex2f(point[9].x, point[9].y);
|
|
||||||
|
|
||||||
// [4] Right Rectangle
|
// [4] Right Rectangle
|
||||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
rlRectangle(point[9], point[10], point[3], point[2], color);
|
||||||
rlVertex2f(point[9].x, point[9].y);
|
|
||||||
rlVertex2f(point[10].x, point[10].y);
|
|
||||||
rlVertex2f(point[3].x, point[3].y);
|
|
||||||
rlVertex2f(point[2].x, point[2].y);
|
|
||||||
rlVertex2f(point[9].x, point[9].y);
|
|
||||||
rlVertex2f(point[3].x, point[3].y);
|
|
||||||
|
|
||||||
// [6] Bottom Rectangle
|
// [6] Bottom Rectangle
|
||||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
rlRectangle(point[11], point[5], point[4], point[10], color);
|
||||||
rlVertex2f(point[11].x, point[11].y);
|
|
||||||
rlVertex2f(point[5].x, point[5].y);
|
|
||||||
rlVertex2f(point[4].x, point[4].y);
|
|
||||||
rlVertex2f(point[10].x, point[10].y);
|
|
||||||
rlVertex2f(point[11].x, point[11].y);
|
|
||||||
rlVertex2f(point[4].x, point[4].y);
|
|
||||||
|
|
||||||
// [8] Left Rectangle
|
// [8] Left Rectangle
|
||||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
rlRectangle(point[7], point[6], point[11], point[8], color);
|
||||||
rlVertex2f(point[7].x, point[7].y);
|
|
||||||
rlVertex2f(point[6].x, point[6].y);
|
|
||||||
rlVertex2f(point[11].x, point[11].y);
|
|
||||||
rlVertex2f(point[8].x, point[8].y);
|
|
||||||
rlVertex2f(point[7].x, point[7].y);
|
|
||||||
rlVertex2f(point[11].x, point[11].y);
|
|
||||||
|
|
||||||
// [9] Middle Rectangle
|
// [9] Middle Rectangle
|
||||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
rlRectangle(point[8], point[11], point[10], point[9], color);
|
||||||
rlVertex2f(point[8].x, point[8].y);
|
|
||||||
rlVertex2f(point[11].x, point[11].y);
|
|
||||||
rlVertex2f(point[10].x, point[10].y);
|
|
||||||
rlVertex2f(point[9].x, point[9].y);
|
|
||||||
rlVertex2f(point[8].x, point[8].y);
|
|
||||||
rlVertex2f(point[10].x, point[10].y);
|
|
||||||
rlEnd();
|
rlEnd();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw rectangle with rounded edges
|
// Draw rectangle with rounded edges
|
||||||
|
|
@ -1095,11 +1094,17 @@ void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, Col
|
||||||
|
|
||||||
// Draw rectangle with rounded edges outline
|
// Draw rectangle with rounded edges outline
|
||||||
void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, float lineThick, Color color)
|
void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, float lineThick, Color color)
|
||||||
|
{
|
||||||
|
DrawRectangleRoundedLinesPro(rec, roundness, segments, lineThick, color, true, true, true, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw rectangle with rounded edges outline
|
||||||
|
void DrawRectangleRoundedLinesPro(Rectangle rec, float roundness, int segments, float lineThick, Color color, bool topLeft, bool topRight, bool bottomLeft, bool bottomRight)
|
||||||
{
|
{
|
||||||
if (lineThick < 0) lineThick = 0;
|
if (lineThick < 0) lineThick = 0;
|
||||||
|
|
||||||
// Not a rounded rectangle
|
// Not a rounded rectangle
|
||||||
if (roundness <= 0.0f)
|
if (roundness <= 0.0f || (!topLeft && !topRight && !bottomLeft && !bottomRight))
|
||||||
{
|
{
|
||||||
DrawRectangleLinesEx((Rectangle){rec.x-lineThick, rec.y-lineThick, rec.width+2*lineThick, rec.height+2*lineThick}, lineThick, color);
|
DrawRectangleLinesEx((Rectangle){rec.x-lineThick, rec.y-lineThick, rec.width+2*lineThick, rec.height+2*lineThick}, lineThick, color);
|
||||||
return;
|
return;
|
||||||
|
|
@ -1149,12 +1154,34 @@ void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, f
|
||||||
{ rec.x, (float)(rec.y + rec.height) - innerRadius}, {rec.x, (float)rec.y + innerRadius} // P14, P15
|
{ rec.x, (float)(rec.y + rec.height) - innerRadius}, {rec.x, (float)rec.y + innerRadius} // P14, P15
|
||||||
};
|
};
|
||||||
|
|
||||||
const Vector2 centers[4] = {
|
Vector2 centers[4];
|
||||||
{(float)rec.x + innerRadius, (float)rec.y + innerRadius}, {(float)(rec.x + rec.width) - innerRadius, (float)rec.y + innerRadius}, // P16, P17
|
float angles[4];
|
||||||
{(float)(rec.x + rec.width) - innerRadius, (float)(rec.y + rec.height) - innerRadius}, {(float)rec.x + innerRadius, (float)(rec.y + rec.height) - innerRadius} // P18, P19
|
int countCenters = 0;
|
||||||
};
|
|
||||||
|
|
||||||
const float angles[4] = { 180.0f, 270.0f, 0.0f, 90.0f };
|
if (topLeft)
|
||||||
|
{
|
||||||
|
centers[countCenters] = (Vector2) {(float)rec.x + innerRadius, (float)rec.y + innerRadius}; // P16
|
||||||
|
angles[countCenters] = 180.0f;
|
||||||
|
++countCenters;
|
||||||
|
}
|
||||||
|
if (topRight)
|
||||||
|
{
|
||||||
|
centers[countCenters] = (Vector2) {(float)(rec.x + rec.width) - innerRadius, (float)rec.y + innerRadius}; // P17
|
||||||
|
angles[countCenters] = 270.0f;
|
||||||
|
++countCenters;
|
||||||
|
}
|
||||||
|
if (bottomRight)
|
||||||
|
{
|
||||||
|
centers[countCenters] = (Vector2) {(float)(rec.x + rec.width) - innerRadius, (float)(rec.y + rec.height) - innerRadius}; // P18
|
||||||
|
angles[countCenters] = 0.0f;
|
||||||
|
++countCenters;
|
||||||
|
}
|
||||||
|
if (bottomLeft)
|
||||||
|
{
|
||||||
|
centers[countCenters] = (Vector2) {(float)rec.x + innerRadius, (float)(rec.y + rec.height) - innerRadius}; // P19
|
||||||
|
angles[countCenters] = 90.0f;
|
||||||
|
++countCenters;
|
||||||
|
}
|
||||||
|
|
||||||
if (lineThick > 1)
|
if (lineThick > 1)
|
||||||
{
|
{
|
||||||
|
|
@ -1164,8 +1191,8 @@ void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, f
|
||||||
|
|
||||||
rlBegin(RL_QUADS);
|
rlBegin(RL_QUADS);
|
||||||
|
|
||||||
// Draw all the 4 corners first: Upper Left Corner, Upper Right Corner, Lower Right Corner, Lower Left Corner
|
// Draw the selected corners
|
||||||
for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop
|
for (int k = 0; k < countCenters; ++k) // Hope the compiler is smart enough to unroll this loop
|
||||||
{
|
{
|
||||||
float angle = angles[k];
|
float angle = angles[k];
|
||||||
const Vector2 center = centers[k];
|
const Vector2 center = centers[k];
|
||||||
|
|
@ -1189,57 +1216,45 @@ void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Draw horizontal corner and vertical corner
|
||||||
|
if (!topLeft)
|
||||||
|
{
|
||||||
|
rlRectangle((Vector2) {point[7].x, point[0].y}, (Vector2) {point[7].x, point[8].y}, point[8], point[0], color, shapeRect, texShapes);
|
||||||
|
rlRectangle((Vector2) {point[7].x, point[8].y}, point[7], point[15], (Vector2) {point[15].x, point[8].y}, color, shapeRect, texShapes);
|
||||||
|
}
|
||||||
|
if (!topRight)
|
||||||
|
{
|
||||||
|
rlRectangle(point[1], point[9], (Vector2) {point[2].x, point[9].y}, (Vector2) {point[2].x, point[1].y}, color, shapeRect, texShapes);
|
||||||
|
rlRectangle( (Vector2) {point[10].x, point[9].y}, point[10], point[2], (Vector2) {point[2].x, point[9].y}, color, shapeRect, texShapes);
|
||||||
|
}
|
||||||
|
if (!bottomLeft)
|
||||||
|
{
|
||||||
|
rlRectangle( (Vector2) {point[6].x, point[13].y}, (Vector2) {point[6].x, point[5].y}, point[5], point[13], color, shapeRect, texShapes);
|
||||||
|
rlRectangle( point[6], (Vector2) {point[6].x, point[13].y}, (Vector2) {point[14].x, point[13].y}, point[14], color, shapeRect, texShapes);
|
||||||
|
}
|
||||||
|
if (!bottomRight)
|
||||||
|
{
|
||||||
|
rlRectangle( point[12], point[4], (Vector2) {point[3].x, point[4].y}, (Vector2) {point[3].x, point[12].y}, color, shapeRect, texShapes);
|
||||||
|
rlRectangle( point[11], (Vector2) {point[11].x, point[12].y}, (Vector2) {point[3].x, point[12].y}, point[3], color, shapeRect, texShapes);
|
||||||
|
}
|
||||||
|
|
||||||
// Upper rectangle
|
// Upper rectangle
|
||||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
rlRectangle( point[0], point[8], point[9], point[1], color, shapeRect, texShapes);
|
||||||
rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height);
|
|
||||||
rlVertex2f(point[0].x, point[0].y);
|
|
||||||
rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
|
|
||||||
rlVertex2f(point[8].x, point[8].y);
|
|
||||||
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
|
|
||||||
rlVertex2f(point[9].x, point[9].y);
|
|
||||||
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height);
|
|
||||||
rlVertex2f(point[1].x, point[1].y);
|
|
||||||
|
|
||||||
// Right rectangle
|
// Right rectangle
|
||||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
rlRectangle( point[10], point[11], point[3], point[2], color, shapeRect, texShapes);
|
||||||
rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height);
|
|
||||||
rlVertex2f(point[2].x, point[2].y);
|
|
||||||
rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
|
|
||||||
rlVertex2f(point[10].x, point[10].y);
|
|
||||||
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
|
|
||||||
rlVertex2f(point[11].x, point[11].y);
|
|
||||||
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height);
|
|
||||||
rlVertex2f(point[3].x, point[3].y);
|
|
||||||
|
|
||||||
// Lower rectangle
|
// Lower rectangle
|
||||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
rlRectangle( point[13], point[5], point[4], point[12], color, shapeRect, texShapes);
|
||||||
rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height);
|
|
||||||
rlVertex2f(point[13].x, point[13].y);
|
|
||||||
rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
|
|
||||||
rlVertex2f(point[5].x, point[5].y);
|
|
||||||
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
|
|
||||||
rlVertex2f(point[4].x, point[4].y);
|
|
||||||
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height);
|
|
||||||
rlVertex2f(point[12].x, point[12].y);
|
|
||||||
|
|
||||||
// Left rectangle
|
// Left rectangle
|
||||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
rlRectangle( point[7], point[6], point[14], point[15], color, shapeRect, texShapes);
|
||||||
rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height);
|
|
||||||
rlVertex2f(point[15].x, point[15].y);
|
|
||||||
rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
|
|
||||||
rlVertex2f(point[7].x, point[7].y);
|
|
||||||
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
|
|
||||||
rlVertex2f(point[6].x, point[6].y);
|
|
||||||
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height);
|
|
||||||
rlVertex2f(point[14].x, point[14].y);
|
|
||||||
|
|
||||||
rlEnd();
|
rlEnd();
|
||||||
rlSetTexture(0);
|
rlSetTexture(0);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
rlBegin(RL_TRIANGLES);
|
rlBegin(RL_TRIANGLES);
|
||||||
|
|
||||||
// Draw all of the 4 corners first: Upper Left Corner, Upper Right Corner, Lower Right Corner, Lower Left Corner
|
// Draw the selected corners
|
||||||
for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop
|
for (int k = 0; k < countCenters; ++k) // Hope the compiler is smart enough to unroll this loop
|
||||||
{
|
{
|
||||||
float angle = angles[k];
|
float angle = angles[k];
|
||||||
const Vector2 center = centers[k];
|
const Vector2 center = centers[k];
|
||||||
|
|
@ -1260,41 +1275,37 @@ void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Draw horizontal corner and vertical corner
|
||||||
|
if (!topLeft)
|
||||||
|
{
|
||||||
|
rlRectangle((Vector2) {point[7].x, point[0].y}, (Vector2) {point[7].x, point[8].y}, point[8], point[0], color);
|
||||||
|
rlRectangle((Vector2) {point[7].x, point[8].y}, point[7], point[15], (Vector2) {point[15].x, point[8].y}, color);
|
||||||
|
}
|
||||||
|
if (!topRight)
|
||||||
|
{
|
||||||
|
rlRectangle(point[1], point[9], (Vector2) {point[2].x, point[9].y}, (Vector2) {point[2].x, point[1].y}, color);
|
||||||
|
rlRectangle( (Vector2) {point[10].x, point[9].y}, point[10], point[2], (Vector2) {point[2].x, point[9].y}, color);
|
||||||
|
}
|
||||||
|
if (!bottomLeft)
|
||||||
|
{
|
||||||
|
rlRectangle( (Vector2) {point[6].x, point[13].y}, (Vector2) {point[6].x, point[5].y}, point[5], point[13], color);
|
||||||
|
rlRectangle( point[6], (Vector2) {point[6].x, point[13].y}, (Vector2) {point[14].x, point[13].y}, point[14], color);
|
||||||
|
}
|
||||||
|
if (!bottomRight)
|
||||||
|
{
|
||||||
|
rlRectangle( point[12], point[4], (Vector2) {point[3].x, point[4].y}, (Vector2) {point[3].x, point[12].y}, color);
|
||||||
|
rlRectangle( point[11], (Vector2) {point[11].x, point[12].y}, (Vector2) {point[3].x, point[12].y}, point[3], color);
|
||||||
|
}
|
||||||
|
|
||||||
// Upper rectangle
|
// Upper rectangle
|
||||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
rlRectangle( point[0], point[8], point[9], point[1], color);
|
||||||
rlVertex2f(point[0].x, point[0].y);
|
|
||||||
rlVertex2f(point[8].x, point[8].y);
|
|
||||||
rlVertex2f(point[9].x, point[9].y);
|
|
||||||
rlVertex2f(point[1].x, point[1].y);
|
|
||||||
rlVertex2f(point[0].x, point[0].y);
|
|
||||||
rlVertex2f(point[9].x, point[9].y);
|
|
||||||
|
|
||||||
// Right rectangle
|
// Right rectangle
|
||||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
rlRectangle( point[10], point[11], point[3], point[2], color);
|
||||||
rlVertex2f(point[10].x, point[10].y);
|
|
||||||
rlVertex2f(point[11].x, point[11].y);
|
|
||||||
rlVertex2f(point[3].x, point[3].y);
|
|
||||||
rlVertex2f(point[2].x, point[2].y);
|
|
||||||
rlVertex2f(point[10].x, point[10].y);
|
|
||||||
rlVertex2f(point[3].x, point[3].y);
|
|
||||||
|
|
||||||
// Lower rectangle
|
// Lower rectangle
|
||||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
rlRectangle( point[13], point[5], point[4], point[12], color);
|
||||||
rlVertex2f(point[13].x, point[13].y);
|
|
||||||
rlVertex2f(point[5].x, point[5].y);
|
|
||||||
rlVertex2f(point[4].x, point[4].y);
|
|
||||||
rlVertex2f(point[12].x, point[12].y);
|
|
||||||
rlVertex2f(point[13].x, point[13].y);
|
|
||||||
rlVertex2f(point[4].x, point[4].y);
|
|
||||||
|
|
||||||
// Left rectangle
|
// Left rectangle
|
||||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
rlRectangle( point[7], point[6], point[14], point[15], color);
|
||||||
rlVertex2f(point[7].x, point[7].y);
|
|
||||||
rlVertex2f(point[6].x, point[6].y);
|
|
||||||
rlVertex2f(point[14].x, point[14].y);
|
|
||||||
rlVertex2f(point[15].x, point[15].y);
|
|
||||||
rlVertex2f(point[7].x, point[7].y);
|
|
||||||
rlVertex2f(point[14].x, point[14].y);
|
|
||||||
rlEnd();
|
rlEnd();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
@ -1303,8 +1314,8 @@ void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, f
|
||||||
// Use LINES to draw the outline
|
// Use LINES to draw the outline
|
||||||
rlBegin(RL_LINES);
|
rlBegin(RL_LINES);
|
||||||
|
|
||||||
// Draw all the 4 corners first: Upper Left Corner, Upper Right Corner, Lower Right Corner, Lower Left Corner
|
// Draw the selected corners
|
||||||
for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop
|
for (int k = 0; k < countCenters; ++k) // Hope the compiler is smart enough to unroll this loop
|
||||||
{
|
{
|
||||||
float angle = angles[k];
|
float angle = angles[k];
|
||||||
const Vector2 center = centers[k];
|
const Vector2 center = centers[k];
|
||||||
|
|
@ -1318,12 +1329,32 @@ void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// And now the remaining 4 lines
|
// Draw the 4 main lines
|
||||||
for (int i = 0; i < 8; i += 2)
|
for (int i = 0; i < 8; i += 2)
|
||||||
{
|
{
|
||||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
rlLine(point[i], point[i + 1], color);
|
||||||
rlVertex2f(point[i].x, point[i].y);
|
}
|
||||||
rlVertex2f(point[i + 1].x, point[i + 1].y);
|
|
||||||
|
// Draw the corners lines
|
||||||
|
if(!topLeft)
|
||||||
|
{
|
||||||
|
rlLine(point[7], (Vector2) {point[7].x, point[0].y}, color);
|
||||||
|
rlLine((Vector2) {point[7].x, point[0].y}, point[0], color);
|
||||||
|
}
|
||||||
|
if(!topRight)
|
||||||
|
{
|
||||||
|
rlLine(point[1], (Vector2) {point[2].x, point[1].y}, color);
|
||||||
|
rlLine((Vector2) {point[2].x, point[1].y}, point[2], color);
|
||||||
|
}
|
||||||
|
if(!bottomLeft)
|
||||||
|
{
|
||||||
|
rlLine(point[6], (Vector2) {point[6].x, point[5].y}, color);
|
||||||
|
rlLine((Vector2) {point[6].x, point[5].y}, point[5], color);
|
||||||
|
}
|
||||||
|
if(!bottomRight)
|
||||||
|
{
|
||||||
|
rlLine(point[4], (Vector2) {point[3].x, point[4].y}, color);
|
||||||
|
rlLine((Vector2) {point[3].x, point[4].y}, point[3], color);
|
||||||
}
|
}
|
||||||
|
|
||||||
rlEnd();
|
rlEnd();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user