presentation: bool integer_scale -> enum PresentationMode (integer_scale|letterbox|stretched|overscan) amb migracio de configs antics

This commit is contained in:
2026-05-19 20:29:22 +02:00
parent ac997c185d
commit 20325ddd5a
8 changed files with 214 additions and 69 deletions
+16 -1
View File
@@ -18,6 +18,16 @@
namespace Options {
// Modes de presentacio del canvas virtual a la finestra. Tot fullscreen i
// windowed amb zoom no-fit el respecta; en windowed amb zoom exacte (1x/2x/3x)
// l'efecte es null perque el canvas ja encaixa amb la finestra.
enum class PresentationMode : std::uint8_t {
INTEGER_SCALE, // Multiple enter (1x, 2x, 3x...), centrat, amb barres
LETTERBOX, // Mante aspect ratio, centrat, amb barres
STRETCHED, // Omple tota la finestra, deforma l'aspect ratio
OVERSCAN // Mante aspect ratio i omple la finestra retallant el contingut fora
};
struct Window {
std::string caption = Defaults::Window::CAPTION;
int zoom = Defaults::Window::ZOOM;
@@ -42,11 +52,16 @@ namespace Options {
SDL_ScaleMode scale_mode = Defaults::Video::SCALE_MODE;
bool fullscreen = Defaults::Video::FULLSCREEN;
bool vsync = Defaults::Video::VSYNC;
bool integer_scale = Defaults::Video::INTEGER_SCALE;
PresentationMode presentation_mode = PresentationMode::INTEGER_SCALE;
GPU gpu;
ShaderConfig shader;
};
// Conversions string <-> PresentationMode per a config.yaml i notificacions
auto presentationModeToString(PresentationMode m) -> const char *;
auto presentationModeFromString(const std::string &s) -> PresentationMode;
auto nextPresentationMode(PresentationMode m) -> PresentationMode;
struct Music {
bool enabled = Defaults::Music::ENABLED;
float volume = Defaults::Music::VOLUME;