summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2021-03-27 17:37:47 (EDT)
committer P. J. McDermott <pj@pehjota.net>2021-03-27 17:37:47 (EDT)
commit461e5f5367c526332a93b9fa364f96b88dd00253 (patch)
tree245f623f7eb26a16f011817a64d5c5262421f077
parent33d93b2a41f0595a650dc2532423c9c02136ce18 (diff)
downloaddodge-balls-461e5f5367c526332a93b9fa364f96b88dd00253.zip
dodge-balls-461e5f5367c526332a93b9fa364f96b88dd00253.tar.gz
dodge-balls-461e5f5367c526332a93b9fa364f96b88dd00253.tar.bz2
collision: s/int/double/ in rect collision points
-rw-r--r--src/collision.c6
-rw-r--r--src/collision.h4
2 files changed, 6 insertions, 4 deletions
diff --git a/src/collision.c b/src/collision.c
index 45462e5..7e77b0a 100644
--- a/src/collision.c
+++ b/src/collision.c
@@ -39,7 +39,8 @@ db_pt_in_rect(int x, int y, SDL_Rect *rect)
}
void
-db_closest_pt_on_rect(int x, int y, SDL_Rect *rect, int *close_x, int *close_y)
+db_closest_pt_on_rect(int x, int y, SDL_Rect *rect,
+ double *close_x, double *close_y)
{
*close_x = x;
if (x < rect->x) {
@@ -56,7 +57,8 @@ db_closest_pt_on_rect(int x, int y, SDL_Rect *rect, int *close_x, int *close_y)
}
int
-db_col_cir_rect(int x, int y, int r, SDL_Rect *rect, int *col_x, int *col_y)
+db_col_cir_rect(int x, int y, int r, SDL_Rect *rect,
+ double *col_x, double *col_y)
{
db_closest_pt_on_rect(x, y, rect, col_x, col_y);
return (r * r) >=
diff --git a/src/collision.h b/src/collision.h
index 02d93e3..ee04a8e 100644
--- a/src/collision.h
+++ b/src/collision.h
@@ -24,9 +24,9 @@
int db_pt_in_rect(int x, int y, SDL_Rect *rect) __attribute__((__pure__));
void db_closest_pt_on_rect(int x, int y, SDL_Rect *rect,
- int *close_x, int *close_y);
+ double *close_x, double *close_y);
int db_col_cir_rect(int x, int y, int r, SDL_Rect *rect,
- int *col_x, int *col_y);
+ double *col_x, double *col_y);
int db_col_cir_cir(double x1, double y1, double r1,
double x2, double y2, double r2) __attribute__((__const__));
int db_col_pt_cir_cir(double x1, double y1, double r1,