forked from jaildesigner-jailgames/jaildoctors_dilemma
posss.. mes merdes que no van a cap lloc
This commit is contained in:
@@ -681,109 +681,109 @@ void Room::renderAnimatedTiles() {
|
||||
}
|
||||
|
||||
// Comprueba las colisiones
|
||||
auto Room::checkRightSurfaces(SDL_FRect* rect) -> int {
|
||||
auto Room::checkRightSurfaces(SDL_FRect& rect) -> int {
|
||||
for (const auto& s : right_walls_) {
|
||||
if (checkCollision(s, *rect)) {
|
||||
if (checkCollision(s, rect)) {
|
||||
return s.x;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
return Collision::NONE;
|
||||
}
|
||||
|
||||
// Comprueba las colisiones
|
||||
auto Room::checkLeftSurfaces(SDL_FRect* rect) -> int {
|
||||
auto Room::checkLeftSurfaces(SDL_FRect& rect) -> int {
|
||||
for (const auto& s : left_walls_) {
|
||||
if (checkCollision(s, *rect)) {
|
||||
if (checkCollision(s, rect)) {
|
||||
return s.x;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
return Collision::NONE;
|
||||
}
|
||||
|
||||
// Comprueba las colisiones
|
||||
auto Room::checkTopSurfaces(SDL_FRect* rect) -> int {
|
||||
auto Room::checkTopSurfaces(SDL_FRect& rect) -> int {
|
||||
for (const auto& s : top_floors_) {
|
||||
if (checkCollision(s, *rect)) {
|
||||
if (checkCollision(s, rect)) {
|
||||
return s.y;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
return Collision::NONE;
|
||||
}
|
||||
|
||||
// Comprueba las colisiones
|
||||
auto Room::checkBottomSurfaces(SDL_FRect* rect) -> int {
|
||||
auto Room::checkBottomSurfaces(SDL_FRect& rect) -> int {
|
||||
for (const auto& s : bottom_floors_) {
|
||||
if (checkCollision(s, *rect)) {
|
||||
if (checkCollision(s, rect)) {
|
||||
return s.y;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
return Collision::NONE;
|
||||
}
|
||||
|
||||
// Comprueba las colisiones
|
||||
auto Room::checkAutoSurfaces(SDL_FRect* rect) -> int {
|
||||
auto Room::checkAutoSurfaces(SDL_FRect& rect) -> int {
|
||||
for (const auto& s : conveyor_belt_floors_) {
|
||||
if (checkCollision(s, *rect)) {
|
||||
if (checkCollision(s, rect)) {
|
||||
return s.y;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
return Collision::NONE;
|
||||
}
|
||||
|
||||
// Comprueba las colisiones
|
||||
auto Room::checkTopSurfaces(SDL_FPoint* p) -> bool {
|
||||
auto Room::checkTopSurfaces(SDL_FPoint& p) -> bool {
|
||||
return std::ranges::any_of(top_floors_, [&](const auto& s) {
|
||||
return checkCollision(s, *p);
|
||||
return checkCollision(s, p);
|
||||
});
|
||||
}
|
||||
|
||||
// Comprueba las colisiones
|
||||
auto Room::checkConveyorBelts(SDL_FPoint* p) -> bool {
|
||||
auto Room::checkConveyorBelts(SDL_FPoint& p) -> bool {
|
||||
return std::ranges::any_of(conveyor_belt_floors_, [&](const auto& s) {
|
||||
return checkCollision(s, *p);
|
||||
return checkCollision(s, p);
|
||||
});
|
||||
}
|
||||
|
||||
// Comprueba las colisiones
|
||||
auto Room::checkLeftSlopes(const LineVertical* line) -> int {
|
||||
auto Room::checkLeftSlopes(const LineVertical& line) -> int {
|
||||
for (const auto& slope : left_slopes_) {
|
||||
const auto P = checkCollision(slope, *line);
|
||||
const auto P = checkCollision(slope, line);
|
||||
if (P.x != -1) {
|
||||
return P.y;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
return Collision::NONE;
|
||||
}
|
||||
|
||||
// Comprueba las colisiones
|
||||
auto Room::checkLeftSlopes(SDL_FPoint* p) -> bool {
|
||||
auto Room::checkLeftSlopes(SDL_FPoint& p) -> bool {
|
||||
return std::ranges::any_of(left_slopes_, [&](const auto& slope) {
|
||||
return checkCollision(*p, slope);
|
||||
return checkCollision(p, slope);
|
||||
});
|
||||
}
|
||||
|
||||
// Comprueba las colisiones
|
||||
auto Room::checkRightSlopes(const LineVertical* line) -> int {
|
||||
auto Room::checkRightSlopes(const LineVertical& line) -> int {
|
||||
for (const auto& slope : right_slopes_) {
|
||||
const auto P = checkCollision(slope, *line);
|
||||
const auto P = checkCollision(slope, line);
|
||||
if (P.x != -1) {
|
||||
return P.y;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
return Collision::NONE;
|
||||
}
|
||||
|
||||
// Comprueba las colisiones
|
||||
auto Room::checkRightSlopes(SDL_FPoint* p) -> bool {
|
||||
auto Room::checkRightSlopes(SDL_FPoint& p) -> bool {
|
||||
return std::ranges::any_of(right_slopes_, [&](const auto& slope) {
|
||||
return checkCollision(*p, slope);
|
||||
return checkCollision(p, slope);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -78,17 +78,17 @@ class Room {
|
||||
auto itemCollision(SDL_FRect& rect) -> bool; // Indica si hay colision con un objeto a partir de un rectangulo
|
||||
static auto getTileSize() -> int { return TILE_SIZE; } // Obten el tamaño del tile
|
||||
static auto getSlopeHeight(SDL_FPoint p, Tile slope) -> int; // Obten la coordenada de la cuesta a partir de un punto perteneciente a ese tile
|
||||
auto checkRightSurfaces(SDL_FRect* rect) -> int; // Comprueba las colisiones
|
||||
auto checkLeftSurfaces(SDL_FRect* rect) -> int; // Comprueba las colisiones
|
||||
auto checkTopSurfaces(SDL_FRect* rect) -> int; // Comprueba las colisiones
|
||||
auto checkBottomSurfaces(SDL_FRect* rect) -> int; // Comprueba las colisiones
|
||||
auto checkAutoSurfaces(SDL_FRect* rect) -> int; // Comprueba las colisiones
|
||||
auto checkTopSurfaces(SDL_FPoint* p) -> bool; // Comprueba las colisiones
|
||||
auto checkConveyorBelts(SDL_FPoint* p) -> bool; // Comprueba las colisiones
|
||||
auto checkLeftSlopes(const LineVertical* line) -> int; // Comprueba las colisiones
|
||||
auto checkLeftSlopes(SDL_FPoint* p) -> bool; // Comprueba las colisiones
|
||||
auto checkRightSlopes(const LineVertical* line) -> int; // Comprueba las colisiones
|
||||
auto checkRightSlopes(SDL_FPoint* p) -> bool; // Comprueba las colisiones
|
||||
auto checkRightSurfaces(SDL_FRect& rect) -> int; // Comprueba las colisiones
|
||||
auto checkLeftSurfaces(SDL_FRect& rect) -> int; // Comprueba las colisiones
|
||||
auto checkTopSurfaces(SDL_FRect& rect) -> int; // Comprueba las colisiones
|
||||
auto checkBottomSurfaces(SDL_FRect& rect) -> int; // Comprueba las colisiones
|
||||
auto checkAutoSurfaces(SDL_FRect& rect) -> int; // Comprueba las colisiones
|
||||
auto checkTopSurfaces(SDL_FPoint& p) -> bool; // Comprueba las colisiones
|
||||
auto checkConveyorBelts(SDL_FPoint& p) -> bool; // Comprueba las colisiones
|
||||
auto checkLeftSlopes(const LineVertical& line) -> int; // Comprueba las colisiones
|
||||
auto checkLeftSlopes(SDL_FPoint& p) -> bool; // Comprueba las colisiones
|
||||
auto checkRightSlopes(const LineVertical& line) -> int; // Comprueba las colisiones
|
||||
auto checkRightSlopes(SDL_FPoint& p) -> bool; // Comprueba las colisiones
|
||||
void setPaused(bool value) { is_paused_ = value; }; // Pone el mapa en modo pausa
|
||||
[[nodiscard]] auto getConveyorBeltDirection() const -> int { return conveyor_belt_direction_; } // Obten la direccion de las superficies automaticas
|
||||
static auto loadRoomFile(const std::string& file_path, bool verbose = false) -> Data; // Carga las variables desde un fichero de mapa
|
||||
|
||||
Reference in New Issue
Block a user