migrant a SDL3

This commit is contained in:
2025-03-25 20:26:45 +01:00
parent f1b0303474
commit a9c869baf6
49 changed files with 374 additions and 416 deletions

View File

@@ -69,7 +69,7 @@ bool checkCollision(const Circle &a, const Circle &b)
}
// Detector de colisiones entre un circulo y un rectangulo
bool checkCollision(const Circle &a, const SDL_Rect &b)
bool checkCollision(const Circle &a, const SDL_FRect &b)
{
// Encuentra el punto más cercano en el rectángulo
int cX = std::clamp(a.x, b.x, b.x + b.w);
@@ -80,7 +80,7 @@ bool checkCollision(const Circle &a, const SDL_Rect &b)
}
// Detector de colisiones entre dos rectangulos
bool checkCollision(const SDL_Rect &a, const SDL_Rect &b)
bool checkCollision(const SDL_FRect &a, const SDL_FRect &b)
{
const int leftA = a.x, rightA = a.x + a.w, topA = a.y, bottomA = a.y + a.h;
const int leftB = b.x, rightB = b.x + b.w, topB = b.y, bottomB = b.y + b.h;
@@ -98,7 +98,7 @@ bool checkCollision(const SDL_Rect &a, const SDL_Rect &b)
}
// Detector de colisiones entre un punto y un rectangulo
bool checkCollision(const SDL_Point &p, const SDL_Rect &r)
bool checkCollision(const SDL_Point &p, const SDL_FRect &r)
{
if (p.x < r.x || p.x > r.x + r.w)
return false;