diff options
| author | Ray <[email protected]> | 2022-09-19 18:47:16 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2022-09-19 18:47:16 +0200 |
| commit | 4311ffc9e13c4de3c519ce9b1afd2f52fc618914 (patch) | |
| tree | d148b6a502eecf444ed6f194b4286378cf01e28b | |
| parent | 2093fdcc536e68a131c15e196460e338609e1a76 (diff) | |
| download | raylib-4311ffc9e13c4de3c519ce9b1afd2f52fc618914.tar.gz raylib-4311ffc9e13c4de3c519ce9b1afd2f52fc618914.zip | |
REVIEWED: New functions coding conventions
| -rw-r--r-- | src/rtextures.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/rtextures.c b/src/rtextures.c index 5a77ac7b..3badc349 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -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) |
