canviat Options de struct a namespace

This commit is contained in:
2025-10-26 14:01:08 +01:00
parent 8f49e442de
commit df4965a84b
59 changed files with 1470 additions and 1533 deletions

View File

@@ -4,14 +4,14 @@
#include <algorithm> // Para max, min
#include <cmath> // Para ceil, abs
#include "core/system/debug.hpp" // Para Debug
#include "utils/defines.hpp" // Para RoomBorder::BOTTOM, RoomBorder::LEFT, RoomBorder::RIGHT
#include "external/jail_audio.h" // Para JA_PlaySound
#include "core/input/input.hpp" // Para Input, InputAction
#include "game/gameplay/options.hpp" // Para Cheat, Options, options
#include "core/resources/resource.hpp" // Para Resource
#include "game/gameplay/room.hpp" // Para Room, TileType
#include "core/input/input.hpp" // Para Input, InputAction
#include "core/rendering/surface_animated_sprite.hpp" // Para SAnimatedSprite
#include "core/resources/resource.hpp" // Para Resource
#include "core/system/debug.hpp" // Para Debug
#include "external/jail_audio.h" // Para JA_PlaySound
#include "game/gameplay/options.hpp" // Para Cheat, Options, options
#include "game/gameplay/room.hpp" // Para Room, TileType
#include "utils/defines.hpp" // Para RoomBorder::BOTTOM, RoomBorder::LEFT, RoomBorder::RIGHT
// Constructor
Player::Player(const PlayerData& player)
@@ -218,8 +218,8 @@ void Player::applyGravity() {
// Recalcula la posición del jugador y su animación
void Player::move() {
last_position_ = {x_, y_}; // Guarda la posicion actual antes de modificarla
applyGravity(); // Aplica gravedad al jugador
checkState(); // Comprueba el estado del jugador
applyGravity(); // Aplica gravedad al jugador
checkState(); // Comprueba el estado del jugador
#ifdef DEBUG
debug_color_ = static_cast<Uint8>(PaletteColor::GREEN);
@@ -549,9 +549,9 @@ bool Player::checkKillingTiles() {
// Establece el color del jugador
void Player::setColor() {
if (options.cheats.invincible == Cheat::CheatState::ENABLED) {
if (Options::cheats.invincible == Options::Cheat::State::ENABLED) {
color_ = static_cast<Uint8>(PaletteColor::CYAN);
} else if (options.cheats.infinite_lives == Cheat::CheatState::ENABLED) {
} else if (Options::cheats.infinite_lives == Options::Cheat::State::ENABLED) {
color_ = static_cast<Uint8>(PaletteColor::YELLOW);
} else {
color_ = static_cast<Uint8>(PaletteColor::WHITE);