clang-format

clang-tidy (macos)
This commit is contained in:
2026-03-23 07:26:21 +01:00
parent 0ddb6c85e1
commit 6595b28790
65 changed files with 583 additions and 570 deletions

View File

@@ -308,6 +308,17 @@ namespace Options {
}
}
// Helper: carga el campo palette con validación extra
void loadPaletteFromYaml(const fkyaml::node& vid) {
if (!vid.contains("palette")) { return; }
try {
auto palette_str = vid["palette"].get_value<std::string>();
video.palette = isValidPalette(palette_str) ? palette_str : Defaults::Video::PALETTE_NAME;
} catch (...) {
video.palette = Defaults::Video::PALETTE_NAME;
}
}
// Carga los campos básicos de configuración de video
void loadBasicVideoFieldsFromYaml(const fkyaml::node& vid) {
// fullscreen (antes era "mode")
@@ -377,18 +388,7 @@ namespace Options {
}
}
if (vid.contains("palette")) {
try {
auto palette_str = vid["palette"].get_value<std::string>();
if (isValidPalette(palette_str)) {
video.palette = palette_str;
} else {
video.palette = Defaults::Video::PALETTE_NAME;
}
} catch (...) {
video.palette = Defaults::Video::PALETTE_NAME;
}
}
loadPaletteFromYaml(vid);
}
// Carga configuración de video desde YAML
@@ -745,7 +745,9 @@ namespace Options {
// Preservar el índice cargado desde config.yaml; clampar al rango válido.
if (!postfx_presets.empty()) {
current_postfx_preset = std::clamp(
current_postfx_preset, 0, static_cast<int>(postfx_presets.size()) - 1);
current_postfx_preset,
0,
static_cast<int>(postfx_presets.size()) - 1);
} else {
current_postfx_preset = 0;
}
@@ -854,12 +856,12 @@ namespace Options {
// Cargar los presets recién creados
postfx_presets.clear();
postfx_presets.push_back({"CRT", 0.6F, 0.7F, 0.3F, 0.6F, 0.8F, 0.0F, 0.0F, 0.0F});
postfx_presets.push_back({"NTSC", 0.4F, 0.5F, 0.2F, 0.4F, 0.5F, 0.0F, 0.6F, 0.0F});
postfx_presets.push_back({"CURVED", 0.5F, 0.6F, 0.1F, 0.5F, 0.7F, 0.8F, 0.0F, 0.0F});
postfx_presets.push_back({"SCANLINES",0.0F, 0.8F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F});
postfx_presets.push_back({"SUBTLE", 0.3F, 0.4F, 0.05F, 0.0F, 0.3F, 0.0F, 0.0F, 0.0F});
postfx_presets.push_back({"CRT LIVE", 0.5F, 0.6F, 0.3F, 0.3F, 0.4F, 0.3F, 0.4F, 0.8F});
postfx_presets.push_back({"CRT", 0.6F, 0.7F, 0.3F, 0.6F, 0.8F, 0.0F, 0.0F, 0.0F});
postfx_presets.push_back({"NTSC", 0.4F, 0.5F, 0.2F, 0.4F, 0.5F, 0.0F, 0.6F, 0.0F});
postfx_presets.push_back({"CURVED", 0.5F, 0.6F, 0.1F, 0.5F, 0.7F, 0.8F, 0.0F, 0.0F});
postfx_presets.push_back({"SCANLINES", 0.0F, 0.8F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F});
postfx_presets.push_back({"SUBTLE", 0.3F, 0.4F, 0.05F, 0.0F, 0.3F, 0.0F, 0.0F, 0.0F});
postfx_presets.push_back({"CRT LIVE", 0.5F, 0.6F, 0.3F, 0.3F, 0.4F, 0.3F, 0.4F, 0.8F});
current_postfx_preset = 0;
return true;