singletons
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "core/input/input.h" // for INPUT_USE_KEYBOARD, INPUT_USE_GAMECONTROLLER
|
||||
#include "core/locale/lang.h" // for MAX_LANGUAGES, en_UK
|
||||
#include "core/input/input.h" // for INPUT_USE_KEYBOARD, INPUT_USE_GAMECONTROLLER
|
||||
#include "core/locale/lang.h" // for MAX_LANGUAGES, en_UK
|
||||
#include "external/fkyaml_node.hpp" // for fkyaml::node
|
||||
#include "utils/utils.h" // for boolToString
|
||||
|
||||
@@ -456,7 +456,9 @@ namespace Options {
|
||||
for (const auto &p : yaml["presets"]) {
|
||||
PostFXPreset preset;
|
||||
if (p.contains("name")) {
|
||||
try { preset.name = p["name"].get_value<std::string>(); } catch (...) {}
|
||||
try {
|
||||
preset.name = p["name"].get_value<std::string>();
|
||||
} catch (...) {}
|
||||
}
|
||||
parseFloatField(p, "vignette", preset.vignette);
|
||||
parseFloatField(p, "scanlines", preset.scanlines);
|
||||
@@ -511,7 +513,9 @@ namespace Options {
|
||||
for (const auto &p : yaml["presets"]) {
|
||||
CrtPiPreset preset;
|
||||
if (p.contains("name")) {
|
||||
try { preset.name = p["name"].get_value<std::string>(); } catch (...) {}
|
||||
try {
|
||||
preset.name = p["name"].get_value<std::string>();
|
||||
} catch (...) {}
|
||||
}
|
||||
parseFloatField(p, "scanline_weight", preset.scanline_weight);
|
||||
parseFloatField(p, "scanline_gap_brightness", preset.scanline_gap_brightness);
|
||||
@@ -522,22 +526,34 @@ namespace Options {
|
||||
parseFloatField(p, "curvature_x", preset.curvature_x);
|
||||
parseFloatField(p, "curvature_y", preset.curvature_y);
|
||||
if (p.contains("mask_type")) {
|
||||
try { preset.mask_type = p["mask_type"].get_value<int>(); } catch (...) {}
|
||||
try {
|
||||
preset.mask_type = p["mask_type"].get_value<int>();
|
||||
} catch (...) {}
|
||||
}
|
||||
if (p.contains("enable_scanlines")) {
|
||||
try { preset.enable_scanlines = p["enable_scanlines"].get_value<bool>(); } catch (...) {}
|
||||
try {
|
||||
preset.enable_scanlines = p["enable_scanlines"].get_value<bool>();
|
||||
} catch (...) {}
|
||||
}
|
||||
if (p.contains("enable_multisample")) {
|
||||
try { preset.enable_multisample = p["enable_multisample"].get_value<bool>(); } catch (...) {}
|
||||
try {
|
||||
preset.enable_multisample = p["enable_multisample"].get_value<bool>();
|
||||
} catch (...) {}
|
||||
}
|
||||
if (p.contains("enable_gamma")) {
|
||||
try { preset.enable_gamma = p["enable_gamma"].get_value<bool>(); } catch (...) {}
|
||||
try {
|
||||
preset.enable_gamma = p["enable_gamma"].get_value<bool>();
|
||||
} catch (...) {}
|
||||
}
|
||||
if (p.contains("enable_curvature")) {
|
||||
try { preset.enable_curvature = p["enable_curvature"].get_value<bool>(); } catch (...) {}
|
||||
try {
|
||||
preset.enable_curvature = p["enable_curvature"].get_value<bool>();
|
||||
} catch (...) {}
|
||||
}
|
||||
if (p.contains("enable_sharper")) {
|
||||
try { preset.enable_sharper = p["enable_sharper"].get_value<bool>(); } catch (...) {}
|
||||
try {
|
||||
preset.enable_sharper = p["enable_sharper"].get_value<bool>();
|
||||
} catch (...) {}
|
||||
}
|
||||
crtpi_presets.push_back(preset);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user