diff options
author | lat9nq <lat9nq@virginia.edu> | 2020-07-10 04:42:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-10 04:42:09 +0200 |
commit | 63d23835ef4445b3a010cc0e8b1e73ebe012ac08 (patch) | |
tree | b243c1167280dbf2e3f5af4597b6638fb707f091 /src/yuzu_cmd | |
parent | Merge pull request #4281 from RealJohnGalt/linkfix2 (diff) | |
download | yuzu-63d23835ef4445b3a010cc0e8b1e73ebe012ac08.tar yuzu-63d23835ef4445b3a010cc0e8b1e73ebe012ac08.tar.gz yuzu-63d23835ef4445b3a010cc0e8b1e73ebe012ac08.tar.bz2 yuzu-63d23835ef4445b3a010cc0e8b1e73ebe012ac08.tar.lz yuzu-63d23835ef4445b3a010cc0e8b1e73ebe012ac08.tar.xz yuzu-63d23835ef4445b3a010cc0e8b1e73ebe012ac08.tar.zst yuzu-63d23835ef4445b3a010cc0e8b1e73ebe012ac08.zip |
Diffstat (limited to 'src/yuzu_cmd')
-rw-r--r-- | src/yuzu_cmd/config.cpp | 83 | ||||
-rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp | 2 | ||||
-rw-r--r-- | src/yuzu_cmd/yuzu.cpp | 2 |
3 files changed, 48 insertions, 39 deletions
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 659b9f701..23763144f 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp @@ -354,63 +354,72 @@ void Config::ReadValues() { const auto rng_seed_enabled = sdl2_config->GetBoolean("System", "rng_seed_enabled", false); if (rng_seed_enabled) { - Settings::values.rng_seed = sdl2_config->GetInteger("System", "rng_seed", 0); + Settings::values.rng_seed.SetValue(sdl2_config->GetInteger("System", "rng_seed", 0)); } else { - Settings::values.rng_seed = std::nullopt; + Settings::values.rng_seed.SetValue(std::nullopt); } const auto custom_rtc_enabled = sdl2_config->GetBoolean("System", "custom_rtc_enabled", false); if (custom_rtc_enabled) { - Settings::values.custom_rtc = - std::chrono::seconds(sdl2_config->GetInteger("System", "custom_rtc", 0)); + Settings::values.custom_rtc.SetValue( + std::chrono::seconds(sdl2_config->GetInteger("System", "custom_rtc", 0))); } else { - Settings::values.custom_rtc = std::nullopt; + Settings::values.custom_rtc.SetValue(std::nullopt); } - Settings::values.language_index = sdl2_config->GetInteger("System", "language_index", 1); - Settings::values.time_zone_index = sdl2_config->GetInteger("System", "time_zone_index", 0); + Settings::values.language_index.SetValue( + sdl2_config->GetInteger("System", "language_index", 1)); + Settings::values.time_zone_index.SetValue( + sdl2_config->GetInteger("System", "time_zone_index", 0)); // Core - Settings::values.use_multi_core = sdl2_config->GetBoolean("Core", "use_multi_core", false); + Settings::values.use_multi_core.SetValue( + sdl2_config->GetBoolean("Core", "use_multi_core", false)); // Renderer const int renderer_backend = sdl2_config->GetInteger( "Renderer", "backend", static_cast<int>(Settings::RendererBackend::OpenGL)); - Settings::values.renderer_backend = static_cast<Settings::RendererBackend>(renderer_backend); + Settings::values.renderer_backend.SetValue( + static_cast<Settings::RendererBackend>(renderer_backend)); Settings::values.renderer_debug = sdl2_config->GetBoolean("Renderer", "debug", false); - Settings::values.vulkan_device = sdl2_config->GetInteger("Renderer", "vulkan_device", 0); - - Settings::values.aspect_ratio = - static_cast<int>(sdl2_config->GetInteger("Renderer", "aspect_ratio", 0)); - Settings::values.max_anisotropy = - static_cast<int>(sdl2_config->GetInteger("Renderer", "max_anisotropy", 0)); - Settings::values.use_frame_limit = sdl2_config->GetBoolean("Renderer", "use_frame_limit", true); - Settings::values.frame_limit = - static_cast<u16>(sdl2_config->GetInteger("Renderer", "frame_limit", 100)); - Settings::values.use_disk_shader_cache = - sdl2_config->GetBoolean("Renderer", "use_disk_shader_cache", false); + Settings::values.vulkan_device.SetValue( + sdl2_config->GetInteger("Renderer", "vulkan_device", 0)); + + Settings::values.aspect_ratio.SetValue( + static_cast<int>(sdl2_config->GetInteger("Renderer", "aspect_ratio", 0))); + Settings::values.max_anisotropy.SetValue( + static_cast<int>(sdl2_config->GetInteger("Renderer", "max_anisotropy", 0))); + Settings::values.use_frame_limit.SetValue( + sdl2_config->GetBoolean("Renderer", "use_frame_limit", true)); + Settings::values.frame_limit.SetValue( + static_cast<u16>(sdl2_config->GetInteger("Renderer", "frame_limit", 100))); + Settings::values.use_disk_shader_cache.SetValue( + sdl2_config->GetBoolean("Renderer", "use_disk_shader_cache", false)); const int gpu_accuracy_level = sdl2_config->GetInteger("Renderer", "gpu_accuracy", 0); - Settings::values.gpu_accuracy = static_cast<Settings::GPUAccuracy>(gpu_accuracy_level); - Settings::values.use_asynchronous_gpu_emulation = - sdl2_config->GetBoolean("Renderer", "use_asynchronous_gpu_emulation", false); - Settings::values.use_vsync = - static_cast<u16>(sdl2_config->GetInteger("Renderer", "use_vsync", 1)); - Settings::values.use_assembly_shaders = - sdl2_config->GetBoolean("Renderer", "use_assembly_shaders", false); - Settings::values.use_fast_gpu_time = - sdl2_config->GetBoolean("Renderer", "use_fast_gpu_time", true); - - Settings::values.bg_red = static_cast<float>(sdl2_config->GetReal("Renderer", "bg_red", 0.0)); - Settings::values.bg_green = - static_cast<float>(sdl2_config->GetReal("Renderer", "bg_green", 0.0)); - Settings::values.bg_blue = static_cast<float>(sdl2_config->GetReal("Renderer", "bg_blue", 0.0)); + Settings::values.gpu_accuracy.SetValue(static_cast<Settings::GPUAccuracy>(gpu_accuracy_level)); + Settings::values.use_asynchronous_gpu_emulation.SetValue( + sdl2_config->GetBoolean("Renderer", "use_asynchronous_gpu_emulation", false)); + Settings::values.use_vsync.SetValue( + static_cast<u16>(sdl2_config->GetInteger("Renderer", "use_vsync", 1))); + Settings::values.use_assembly_shaders.SetValue( + sdl2_config->GetBoolean("Renderer", "use_assembly_shaders", false)); + Settings::values.use_fast_gpu_time.SetValue( + sdl2_config->GetBoolean("Renderer", "use_fast_gpu_time", true)); + + Settings::values.bg_red.SetValue( + static_cast<float>(sdl2_config->GetReal("Renderer", "bg_red", 0.0))); + Settings::values.bg_green.SetValue( + static_cast<float>(sdl2_config->GetReal("Renderer", "bg_green", 0.0))); + Settings::values.bg_blue.SetValue( + static_cast<float>(sdl2_config->GetReal("Renderer", "bg_blue", 0.0))); // Audio Settings::values.sink_id = sdl2_config->Get("Audio", "output_engine", "auto"); - Settings::values.enable_audio_stretching = - sdl2_config->GetBoolean("Audio", "enable_audio_stretching", true); + Settings::values.enable_audio_stretching.SetValue( + sdl2_config->GetBoolean("Audio", "enable_audio_stretching", true)); Settings::values.audio_device_id = sdl2_config->Get("Audio", "output_device", "auto"); - Settings::values.volume = static_cast<float>(sdl2_config->GetReal("Audio", "volume", 1)); + Settings::values.volume.SetValue( + static_cast<float>(sdl2_config->GetReal("Audio", "volume", 1))); // Miscellaneous Settings::values.log_filter = sdl2_config->Get("Miscellaneous", "log_filter", "*:Trace"); diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp index 09cc0a3b5..e78025737 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp @@ -165,7 +165,7 @@ std::unique_ptr<Core::Frontend::GraphicsContext> EmuWindow_SDL2_GL::CreateShared void EmuWindow_SDL2_GL::Present() { SDL_GL_MakeCurrent(render_window, window_context); - SDL_GL_SetSwapInterval(Settings::values.use_vsync ? 1 : 0); + SDL_GL_SetSwapInterval(Settings::values.use_vsync.GetValue() ? 1 : 0); while (IsOpen()) { system.Renderer().TryPresent(100); SDL_GL_SwapWindow(render_window); diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index e6c6a839d..512b060a7 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp @@ -181,7 +181,7 @@ int main(int argc, char** argv) { Core::System& system{Core::System::GetInstance()}; std::unique_ptr<EmuWindow_SDL2> emu_window; - switch (Settings::values.renderer_backend) { + switch (Settings::values.renderer_backend.GetValue()) { case Settings::RendererBackend::OpenGL: emu_window = std::make_unique<EmuWindow_SDL2_GL>(system, fullscreen); break; |