REVIEWED: New functions coding conventions
This commit is contained in:
parent
2093fdcc53
commit
4311ffc9e1
@ -2718,23 +2718,24 @@ void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color)
|
||||
// Draw circle within an image
|
||||
void ImageDrawCircle(Image* dst, int centerX, int centerY, int radius, Color color)
|
||||
{
|
||||
int x = 0, y = radius;
|
||||
int decesionParameter = 3 - 2 * radius;
|
||||
int x = 0;
|
||||
int y = radius;
|
||||
int decesionParameter = 3 - 2*radius;
|
||||
|
||||
while (y >= x)
|
||||
{
|
||||
ImageDrawRectangle(dst, centerX - x, centerY + y, x * 2, 1, color);
|
||||
ImageDrawRectangle(dst, centerX - x, centerY - y, x * 2, 1, color);
|
||||
ImageDrawRectangle(dst, centerX - y, centerY + x, y * 2, 1, color);
|
||||
ImageDrawRectangle(dst, centerX - y, centerY - x, y * 2, 1, color);
|
||||
ImageDrawRectangle(dst, centerX - x, centerY + y, x*2, 1, color);
|
||||
ImageDrawRectangle(dst, centerX - x, centerY - y, x*2, 1, color);
|
||||
ImageDrawRectangle(dst, centerX - y, centerY + x, y*2, 1, color);
|
||||
ImageDrawRectangle(dst, centerX - y, centerY - x, y*2, 1, color);
|
||||
x++;
|
||||
|
||||
if (decesionParameter > 0) {
|
||||
if (decesionParameter > 0)
|
||||
{
|
||||
y--;
|
||||
decesionParameter = decesionParameter + 4 * (x - y) + 10;
|
||||
} else {
|
||||
decesionParameter = decesionParameter + 4 * x + 6;
|
||||
}
|
||||
decesionParameter = decesionParameter + 4*(x - y) + 10;
|
||||
}
|
||||
else decesionParameter = decesionParameter + 4*x + 6;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2747,7 +2748,8 @@ void ImageDrawCircleV(Image* dst, Vector2 center, int radius, Color color)
|
||||
// Draw circle outline within an image
|
||||
void ImageDrawCircleLines(Image *dst, int centerX, int centerY, int radius, Color color)
|
||||
{
|
||||
int x = 0, y = radius;
|
||||
int x = 0;
|
||||
int y = radius;
|
||||
int decesionParameter = 3 - 2*radius;
|
||||
|
||||
while (y >= x)
|
||||
|
Loading…
Reference in New Issue
Block a user