forked from jaildesigner-jailgames/jaildoctors_dilemma
fix: arreglades les colisions "the static cast menner"
This commit is contained in:
@@ -42,22 +42,22 @@ struct Circle {
|
||||
|
||||
// Estructura para definir una linea horizontal
|
||||
struct LineHorizontal {
|
||||
float x1, x2, y;
|
||||
int x1, x2, y;
|
||||
};
|
||||
|
||||
// Estructura para definir una linea vertical
|
||||
struct LineVertical {
|
||||
float x, y1, y2;
|
||||
int x, y1, y2;
|
||||
};
|
||||
|
||||
// Estructura para definir una linea diagonal
|
||||
struct LineDiagonal {
|
||||
float x1, y1, x2, y2;
|
||||
int x1, y1, x2, y2;
|
||||
};
|
||||
|
||||
// Estructura para definir una linea
|
||||
struct Line {
|
||||
float x1, y1, x2, y2;
|
||||
int x1, y1, x2, y2;
|
||||
};
|
||||
|
||||
// Estructura para definir un color
|
||||
@@ -104,10 +104,10 @@ bool checkCollision(const LineVertical& l, const SDL_FRect& r);
|
||||
bool checkCollision(const LineHorizontal& l, const SDL_FPoint& p);
|
||||
|
||||
// Detector de colisiones entre dos lineas
|
||||
SDL_FPoint checkCollision(const Line& l1, const Line& l2);
|
||||
SDL_Point checkCollision(const Line& l1, const Line& l2);
|
||||
|
||||
// Detector de colisiones entre dos lineas
|
||||
SDL_FPoint checkCollision(const LineDiagonal& l1, const LineVertical& l2);
|
||||
SDL_Point checkCollision(const LineDiagonal& l1, const LineVertical& l2);
|
||||
|
||||
// Detector de colisiones entre un punto y una linea diagonal
|
||||
bool checkCollision(const SDL_FPoint& p, const LineDiagonal& l);
|
||||
@@ -152,4 +152,20 @@ bool stringInVector(const std::vector<std::string>& vec, const std::string& str)
|
||||
void playMusic(const std::string& music_path);
|
||||
|
||||
// Rellena una textura de un color
|
||||
void fillTextureWithColor(SDL_Renderer* renderer, SDL_Texture* texture, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
|
||||
void fillTextureWithColor(SDL_Renderer* renderer, SDL_Texture* texture, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
|
||||
|
||||
inline SDL_Rect toSDLRect(const SDL_FRect& frect) {
|
||||
SDL_Rect rect;
|
||||
rect.x = static_cast<int>(frect.x);
|
||||
rect.y = static_cast<int>(frect.y);
|
||||
rect.w = static_cast<int>(frect.w);
|
||||
rect.h = static_cast<int>(frect.h);
|
||||
return rect;
|
||||
}
|
||||
|
||||
inline SDL_Point toSDLPoint(const SDL_FPoint& fpoint) {
|
||||
SDL_Point point;
|
||||
point.x = static_cast<int>(fpoint.x);
|
||||
point.y = static_cast<int>(fpoint.y);
|
||||
return point;
|
||||
}
|
||||
Reference in New Issue
Block a user