mini-merdes
This commit is contained in:
@@ -18,22 +18,23 @@
|
||||
#include "core/resources/resource_helper.hpp" // Para ResourceHelper
|
||||
#include "core/resources/resource_list.hpp" // Para Asset, AssetType
|
||||
#include "core/resources/resource_loader.hpp" // Para ResourceLoader
|
||||
#include "game/gameplay/cheevos.hpp" // Para Cheevos
|
||||
#include "game/options.hpp" // Para Options, options, OptionsVideo
|
||||
#include "game/scene_manager.hpp" // Para SceneManager
|
||||
#include "game/scenes/credits.hpp" // Para Credits
|
||||
#include "game/scenes/ending.hpp" // Para Ending
|
||||
#include "game/scenes/ending2.hpp" // Para Ending2
|
||||
#include "game/scenes/game.hpp" // Para Game, GameMode
|
||||
#include "game/scenes/game_over.hpp" // Para GameOver
|
||||
#include "game/scenes/loading_screen.hpp" // Para LoadingScreen
|
||||
#include "game/scenes/logo.hpp" // Para Logo
|
||||
#include "game/scenes/title.hpp" // Para Title
|
||||
#include "game/ui/notifier.hpp" // Para Notifier
|
||||
#include "utils/defines.hpp" // Para WINDOW_CAPTION
|
||||
|
||||
#ifdef _DEBUG
|
||||
#include "core/system/debug.hpp" // Para Debug
|
||||
#endif
|
||||
#include "game/gameplay/cheevos.hpp" // Para Cheevos
|
||||
#include "game/options.hpp" // Para Options, options, OptionsVideo
|
||||
#include "game/scene_manager.hpp" // Para SceneManager
|
||||
#include "game/scenes/credits.hpp" // Para Credits
|
||||
#include "game/scenes/ending.hpp" // Para Ending
|
||||
#include "game/scenes/ending2.hpp" // Para Ending2
|
||||
#include "game/scenes/game.hpp" // Para Game, GameMode
|
||||
#include "game/scenes/game_over.hpp" // Para GameOver
|
||||
#include "game/scenes/loading_screen.hpp" // Para LoadingScreen
|
||||
#include "game/scenes/logo.hpp" // Para Logo
|
||||
#include "game/scenes/title.hpp" // Para Title
|
||||
#include "game/ui/notifier.hpp" // Para Notifier
|
||||
#include "utils/defines.hpp" // Para WINDOW_CAPTION
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <pwd.h>
|
||||
|
||||
@@ -65,7 +65,7 @@ constexpr bool ENABLED = true; // Sonido habilitado por defecto
|
||||
// --- CHEATS ---
|
||||
namespace Cheat {
|
||||
constexpr bool INFINITE_LIVES = false; // Vidas infinitas desactivadas por defecto
|
||||
constexpr bool INVINCIBLE = true; // Invencibilidad desactivada por defecto
|
||||
constexpr bool INVINCIBLE = false; // Invencibilidad desactivada por defecto
|
||||
constexpr bool JAIL_IS_OPEN = false; // Jail abierta desactivada por defecto
|
||||
constexpr bool ALTERNATE_SKIN = false; // Skin alternativa desactivada por defecto
|
||||
} // namespace Cheat
|
||||
|
||||
@@ -22,12 +22,6 @@ struct KeyboardControls {
|
||||
};
|
||||
|
||||
// Estructura para las opciones de control del gamepad/joystick
|
||||
// Los valores pueden ser:
|
||||
// - 0-20+: Botones SDL_GamepadButton (DPAD, face buttons, shoulders, etc.)
|
||||
// - 100: L2 trigger
|
||||
// - 101: R2 trigger
|
||||
// - 200: Left stick X axis (negativo = izquierda)
|
||||
// - 201: Left stick X axis (positivo = derecha)
|
||||
struct GamepadControls {
|
||||
int button_left{Defaults::Controls::GAMEPAD_BUTTON_LEFT}; // Botón para mover a la izquierda (por defecto: DPAD_LEFT)
|
||||
int button_right{Defaults::Controls::GAMEPAD_BUTTON_RIGHT}; // Botón para mover a la derecha (por defecto: DPAD_RIGHT)
|
||||
@@ -48,9 +42,7 @@ struct Cheat {
|
||||
|
||||
// Método para comprobar si alguno de los tres primeros trucos está activo
|
||||
[[nodiscard]] auto enabled() const -> bool {
|
||||
return infinite_lives == State::ENABLED ||
|
||||
invincible == State::ENABLED ||
|
||||
jail_is_open == State::ENABLED;
|
||||
return infinite_lives == State::ENABLED || invincible == State::ENABLED || jail_is_open == State::ENABLED;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -64,8 +56,8 @@ struct Stats {
|
||||
// Estructura con opciones de la ventana
|
||||
struct Window {
|
||||
std::string caption{Texts::WINDOW_CAPTION}; // Texto que aparece en la barra de título de la ventana
|
||||
int zoom{Defaults::Window::ZOOM}; // Zoom de la ventana
|
||||
int max_zoom{Defaults::Window::ZOOM}; // Máximo tamaño de zoom para la ventana
|
||||
int zoom{Defaults::Window::ZOOM}; // Zoom de la ventana
|
||||
int max_zoom{Defaults::Window::ZOOM}; // Máximo tamaño de zoom para la ventana
|
||||
};
|
||||
|
||||
// Estructura para gestionar el borde de la pantalla
|
||||
@@ -83,9 +75,9 @@ struct Video {
|
||||
bool shaders{Defaults::Video::SHADERS}; // Indica si se van a usar shaders o no
|
||||
bool integer_scale{Defaults::Video::INTEGER_SCALE}; // Indica si el escalado de la imagen ha de ser entero en el modo a pantalla completa
|
||||
bool keep_aspect{Defaults::Video::KEEP_ASPECT}; // Indica si se ha de mantener la relación de aspecto al poner el modo a pantalla completa
|
||||
Border border{}; // Borde de la pantalla
|
||||
std::string palette{Defaults::Video::PALETTE_NAME}; // Paleta de colores a usar en el juego
|
||||
std::string info; // Información sobre el modo de vídeo
|
||||
Border border{}; // Borde de la pantalla
|
||||
std::string palette{Defaults::Video::PALETTE_NAME}; // Paleta de colores a usar en el juego
|
||||
std::string info; // Información sobre el modo de vídeo
|
||||
};
|
||||
|
||||
// Estructura para las opciones de musica
|
||||
@@ -102,8 +94,8 @@ struct Sound {
|
||||
|
||||
// Estructura para las opciones de audio
|
||||
struct Audio {
|
||||
Music music{}; // Opciones para la música
|
||||
Sound sound{}; // Opciones para los efectos de sonido
|
||||
Music music{}; // Opciones para la música
|
||||
Sound sound{}; // Opciones para los efectos de sonido
|
||||
bool enabled{Defaults::Audio::ENABLED}; // Indica si el audio está activo o no
|
||||
float volume{Defaults::Audio::VOLUME}; // Volumen al que suenan el audio (0-128 internamente)
|
||||
};
|
||||
@@ -114,7 +106,7 @@ struct Game {
|
||||
float height{Defaults::Canvas::HEIGHT}; // Alto de la resolucion del juego
|
||||
};
|
||||
|
||||
// --- Variables globales (inline C++17+) ---
|
||||
// --- Variables globales ---
|
||||
inline std::string version{}; // Versión del fichero de configuración. Sirve para saber si las opciones son compatibles
|
||||
inline bool console{false}; // Indica si ha de mostrar información por la consola de texto
|
||||
inline Cheat cheats{}; // Contiene trucos y ventajas para el juego
|
||||
|
||||
@@ -39,10 +39,10 @@ Game::Game(Mode mode)
|
||||
mode_(mode),
|
||||
#ifdef _DEBUG
|
||||
current_room_("03.yaml"),
|
||||
spawn_data_(Player::SpawnData(25 * Tile::SIZE, 13 * Tile::SIZE, 0, 0, 0, Player::State::ON_GROUND, SDL_FLIP_HORIZONTAL))
|
||||
spawn_data_(Player::SpawnData(25 * Tile::SIZE, 13 * Tile::SIZE, 0, 0, 0, Player::State::ON_GROUND, Flip::LEFT))
|
||||
#else
|
||||
current_room_("03.yaml"),
|
||||
spawn_data_(Player::SpawnData(25 * Tile::SIZE, 13 * Tile::SIZE, 0, 0, 0, Player::State::ON_GROUND, SDL_FLIP_HORIZONTAL))
|
||||
spawn_data_(Player::SpawnData(25 * Tile::SIZE, 13 * Tile::SIZE, 0, 0, 0, Player::State::ON_GROUND, Flip::LEFT))
|
||||
#endif
|
||||
{
|
||||
// Crea objetos e inicializa variables
|
||||
|
||||
Reference in New Issue
Block a user