Adding the rect_to_frect function.

This commit is contained in:
Ulysse Cura 2026-07-21 00:26:25 +02:00
parent 520a846892
commit 7121b6d084
2 changed files with 9 additions and 1 deletions

View File

@ -46,7 +46,7 @@ typedef SDL_FRect frect_t;
#define is_not_zero(X) (fabsf(X) > EPSILON)
void rect_to_frect(const rect_t rect, frect_t frect);
void rect_to_frect(const rect_t *rect, frect_t *frect);
void frect_to_rect(const frect_t *frect, rect_t *rect);

View File

@ -1,5 +1,13 @@
#include "vector2d.h"
void rect_to_frect(const rect_t *rect, frect_t *frect)
{
frect->x = (float)rect->x;
frect->y = (float)rect->y;
frect->w = (float)rect->w;
frect->h = (float)rect->h;
}
void frect_to_rect(const frect_t *frect, rect_t *rect)
{
rect->x = (int)frect->x;