treballant en sdl3gpu

This commit is contained in:
2026-04-04 19:07:01 +02:00
parent 699989efb0
commit 2c7b70911e
22 changed files with 30964 additions and 28 deletions

View File

@@ -41,6 +41,26 @@ namespace Options {
}
}
static void loadVideoConfigFromYaml(const fkyaml::node& yaml) {
if (!yaml.contains("video")) return;
const auto& node = yaml["video"];
if (node.contains("gpu_acceleration"))
video.gpu_acceleration = node["gpu_acceleration"].get_value<bool>();
if (node.contains("shader_enabled"))
video.shader_enabled = node["shader_enabled"].get_value<bool>();
if (node.contains("supersampling"))
video.supersampling = node["supersampling"].get_value<bool>();
if (node.contains("integer_scale"))
video.integer_scale = node["integer_scale"].get_value<bool>();
if (node.contains("aspect_ratio_4_3"))
video.aspect_ratio_4_3 = node["aspect_ratio_4_3"].get_value<bool>();
if (node.contains("downscale_algo"))
video.downscale_algo = node["downscale_algo"].get_value<int>();
if (node.contains("linear_upscale"))
video.linear_upscale = node["linear_upscale"].get_value<bool>();
}
static void loadWindowConfigFromYaml(const fkyaml::node& yaml) {
if (!yaml.contains("window")) return;
const auto& node = yaml["window"];
@@ -94,6 +114,7 @@ namespace Options {
return true;
}
loadVideoConfigFromYaml(yaml);
loadWindowConfigFromYaml(yaml);
loadAudioConfigFromYaml(yaml);
loadGameConfigFromYaml(yaml);
@@ -129,6 +150,18 @@ namespace Options {
file << "version: \"" << Texts::VERSION << "\"\n";
file << "\n";
// VIDEO
file << "# VIDEO\n";
file << "video:\n";
file << " gpu_acceleration: " << (video.gpu_acceleration ? "true" : "false") << "\n";
file << " shader_enabled: " << (video.shader_enabled ? "true" : "false") << "\n";
file << " supersampling: " << (video.supersampling ? "true" : "false") << "\n";
file << " integer_scale: " << (video.integer_scale ? "true" : "false") << "\n";
file << " aspect_ratio_4_3: " << (video.aspect_ratio_4_3 ? "true" : "false") << "\n";
file << " downscale_algo: " << video.downscale_algo << " # 0=bilinear, 1=Lanczos2, 2=Lanczos3\n";
file << " linear_upscale: " << (video.linear_upscale ? "true" : "false") << "\n";
file << "\n";
// WINDOW
file << "# WINDOW\n";
file << "window:\n";