Files
aee-arcade/source/utils/defaults.hpp
T
JailDesignerandClaude Opus 4.7 bbb397abb2 refactor(core/rendering): nomenar constants a RenderInfo (HC-06/-07/-09 + PATCH-08)
render_info.cpp tenia diverses "cifres soltes" amb significat
estructural:
- Índex 0/1/2/3 dins segments_ per a FPS/driver/shader/temps — ara
  FPS_SEGMENT, DRIVER_SEGMENT, SHADER_SEGMENT, TIME_SEGMENT (HC-06).
- +1,+1 per a la ombra del text — ara SHADOW_OFFSET_PX (HC-09).
- % 3 al cicle de posicions de global_inputs.cpp — ara
  Defaults::RENDER_INFO_POSITION_COUNT (HC-07).

A més, init() assignava mono_digits=true al segment de temps que
refreshSegments() ja marca a cada crida, inclosa la primera d'update()
abans de render. S'elimina el doblegat (PATCH-08); el comentari
explica la garantia.

Build + smoke 5s xvfb OK (exit 124).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 09:47:49 +02:00

79 lines
3.4 KiB
C++

#pragma once
#include <SDL3/SDL.h>
#include <cstdint>
namespace Defaults {
// Mode de presentació lògica (escala finestra). Mapeja als valors de
// SDL_RendererLogicalPresentation des de Screen via una funció helper,
// perquè aquest header no depengui de detalls de SDL3 més enllà del scancode.
enum class ScalingMode : std::uint8_t {
DISABLED = 0,
STRETCH = 1,
LETTERBOX = 2,
OVERSCAN = 3,
INTEGER = 4,
};
// Filtre de textura per a l'upscale final.
enum class TextureFilter : std::uint8_t {
NEAREST = 0,
LINEAR = 1,
};
// Posició de l'overlay RenderInfo: apagat, a dalt o a baix del canvas.
// Cicle OFF → TOP → BOTTOM → OFF amb la hotkey corresponent.
enum class RenderInfoPosition : std::uint8_t {
OFF = 0,
TOP = 1,
BOTTOM = 2,
};
constexpr int RENDER_INFO_POSITION_COUNT = 3;
namespace Window {
constexpr int ZOOM = 3;
constexpr bool FULLSCREEN = false;
} // namespace Window
namespace I18n {
constexpr const char* LOCALE = "ca"; // Idioma per defecte (codi ISO 639-1).
constexpr const char* LOCALE_DIR = "data/locale/"; // Carpeta amb els YAML per idioma.
} // namespace I18n
namespace Video {
constexpr bool VSYNC = true;
constexpr ScalingMode SCALING_MODE = ScalingMode::LETTERBOX;
constexpr TextureFilter TEXTURE_FILTER = TextureFilter::NEAREST;
constexpr bool GPU_ACCELERATION = true; // Path SDL3 GPU per defecte; fallback a SDL_Renderer si falla.
constexpr const char* GPU_PREFERRED_DRIVER = ""; // Buit = auto. Aplica a l'arrencada.
constexpr bool SHADER_ENABLED = true; // Aplica PostFX; si false, sempre passthrough.
constexpr const char* CURRENT_SHADER = "postfx"; // Shader actiu: "postfx" o "crtpi".
constexpr const char* POSTFX_DEFAULT_PRESET = "CRT"; // Preset inicial PostFX.
constexpr const char* CRTPI_DEFAULT_PRESET = "DEFAULT"; // Preset inicial CrtPi.
constexpr const char* POSTFX_FILE = "shaders/postfx.yaml"; // Relatiu a la carpeta de sistema.
constexpr const char* CRTPI_FILE = "shaders/crtpi.yaml"; // Relatiu a la carpeta de sistema.
constexpr RenderInfoPosition RENDER_INFO_POSITION = RenderInfoPosition::OFF; // Overlay de debug amagat per defecte.
constexpr bool RENDER_INFO_SHOW_TIME = true; // Si l'overlay és visible, mostra el temps de joc.
} // namespace Video
namespace Audio {
constexpr bool ENABLED = true;
constexpr float VOLUME = 1.0F;
constexpr bool MUSIC_ENABLED = true;
constexpr float MUSIC_VOLUME = 0.8F;
constexpr bool SOUND_ENABLED = true;
constexpr float SOUND_VOLUME = 1.0F;
} // namespace Audio
namespace KeysGame {
constexpr SDL_Scancode UP = SDL_SCANCODE_UP;
constexpr SDL_Scancode DOWN = SDL_SCANCODE_DOWN;
constexpr SDL_Scancode LEFT = SDL_SCANCODE_LEFT;
constexpr SDL_Scancode RIGHT = SDL_SCANCODE_RIGHT;
constexpr SDL_Scancode EXIT = SDL_SCANCODE_ESCAPE;
} // namespace KeysGame
} // namespace Defaults