forked from jaildesigner-jailgames/jaildoctors_dilemma
corregides cridades a SDL3 i migrat casi tot de int a float. Falta jail_shader
This commit is contained in:
@@ -39,7 +39,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) {
|
||||
// Closest point on collision box
|
||||
int cX, cY;
|
||||
|
||||
@@ -72,7 +72,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) {
|
||||
// Calcula las caras del rectangulo a
|
||||
const int leftA = a.x;
|
||||
const int rightA = a.x + a.w;
|
||||
@@ -107,7 +107,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_FPoint& p, const SDL_FRect& r) {
|
||||
// Comprueba si el punto está a la izquierda del rectangulo
|
||||
if (p.x < r.x) {
|
||||
return false;
|
||||
@@ -133,7 +133,7 @@ bool checkCollision(const SDL_Point& p, const SDL_Rect& r) {
|
||||
}
|
||||
|
||||
// Detector de colisiones entre una linea horizontal y un rectangulo
|
||||
bool checkCollision(const LineHorizontal& l, const SDL_Rect& r) {
|
||||
bool checkCollision(const LineHorizontal& l, const SDL_FRect& r) {
|
||||
// Comprueba si la linea esta por encima del rectangulo
|
||||
if (l.y < r.y) {
|
||||
return false;
|
||||
@@ -159,7 +159,7 @@ bool checkCollision(const LineHorizontal& l, const SDL_Rect& r) {
|
||||
}
|
||||
|
||||
// Detector de colisiones entre una linea vertical y un rectangulo
|
||||
bool checkCollision(const LineVertical& l, const SDL_Rect& r) {
|
||||
bool checkCollision(const LineVertical& l, const SDL_FRect& r) {
|
||||
// Comprueba si la linea esta por la izquierda del rectangulo
|
||||
if (l.x < r.x) {
|
||||
return false;
|
||||
@@ -185,7 +185,7 @@ bool checkCollision(const LineVertical& l, const SDL_Rect& r) {
|
||||
}
|
||||
|
||||
// Detector de colisiones entre una linea horizontal y un punto
|
||||
bool checkCollision(const LineHorizontal& l, const SDL_Point& p) {
|
||||
bool checkCollision(const LineHorizontal& l, const SDL_FPoint& p) {
|
||||
// Comprueba si el punto esta sobre la linea
|
||||
if (p.y > l.y) {
|
||||
return false;
|
||||
@@ -211,7 +211,7 @@ bool checkCollision(const LineHorizontal& l, const SDL_Point& p) {
|
||||
}
|
||||
|
||||
// Detector de colisiones entre dos lineas
|
||||
SDL_Point checkCollision(const Line& l1, const Line& l2) {
|
||||
SDL_FPoint checkCollision(const Line& l1, const Line& l2) {
|
||||
const float x1 = l1.x1;
|
||||
const float y1 = l1.y1;
|
||||
const float x2 = l1.x2;
|
||||
@@ -238,7 +238,7 @@ SDL_Point checkCollision(const Line& l1, const Line& l2) {
|
||||
}
|
||||
|
||||
// Detector de colisiones entre dos lineas
|
||||
SDL_Point checkCollision(const LineDiagonal& l1, const LineVertical& l2) {
|
||||
SDL_FPoint checkCollision(const LineDiagonal& l1, const LineVertical& l2) {
|
||||
const float x1 = l1.x1;
|
||||
const float y1 = l1.y1;
|
||||
const float x2 = l1.x2;
|
||||
@@ -279,7 +279,7 @@ void normalizeLine(LineDiagonal& l) {
|
||||
}
|
||||
|
||||
// Detector de colisiones entre un punto y una linea diagonal
|
||||
bool checkCollision(const SDL_Point& p, const LineDiagonal& l) {
|
||||
bool checkCollision(const SDL_FPoint& p, const LineDiagonal& l) {
|
||||
// Comprueba si el punto está en alineado con la linea
|
||||
if (abs(p.x - l.x1) != abs(p.y - l.y1)) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user