aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexHCC <alexander06088@yahoo.com>2019-09-25 00:08:07 +0300
committerRay <raysan5@gmail.com>2019-09-24 23:08:07 +0200
commit8adcec185eb04a5dc88aa7f57f16214c22be7b88 (patch)
tree619b3e27af30bc703a9dc76ffd701f450e2c2cb9
parent3fcf2ee19abd509cb250a55dde16de40379950be (diff)
downloadraylib-8adcec185eb04a5dc88aa7f57f16214c22be7b88.tar.gz
raylib-8adcec185eb04a5dc88aa7f57f16214c22be7b88.zip
Improve code readability (#976)
-rw-r--r--src/shapes.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/shapes.c b/src/shapes.c
index 4c4b353a..4fd4eff5 100644
--- a/src/shapes.c
+++ b/src/shapes.c
@@ -1298,7 +1298,7 @@ void DrawTriangleStrip(Vector2 *points, int pointsCount, Color color)
void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color)
{
if (sides < 3) sides = 3;
- float internalAngle = 360.0f/(float)sides;
+ float centralAngle = 0.0f;
if (rlCheckBufferLimit(4*(360/sides))) rlglDraw();
@@ -1318,14 +1318,14 @@ void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color col
rlVertex2f(0, 0);
rlTexCoord2f(recTexShapes.x/texShapes.width, (recTexShapes.y + recTexShapes.height)/texShapes.height);
- rlVertex2f(sinf(DEG2RAD*internalAngle)*radius, cosf(DEG2RAD*internalAngle)*radius);
+ rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
rlTexCoord2f((recTexShapes.x + recTexShapes.width)/texShapes.width, (recTexShapes.y + recTexShapes.height)/texShapes.height);
- rlVertex2f(sinf(DEG2RAD*internalAngle)*radius, cosf(DEG2RAD*internalAngle)*radius);
+ rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
- internalAngle += 360.0f/(float)sides;
+ centralAngle += 360.0f/(float)sides;
rlTexCoord2f((recTexShapes.x + recTexShapes.width)/texShapes.width, recTexShapes.y/texShapes.height);
- rlVertex2f(sinf(DEG2RAD*internalAngle)*radius, cosf(DEG2RAD*internalAngle)*radius);
+ rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
}
rlEnd();
rlDisableTexture();
@@ -1336,10 +1336,10 @@ void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color col
rlColor4ub(color.r, color.g, color.b, color.a);
rlVertex2f(0, 0);
- rlVertex2f(sinf(DEG2RAD*internalAngle)*radius, cosf(DEG2RAD*internalAngle)*radius);
+ rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
- internalAngle += 360.0f/(float)sides;
- rlVertex2f(sinf(DEG2RAD*internalAngle)*radius, cosf(DEG2RAD*internalAngle)*radius);
+ centralAngle += 360.0f/(float)sides;
+ rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
}
rlEnd();
#endif