varies coses i detallets

This commit is contained in:
2026-04-16 18:46:58 +02:00
parent fe41919e1e
commit 6394e9afab
17 changed files with 513 additions and 156 deletions

View File

@@ -2,21 +2,7 @@
#include <SDL3/SDL.h>
// Tecles GUI (capa de presentació — finestra, zoom, shaders, etc.)
namespace Defaults::KeysGUI {
constexpr SDL_Scancode DEC_ZOOM = SDL_SCANCODE_F1;
constexpr SDL_Scancode INC_ZOOM = SDL_SCANCODE_F2;
constexpr SDL_Scancode FULLSCREEN = SDL_SCANCODE_F3;
constexpr SDL_Scancode TOGGLE_SHADER = SDL_SCANCODE_F4;
constexpr SDL_Scancode TOGGLE_ASPECT_RATIO = SDL_SCANCODE_F5;
constexpr SDL_Scancode TOGGLE_SUPERSAMPLING = SDL_SCANCODE_F6;
constexpr SDL_Scancode NEXT_SHADER = SDL_SCANCODE_F7;
constexpr SDL_Scancode NEXT_SHADER_PRESET = SDL_SCANCODE_F8;
constexpr SDL_Scancode TOGGLE_STRETCH_FILTER = SDL_SCANCODE_F9;
constexpr SDL_Scancode TOGGLE_RENDER_INFO = SDL_SCANCODE_F10;
constexpr SDL_Scancode PAUSE_TOGGLE = SDL_SCANCODE_F11;
constexpr SDL_Scancode MENU_TOGGLE = SDL_SCANCODE_F12;
} // namespace Defaults::KeysGUI
// Tecles GUI: viuen a data/input/keys.yaml (font única — KeyConfig).
// Tecles de joc (moviment del personatge, accions)
namespace Defaults::KeysGame {

View File

@@ -58,7 +58,7 @@ void ModuleGame::onEnter() {
// Arranca el fade-in tick-based. El `PaletteFade` avança un pas (de
// 32) per cada tick; durant aquesta fase el gameplay no corre,
// només Draw+fade. Substituïx la crida bloquejant `JD8_FadeToPal`.
fade_.startFadeTo(JD8_LoadPalette(info::ctx.pepe_activat ? "frames2.gif" : "frames.gif"));
fade_.startFadeTo(JD8_LoadPalette(info::ctx.pepe_activat ? "gfx/frames2.gif" : "gfx/frames.gif"));
phase_ = Phase::FadingIn;
}

View File

@@ -189,8 +189,6 @@ namespace Options {
loadScancodeField(node, "down", keys_game.down);
loadScancodeField(node, "left", keys_game.left);
loadScancodeField(node, "right", keys_game.right);
loadScancodeField(node, "menu_toggle", keys_gui.menu_toggle);
loadScancodeField(node, "pause_toggle", keys_gui.pause_toggle);
}
}
@@ -333,15 +331,14 @@ namespace Options {
file << " show_title_credits: " << (game.show_title_credits ? "true" : "false") << "\n";
file << "\n";
// CONTROLS
file << "# CONTROLS (noms SDL: \"Up\", \"Down\", \"W\", \"Space\", \"F12\", etc.)\n";
// CONTROLS — només moviment del jugador. Les tecles d'UI viuen a
// data/input/keys.yaml (defaults) + ~/.config/jailgames/aee/keys.yaml (overrides).
file << "# CONTROLS (noms SDL: \"Up\", \"Down\", \"W\", \"Space\", etc.)\n";
file << "controls:\n";
file << " up: \"" << SDL_GetScancodeName(keys_game.up) << "\"\n";
file << " down: \"" << SDL_GetScancodeName(keys_game.down) << "\"\n";
file << " left: \"" << SDL_GetScancodeName(keys_game.left) << "\"\n";
file << " right: \"" << SDL_GetScancodeName(keys_game.right) << "\"\n";
file << " menu_toggle: \"" << SDL_GetScancodeName(keys_gui.menu_toggle) << "\"\n";
file << " pause_toggle: \"" << SDL_GetScancodeName(keys_gui.pause_toggle) << "\"\n";
file.close();

View File

@@ -8,23 +8,8 @@
namespace Options {
// Tecles GUI (finestra, zoom, shaders)
struct KeysGUI {
SDL_Scancode dec_zoom{Defaults::KeysGUI::DEC_ZOOM};
SDL_Scancode inc_zoom{Defaults::KeysGUI::INC_ZOOM};
SDL_Scancode fullscreen{Defaults::KeysGUI::FULLSCREEN};
SDL_Scancode toggle_shader{Defaults::KeysGUI::TOGGLE_SHADER};
SDL_Scancode toggle_aspect_ratio{Defaults::KeysGUI::TOGGLE_ASPECT_RATIO};
SDL_Scancode toggle_supersampling{Defaults::KeysGUI::TOGGLE_SUPERSAMPLING};
SDL_Scancode next_shader{Defaults::KeysGUI::NEXT_SHADER};
SDL_Scancode next_shader_preset{Defaults::KeysGUI::NEXT_SHADER_PRESET};
SDL_Scancode toggle_stretch_filter{Defaults::KeysGUI::TOGGLE_STRETCH_FILTER};
SDL_Scancode toggle_render_info{Defaults::KeysGUI::TOGGLE_RENDER_INFO};
SDL_Scancode pause_toggle{Defaults::KeysGUI::PAUSE_TOGGLE};
SDL_Scancode menu_toggle{Defaults::KeysGUI::MENU_TOGGLE};
};
// Tecles de joc (moviment, accions)
// Tecles de joc (moviment, accions). Les tecles d'UI viuen ara a KeyConfig
// (carregades de data/input/keys.yaml).
struct KeysGame {
SDL_Scancode up{Defaults::KeysGame::UP};
SDL_Scancode down{Defaults::KeysGame::DOWN};
@@ -123,7 +108,6 @@ namespace Options {
// --- Variables globals ---
inline std::string version{};
inline KeysGUI keys_gui{};
inline KeysGame keys_game{};
inline Video video{};
inline RenderInfo render_info{};