mirror of
https://github.com/PancakeTAS/lsfg-vk.git
synced 2025-10-30 07:01:10 +00:00
fix using broken globals
This commit is contained in:
parent
8140e1ca13
commit
06fc427bdd
1 changed files with 7 additions and 11 deletions
|
|
@ -138,9 +138,7 @@ void Config::loadAndWatchConfig(const std::string& file) {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
/// Turn a string into a VkPresentModeKHR enum value.
|
/// Turn a string into a VkPresentModeKHR enum value.
|
||||||
VkPresentModeKHR into_present(const std::string& mode, VkPresentModeKHR defaultMode) {
|
VkPresentModeKHR into_present(const std::string& mode) {
|
||||||
if (mode.empty())
|
|
||||||
return defaultMode;
|
|
||||||
if (mode == "fifo" || mode == "vsync")
|
if (mode == "fifo" || mode == "vsync")
|
||||||
return VkPresentModeKHR::VK_PRESENT_MODE_FIFO_KHR;
|
return VkPresentModeKHR::VK_PRESENT_MODE_FIFO_KHR;
|
||||||
if (mode == "mailbox")
|
if (mode == "mailbox")
|
||||||
|
|
@ -237,14 +235,12 @@ void Config::updateConfig(const std::string& file) {
|
||||||
Configuration game{
|
Configuration game{
|
||||||
.enable = true,
|
.enable = true,
|
||||||
.env = parse_env(toml::find_or(gameTable, "env", std::string())),
|
.env = parse_env(toml::find_or(gameTable, "env", std::string())),
|
||||||
.multiplier = toml::find_or(gameTable, "multiplier", global.multiplier),
|
.multiplier = toml::find_or(gameTable, "multiplier", 2U),
|
||||||
.flowScale = toml::find_or(gameTable, "flow_scale", global.flowScale),
|
.flowScale = toml::find_or(gameTable, "flow_scale", 1.0F),
|
||||||
.performance = toml::find_or(gameTable, "performance_mode", global.performance),
|
.performance = toml::find_or(gameTable, "performance_mode", false),
|
||||||
.hdr = toml::find_or(gameTable, "hdr_mode", global.hdr),
|
.hdr = toml::find_or(gameTable, "hdr_mode", false),
|
||||||
.e_present = into_present(
|
.e_present = into_present(toml::find_or(gameTable, "experimental_present_mode", "")),
|
||||||
toml::find_or(gameTable, "experimental_present_mode", ""),
|
.e_fps_limit = toml::find_or(gameTable, "experimental_fps_limit", 0U),
|
||||||
global.e_present),
|
|
||||||
.e_fps_limit = toml::find_or(gameTable, "experimental_fps_limit", global.e_fps_limit),
|
|
||||||
.valid = global.valid // only need a single validity flag
|
.valid = global.valid // only need a single validity flag
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue