Presets PostFX carregats de shaders/postfx.yaml; Screen aplica params (v0.5.0)

This commit is contained in:
JailDesigner committed 2026-04-18 23:02:06 +02:00
1 parent 6c8ef9ff44
commit 26b4d9e610
7 files changed
+194 -4

No files matched your search

+28
View File
@@ -1,8 +1,10 @@
#pragma once
#include <string>
#include <vector>
#include "core/rendering/screen.hpp"
#include "core/rendering/shader_backend.hpp"
#include "utils/defaults.hpp"
// Gestor de configuració del joc. És l'ÚNIC lloc que coneix YAML i la ruta
@@ -21,11 +23,30 @@ namespace Options {
std::string preferred_driver{Defaults::Video::GPU_PREFERRED_DRIVER};
};
struct Shader {
bool enabled{Defaults::Video::SHADER_ENABLED};
std::string current_postfx_preset{Defaults::Video::POSTFX_DEFAULT_PRESET};
};
struct Video {
bool vsync{Defaults::Video::VSYNC};
Defaults::ScalingMode scaling_mode{Defaults::Video::SCALING_MODE};
Defaults::TextureFilter texture_filter{Defaults::Video::TEXTURE_FILTER};
Gpu gpu{};
Shader shader{};
};
// Preset d'efectes PostFX (un per entrada a postfx.yaml).
struct PostFXPreset {
std::string name;
float vignette{0.0F};
float scanlines{0.0F};
float chroma{0.0F};
float mask{0.0F};
float gamma{0.0F};
float curvature{0.0F};
float bleeding{0.0F};
float flicker{0.0F};
};
struct Music {
@@ -49,16 +70,23 @@ namespace Options {
// el programa sense necessitar un .cpp extra per a cada una) ---
inline std::string config_version{};
inline std::string config_file_path{};
inline std::string postfx_file_path{};
inline Window window{};
inline Video video{};
inline Audio audio{};
inline std::vector<PostFXPreset> postfx_presets{};
// --- API pública ---
void setConfigFile(const std::string& path);
auto loadFromFile() -> bool;
auto saveToFile() -> bool;
void setPostFXFile(const std::string& path);
auto loadPostFXFromFile() -> bool;
auto savePostFXToFile() -> bool;
// --- Builders per als subsistemes ---
[[nodiscard]] auto buildScreenConfig() -> Screen::Config;
[[nodiscard]] auto buildPostFXParams() -> Rendering::PostFXParams;
} // namespace Options