mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-14 07:18:14 +00:00
Review formatting
This commit is contained in:
@@ -338,7 +338,7 @@ void DrawCircleSector(Vector2 center, float radius, float startAngle, float endA
|
||||
}
|
||||
|
||||
// NOTE: In case number of segments is odd, we add one last piece to the cake
|
||||
if ((segments%2) == 1)
|
||||
if (((unsigned int)segments%2) == 1)
|
||||
{
|
||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
||||
|
||||
@@ -1574,7 +1574,7 @@ void DrawSplineLinear(Vector2 *points, int pointCount, float thick, Color color)
|
||||
#if defined(SUPPORT_SPLINE_MITERS)
|
||||
Vector2 prevNormal = (Vector2){-(points[1].y - points[0].y), (points[1].x - points[0].x)};
|
||||
float prevLength = sqrtf(prevNormal.x*prevNormal.x + prevNormal.y*prevNormal.y);
|
||||
|
||||
|
||||
if (prevLength > 0.0f)
|
||||
{
|
||||
prevNormal.x /= prevLength;
|
||||
@@ -1587,7 +1587,7 @@ void DrawSplineLinear(Vector2 *points, int pointCount, float thick, Color color)
|
||||
}
|
||||
|
||||
Vector2 prevRadius = { 0.5f*thick*prevNormal.x, 0.5f*thick*prevNormal.y };
|
||||
|
||||
|
||||
for (int i = 0; i < pointCount - 1; i++)
|
||||
{
|
||||
Vector2 normal = { 0 };
|
||||
@@ -1596,7 +1596,7 @@ void DrawSplineLinear(Vector2 *points, int pointCount, float thick, Color color)
|
||||
{
|
||||
normal = (Vector2){-(points[i + 2].y - points[i + 1].y), (points[i + 2].x - points[i + 1].x)};
|
||||
float normalLength = sqrtf(normal.x*normal.x + normal.y*normal.y);
|
||||
|
||||
|
||||
if (normalLength > 0.0f)
|
||||
{
|
||||
normal.x /= normalLength;
|
||||
@@ -1615,7 +1615,7 @@ void DrawSplineLinear(Vector2 *points, int pointCount, float thick, Color color)
|
||||
|
||||
Vector2 radius = { prevNormal.x + normal.x, prevNormal.y + normal.y };
|
||||
float radiusLength = sqrtf(radius.x*radius.x + radius.y*radius.y);
|
||||
|
||||
|
||||
if (radiusLength > 0.0f)
|
||||
{
|
||||
radius.x /= radiusLength;
|
||||
@@ -1639,7 +1639,7 @@ void DrawSplineLinear(Vector2 *points, int pointCount, float thick, Color color)
|
||||
radius.x = 0.0f;
|
||||
radius.y = 0.0f;
|
||||
}
|
||||
|
||||
|
||||
Vector2 strip[4] = {
|
||||
{ points[i].x - prevRadius.x, points[i].y - prevRadius.y },
|
||||
{ points[i].x + prevRadius.x, points[i].y + prevRadius.y },
|
||||
@@ -1677,7 +1677,7 @@ void DrawSplineLinear(Vector2 *points, int pointCount, float thick, Color color)
|
||||
DrawTriangleStrip(strip, 4, color);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(SUPPORT_SPLINE_SEGMENT_CAPS)
|
||||
// TODO: Add spline segment rounded caps at the begin/end of the spline
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user