|
|
@ -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) |
|
|
|