diff --git a/src/twn_util.c b/src/twn_util.c index 2ff26ce..da55790 100644 --- a/src/twn_util.c +++ b/src/twn_util.c @@ -202,16 +202,14 @@ bool overlap_frect(const t_frect *a, const t_frect *b, t_frect *result) { bool intersect_rect(const t_rect *a, const t_rect *b) { SDL_Rect a_sdl = { a->x, a->y, a->w, a->h }; SDL_Rect b_sdl = { b->x, b->y, b->w, b->h }; - SDL_Rect result_sdl = { 0 }; - return SDL_IntersectRect(&a_sdl, &b_sdl, &result_sdl); + return SDL_HasIntersection(&a_sdl, &b_sdl); } bool intersect_frect(const t_frect *a, const t_frect *b) { SDL_FRect a_sdl = { a->x, a->y, a->w, a->h }; SDL_FRect b_sdl = { b->x, b->y, b->w, b->h }; - SDL_FRect result_sdl = { 0 }; - return SDL_IntersectFRect(&a_sdl, &b_sdl, &result_sdl); + return SDL_HasIntersectionF(&a_sdl, &b_sdl); }