typedef & PascalCase for ALL structs and enums
This commit is contained in:
@ -171,7 +171,7 @@ bool strends(const char *str, const char *suffix) {
|
||||
}
|
||||
|
||||
|
||||
bool overlap_rect(const t_rect *a, const t_rect *b, t_rect *result) {
|
||||
bool overlap_rect(const Recti *a, const Recti *b, Recti *result) {
|
||||
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 };
|
||||
@ -179,13 +179,13 @@ bool overlap_rect(const t_rect *a, const t_rect *b, t_rect *result) {
|
||||
bool intersection = SDL_IntersectRect(&a_sdl, &b_sdl, &result_sdl);
|
||||
|
||||
if (result != NULL)
|
||||
*result = (t_rect){ result_sdl.x, result_sdl.y, result_sdl.w, result_sdl.h };
|
||||
*result = (Recti){ result_sdl.x, result_sdl.y, result_sdl.w, result_sdl.h };
|
||||
|
||||
return intersection;
|
||||
}
|
||||
|
||||
|
||||
bool overlap_frect(const t_frect *a, const t_frect *b, t_frect *result) {
|
||||
bool overlap_frect(const Rect *a, const Rect *b, Rect *result) {
|
||||
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 };
|
||||
@ -193,28 +193,28 @@ bool overlap_frect(const t_frect *a, const t_frect *b, t_frect *result) {
|
||||
bool intersection = SDL_IntersectFRect(&a_sdl, &b_sdl, &result_sdl);
|
||||
|
||||
if (result != NULL)
|
||||
*result = (t_frect){ result_sdl.x, result_sdl.y, result_sdl.w, result_sdl.h };
|
||||
*result = (Rect){ result_sdl.x, result_sdl.y, result_sdl.w, result_sdl.h };
|
||||
|
||||
return intersection;
|
||||
}
|
||||
|
||||
|
||||
bool intersect_rect(const t_rect *a, const t_rect *b) {
|
||||
bool intersect_rect(const Recti *a, const Recti *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 };
|
||||
return SDL_HasIntersection(&a_sdl, &b_sdl);
|
||||
}
|
||||
|
||||
|
||||
bool intersect_frect(const t_frect *a, const t_frect *b) {
|
||||
bool intersect_frect(const Rect *a, const Rect *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 };
|
||||
return SDL_HasIntersectionF(&a_sdl, &b_sdl);
|
||||
}
|
||||
|
||||
|
||||
t_frect to_frect(t_rect rect) {
|
||||
return (t_frect) {
|
||||
Rect to_frect(Recti rect) {
|
||||
return (Rect) {
|
||||
.h = (float)rect.h,
|
||||
.w = (float)rect.w,
|
||||
.x = (float)rect.x,
|
||||
@ -223,8 +223,8 @@ t_frect to_frect(t_rect rect) {
|
||||
}
|
||||
|
||||
|
||||
t_fvec2 frect_center(t_frect rect) {
|
||||
return (t_fvec2){
|
||||
Vec2 frect_center(Rect rect) {
|
||||
return (Vec2){
|
||||
.x = rect.x + rect.w / 2,
|
||||
.y = rect.y + rect.h / 2,
|
||||
};
|
||||
|
Reference in New Issue
Block a user