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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user