linters
This commit is contained in:
@@ -368,12 +368,14 @@ namespace Options {
|
||||
if (sh_node.contains("current_postfx_preset")) {
|
||||
try {
|
||||
video.shader.current_postfx_preset_name = sh_node["current_postfx_preset"].get_value<std::string>();
|
||||
} catch (...) {}
|
||||
} catch (...) { /* @INTENTIONAL: campo yaml ausente o malformado → dejar default */
|
||||
}
|
||||
}
|
||||
if (sh_node.contains("current_crtpi_preset")) {
|
||||
try {
|
||||
video.shader.current_crtpi_preset_name = sh_node["current_crtpi_preset"].get_value<std::string>();
|
||||
} catch (...) {}
|
||||
} catch (...) { /* @INTENTIONAL: campo yaml ausente o malformado → dejar default */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -551,24 +553,28 @@ namespace Options {
|
||||
if (a.contains("enabled")) {
|
||||
try {
|
||||
audio.enabled = a["enabled"].get_value<bool>();
|
||||
} catch (...) {}
|
||||
} catch (...) { /* @INTENTIONAL: campo yaml ausente o malformado → dejar default */
|
||||
}
|
||||
}
|
||||
if (a.contains("volume")) {
|
||||
try {
|
||||
audio.volume = std::clamp(a["volume"].get_value<float>(), 0.0F, 1.0F);
|
||||
} catch (...) {}
|
||||
} catch (...) { /* @INTENTIONAL: campo yaml ausente o malformado → dejar default */
|
||||
}
|
||||
}
|
||||
if (a.contains("music")) {
|
||||
const auto& m = a["music"];
|
||||
if (m.contains("enabled")) {
|
||||
try {
|
||||
audio.music.enabled = m["enabled"].get_value<bool>();
|
||||
} catch (...) {}
|
||||
} catch (...) { /* @INTENTIONAL: campo yaml ausente o malformado → dejar default */
|
||||
}
|
||||
}
|
||||
if (m.contains("volume")) {
|
||||
try {
|
||||
audio.music.volume = std::clamp(m["volume"].get_value<float>(), 0.0F, 1.0F);
|
||||
} catch (...) {}
|
||||
} catch (...) { /* @INTENTIONAL: campo yaml ausente o malformado → dejar default */
|
||||
}
|
||||
}
|
||||
}
|
||||
if (a.contains("sound")) {
|
||||
@@ -576,12 +582,14 @@ namespace Options {
|
||||
if (s.contains("enabled")) {
|
||||
try {
|
||||
audio.sound.enabled = s["enabled"].get_value<bool>();
|
||||
} catch (...) {}
|
||||
} catch (...) { /* @INTENTIONAL: campo yaml ausente o malformado → dejar default */
|
||||
}
|
||||
}
|
||||
if (s.contains("volume")) {
|
||||
try {
|
||||
audio.sound.volume = std::clamp(s["volume"].get_value<float>(), 0.0F, 1.0F);
|
||||
} catch (...) {}
|
||||
} catch (...) { /* @INTENTIONAL: campo yaml ausente o malformado → dejar default */
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -594,27 +602,32 @@ namespace Options {
|
||||
if (c.contains("transparent")) {
|
||||
try {
|
||||
console.transparent = c["transparent"].get_value<bool>();
|
||||
} catch (...) {}
|
||||
} catch (...) { /* @INTENTIONAL: campo yaml ausente o malformado → dejar default */
|
||||
}
|
||||
}
|
||||
if (c.contains("bg_color")) {
|
||||
try {
|
||||
console.bg_color = std::clamp(c["bg_color"].get_value<int>(), 0, 255);
|
||||
} catch (...) {}
|
||||
} catch (...) { /* @INTENTIONAL: campo yaml ausente o malformado → dejar default */
|
||||
}
|
||||
}
|
||||
if (c.contains("msg_color")) {
|
||||
try {
|
||||
console.msg_color = std::clamp(c["msg_color"].get_value<int>(), 0, 255);
|
||||
} catch (...) {}
|
||||
} catch (...) { /* @INTENTIONAL: campo yaml ausente o malformado → dejar default */
|
||||
}
|
||||
}
|
||||
if (c.contains("prompt_color")) {
|
||||
try {
|
||||
console.prompt_color = std::clamp(c["prompt_color"].get_value<int>(), 0, 255);
|
||||
} catch (...) {}
|
||||
} catch (...) { /* @INTENTIONAL: campo yaml ausente o malformado → dejar default */
|
||||
}
|
||||
}
|
||||
if (c.contains("command_color")) {
|
||||
try {
|
||||
console.command_color = std::clamp(c["command_color"].get_value<int>(), 0, 255);
|
||||
} catch (...) {}
|
||||
} catch (...) { /* @INTENTIONAL: campo yaml ausente o malformado → dejar default */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -876,7 +889,8 @@ namespace Options {
|
||||
if (node.contains(key)) {
|
||||
try {
|
||||
target = node[key].get_value<float>();
|
||||
} catch (...) {}
|
||||
} catch (...) { /* @INTENTIONAL: campo yaml ausente o malformado → dejar default */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1166,32 +1180,38 @@ namespace Options {
|
||||
if (p.contains("mask_type")) {
|
||||
try {
|
||||
preset.mask_type = p["mask_type"].get_value<int>();
|
||||
} catch (...) {}
|
||||
} catch (...) { /* @INTENTIONAL: campo yaml ausente o malformado → dejar default */
|
||||
}
|
||||
}
|
||||
if (p.contains("enable_scanlines")) {
|
||||
try {
|
||||
preset.enable_scanlines = p["enable_scanlines"].get_value<bool>();
|
||||
} catch (...) {}
|
||||
} catch (...) { /* @INTENTIONAL: campo yaml ausente o malformado → dejar default */
|
||||
}
|
||||
}
|
||||
if (p.contains("enable_multisample")) {
|
||||
try {
|
||||
preset.enable_multisample = p["enable_multisample"].get_value<bool>();
|
||||
} catch (...) {}
|
||||
} catch (...) { /* @INTENTIONAL: campo yaml ausente o malformado → dejar default */
|
||||
}
|
||||
}
|
||||
if (p.contains("enable_gamma")) {
|
||||
try {
|
||||
preset.enable_gamma = p["enable_gamma"].get_value<bool>();
|
||||
} catch (...) {}
|
||||
} catch (...) { /* @INTENTIONAL: campo yaml ausente o malformado → dejar default */
|
||||
}
|
||||
}
|
||||
if (p.contains("enable_curvature")) {
|
||||
try {
|
||||
preset.enable_curvature = p["enable_curvature"].get_value<bool>();
|
||||
} catch (...) {}
|
||||
} catch (...) { /* @INTENTIONAL: campo yaml ausente o malformado → dejar default */
|
||||
}
|
||||
}
|
||||
if (p.contains("enable_sharper")) {
|
||||
try {
|
||||
preset.enable_sharper = p["enable_sharper"].get_value<bool>();
|
||||
} catch (...) {}
|
||||
} catch (...) { /* @INTENTIONAL: campo yaml ausente o malformado → dejar default */
|
||||
}
|
||||
}
|
||||
crtpi_presets.push_back(preset);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user