circle.c 1006 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #include <stdint.h>
  2. #include "circle.h"
  3. #include "SDL_easy.h"
  4. circle_t create_circle(int x, int y, int r, uint8_t colour)
  5. {
  6. circle_t circle = { x, y, r, colour };
  7. return circle;
  8. }
  9. void draw_circle(circle_t *circle)
  10. {
  11. SDL_DrawCircle(circle->colour, circle->x, circle->y, circle->r);
  12. }
  13. void draw_circle_position(circle_t *circle, int x, int y)
  14. {
  15. SDL_DrawCircle(circle->colour, x, y, circle->r);
  16. }
  17. void draw_circle_scale(circle_t *circle, int r)
  18. {
  19. SDL_DrawCircle(circle->colour, circle->x, circle->y, r);
  20. }
  21. void draw_circle_colour(circle_t *circle, uint8_t colour)
  22. {
  23. SDL_DrawCircle(colour, circle->x, circle->y, circle->r);
  24. }
  25. void draw_circle_set(circle_t *circle, int x, int y, int r, uint8_t colour)
  26. {
  27. circle->colour = colour;
  28. circle->x = x;
  29. circle->y = y;
  30. circle->r = r;
  31. draw_circle(circle);
  32. }
  33. void set_circle(circle_t *circle, int x, int y, int r, uint8_t colour)
  34. {
  35. circle->colour = colour;
  36. circle->x = x;
  37. circle->y = y;
  38. circle->r = r;
  39. }