From 461e5f5367c526332a93b9fa364f96b88dd00253 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sat, 27 Mar 2021 17:37:47 -0400 Subject: collision: s/int/double/ in rect collision points --- (limited to 'src') 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, -- cgit v0.9.1