This commit is contained in:
2025-11-07 17:58:47 +01:00
parent 6e3cd05cd2
commit 2c92fe8372
7 changed files with 18 additions and 27 deletions

View File

@@ -525,8 +525,6 @@ void Player::playFallSound() {
// Comprueba si el jugador tiene suelo debajo de los pies
auto Player::isOnFloor() -> bool {
bool on_floor = false;
bool on_slope_l = false;
bool on_slope_r = false;
updateFeet();
@@ -537,8 +535,8 @@ auto Player::isOnFloor() -> bool {
}
// Comprueba las rampas
on_slope_l = room_->checkLeftSlopes(under_feet_.data());
on_slope_r = room_->checkRightSlopes(&under_feet_[1]);
auto on_slope_l = room_->checkLeftSlopes(under_feet_.data());
auto on_slope_r = room_->checkRightSlopes(&under_feet_[1]);
return on_floor || on_slope_l || on_slope_r;
}

View File

@@ -2,9 +2,10 @@
#include <SDL3/SDL.h>
#include <cstddef> // Para NULL
#include <fstream> // Para basic_ostream, operator<<, basic_ofstream
#include <iostream> // Para cout, cerr
#include <algorithm> // Para std::count_if
#include <cstddef> // Para NULL
#include <fstream> // Para basic_ostream, operator<<, basic_ofstream
#include <iostream> // Para cout, cerr
#include <utility>
#include "game/options.hpp" // Para Options, options
@@ -159,13 +160,8 @@ void Cheevos::saveToFile() {
// Devuelve el número total de logros desbloqueados
auto Cheevos::getTotalUnlockedAchievements() -> int {
int count = 0;
for (const auto& cheevo : cheevos_list_) {
if (cheevo.completed) {
count++;
}
}
return count;
return std::count_if(cheevos_list_.begin(), cheevos_list_.end(),
[](const auto& cheevo) { return cheevo.completed; });
}
// Elimina el estado "no obtenible"

View File

@@ -288,20 +288,17 @@ void LoadingScreen::renderHeaderBorder() const {
const auto COLOR = carrier_.toggle ? static_cast<Uint8>(PaletteColor::RED) : static_cast<Uint8>(PaletteColor::CYAN);
const int WIDTH = Options::game.width + (Options::video.border.width * 2);
const int HEIGHT = Options::game.height + (Options::video.border.height * 2);
bool draw_enabled = true;
// Primera linea (con el color y tamaño de la portadora)
int row = 0;
const int FIRST_ROW_HEIGHT = static_cast<int>(carrier_.offset);
if (draw_enabled) {
for (int i = row; i < row + FIRST_ROW_HEIGHT; ++i) {
border->drawLine(0, i, WIDTH, i, COLOR);
}
for (int i = row; i < row + FIRST_ROW_HEIGHT; ++i) {
border->drawLine(0, i, WIDTH, i, COLOR);
}
row += FIRST_ROW_HEIGHT;
draw_enabled = !draw_enabled;
// Resto de lineas (siguen a la portadora)
bool draw_enabled = false;
while (row < HEIGHT) {
if (draw_enabled) {
for (int i = row; i < row + HEADER_DATAROW_HEIGHT; ++i) {