forked from jaildesigner-jailgames/jaildoctors_dilemma
clang-tidy
This commit is contained in:
@@ -359,8 +359,8 @@ namespace Options {
|
||||
}
|
||||
if (sh_node.contains("current_shader")) {
|
||||
try {
|
||||
const std::string s = sh_node["current_shader"].get_value<std::string>();
|
||||
video.shader.current_shader = (s == "crtpi") ? Rendering::ShaderType::CRTPI : Rendering::ShaderType::POSTFX;
|
||||
const auto S = sh_node["current_shader"].get_value<std::string>();
|
||||
video.shader.current_shader = (S == "crtpi") ? Rendering::ShaderType::CRTPI : Rendering::ShaderType::POSTFX;
|
||||
} catch (...) {
|
||||
video.shader.current_shader = Rendering::ShaderType::POSTFX;
|
||||
}
|
||||
@@ -566,7 +566,7 @@ namespace Options {
|
||||
}
|
||||
|
||||
// Carga configuración de audio desde YAML
|
||||
void loadAudioConfigFromYaml(const fkyaml::node& yaml) {
|
||||
void loadAudioConfigFromYaml(const fkyaml::node& yaml) { // NOLINT(readability-function-cognitive-complexity)
|
||||
if (!yaml.contains("audio")) { return; }
|
||||
const auto& a = yaml["audio"];
|
||||
|
||||
@@ -688,9 +688,9 @@ namespace Options {
|
||||
|
||||
// Helper: retorna el nombre del preset PostFX actual (para guardar en config)
|
||||
auto currentPostFXPresetName() -> std::string {
|
||||
const auto idx = static_cast<size_t>(video.shader.current_postfx_preset);
|
||||
if (idx < postfx_presets.size()) {
|
||||
return postfx_presets[idx].name;
|
||||
const auto IDX = static_cast<size_t>(video.shader.current_postfx_preset);
|
||||
if (IDX < postfx_presets.size()) {
|
||||
return postfx_presets[IDX].name;
|
||||
}
|
||||
// Presets no cargados aún: devolver el nombre almacenado del config
|
||||
return video.shader.current_postfx_preset_name;
|
||||
@@ -698,9 +698,9 @@ namespace Options {
|
||||
|
||||
// Helper: retorna el nombre del preset CrtPi actual (para guardar en config)
|
||||
auto currentCrtPiPresetName() -> std::string {
|
||||
const auto idx = static_cast<size_t>(video.shader.current_crtpi_preset);
|
||||
if (idx < crtpi_presets.size()) {
|
||||
return crtpi_presets[idx].name;
|
||||
const auto IDX = static_cast<size_t>(video.shader.current_crtpi_preset);
|
||||
if (IDX < crtpi_presets.size()) {
|
||||
return crtpi_presets[IDX].name;
|
||||
}
|
||||
return video.shader.current_crtpi_preset_name;
|
||||
}
|
||||
@@ -1021,17 +1021,17 @@ namespace Options {
|
||||
}
|
||||
|
||||
// Carga los presets del shader CrtPi desde el fichero. Crea defaults si no existe.
|
||||
auto loadCrtPiFromFile() -> bool {
|
||||
auto loadCrtPiFromFile() -> bool { // NOLINT(readability-function-cognitive-complexity)
|
||||
crtpi_presets.clear();
|
||||
|
||||
std::ifstream file(crtpi_file_path);
|
||||
if (!file.good()) {
|
||||
std::cout << "CrtPi file not found, creating default: " << crtpi_file_path << '\n';
|
||||
// Crear directorio padre si no existe
|
||||
const std::filesystem::path p(crtpi_file_path);
|
||||
if (p.has_parent_path()) {
|
||||
const std::filesystem::path P(crtpi_file_path);
|
||||
if (P.has_parent_path()) {
|
||||
std::error_code ec;
|
||||
std::filesystem::create_directories(p.parent_path(), ec);
|
||||
std::filesystem::create_directories(P.parent_path(), ec);
|
||||
}
|
||||
// Escribir defaults
|
||||
std::ofstream out(crtpi_file_path);
|
||||
|
||||
Reference in New Issue
Block a user