- renderInfo

- fix: no guardava el preset actual
This commit is contained in:
2026-04-04 20:14:11 +02:00
parent eb3f449a1e
commit d4fc7c0ee8
12 changed files with 197 additions and 6 deletions

View File

@@ -61,6 +61,31 @@ namespace Options {
video.downscale_algo = node["downscale_algo"].get_value<int>();
if (node.contains("linear_upscale"))
video.linear_upscale = node["linear_upscale"].get_value<bool>();
if (node.contains("current_shader"))
video.current_shader = node["current_shader"].get_value<std::string>();
if (node.contains("current_postfx_preset"))
video.current_postfx_preset = node["current_postfx_preset"].get_value<std::string>();
if (node.contains("current_crtpi_preset"))
video.current_crtpi_preset = node["current_crtpi_preset"].get_value<std::string>();
}
static void loadRenderInfoFromYaml(const fkyaml::node& yaml) {
if (!yaml.contains("render_info")) return;
const auto& node = yaml["render_info"];
if (node.contains("position")) {
auto pos = node["position"].get_value<std::string>();
if (pos == "top")
render_info.position = RenderInfoPosition::TOP;
else if (pos == "bottom")
render_info.position = RenderInfoPosition::BOTTOM;
else
render_info.position = RenderInfoPosition::OFF;
}
if (node.contains("text_color"))
render_info.text_color = static_cast<Uint32>(node["text_color"].get_value<uint64_t>());
if (node.contains("shadow_color"))
render_info.shadow_color = static_cast<Uint32>(node["shadow_color"].get_value<uint64_t>());
}
static void loadWindowConfigFromYaml(const fkyaml::node& yaml) {
@@ -117,6 +142,7 @@ namespace Options {
}
loadVideoConfigFromYaml(yaml);
loadRenderInfoFromYaml(yaml);
loadWindowConfigFromYaml(yaml);
loadAudioConfigFromYaml(yaml);
loadGameConfigFromYaml(yaml);
@@ -163,6 +189,24 @@ namespace Options {
file << " stretch_filter_linear: " << (video.stretch_filter_linear ? "true" : "false") << " # filtre 4:3: false=nearest, true=linear\n";
file << " downscale_algo: " << video.downscale_algo << " # 0=bilinear, 1=Lanczos2, 2=Lanczos3\n";
file << " linear_upscale: " << (video.linear_upscale ? "true" : "false") << "\n";
file << " current_shader: " << video.current_shader << "\n";
file << " current_postfx_preset: " << video.current_postfx_preset << "\n";
file << " current_crtpi_preset: " << video.current_crtpi_preset << "\n";
file << "\n";
// RENDER INFO
file << "# RENDER INFO\n";
file << "render_info:\n";
{
const char* pos = "off";
if (render_info.position == RenderInfoPosition::TOP)
pos = "top";
else if (render_info.position == RenderInfoPosition::BOTTOM)
pos = "bottom";
file << " position: " << pos << " # off/top/bottom\n";
}
file << " text_color: " << render_info.text_color << "\n";
file << " shadow_color: " << render_info.shadow_color << "\n";
file << "\n";
// WINDOW