From 699bb34e6952c8d3455dd3d43749c52938b9549c Mon Sep 17 00:00:00 2001 From: tfarley Date: Sun, 3 May 2015 15:34:48 -0400 Subject: [PATCH] INI hw/sw renderer toggle --- src/citra/config.cpp | 2 ++ src/citra/default_ini.h | 4 ++++ src/citra_qt/config.cpp | 4 ++++ src/core/settings.h | 2 ++ 4 files changed, 12 insertions(+) diff --git a/src/citra/config.cpp b/src/citra/config.cpp index ab564559d..846479fd7 100644 --- a/src/citra/config.cpp +++ b/src/citra/config.cpp @@ -70,6 +70,8 @@ void Config::ReadValues() { Settings::values.frame_skip = glfw_config->GetInteger("Core", "frame_skip", 0); // Renderer + Settings::values.use_hw_renderer = glfw_config->GetBoolean("Renderer", "use_hw_renderer", false); + Settings::values.bg_red = (float)glfw_config->GetReal("Renderer", "bg_red", 1.0); Settings::values.bg_green = (float)glfw_config->GetReal("Renderer", "bg_green", 1.0); Settings::values.bg_blue = (float)glfw_config->GetReal("Renderer", "bg_blue", 1.0); diff --git a/src/citra/default_ini.h b/src/citra/default_ini.h index 1dd971926..fd5a90d56 100644 --- a/src/citra/default_ini.h +++ b/src/citra/default_ini.h @@ -42,6 +42,10 @@ gpu_refresh_rate = frame_skip = [Renderer] +# Whether to use software or hardware rendering. +# 0 (default): Software, 1: Hardware +use_hw_renderer = + # The clear color for the renderer. What shows up on the sides of the bottom screen. # Must be in range of 0.0-1.0. Defaults to 1.0 for all. bg_red = diff --git a/src/citra_qt/config.cpp b/src/citra_qt/config.cpp index fb85121b3..460f4ec07 100644 --- a/src/citra_qt/config.cpp +++ b/src/citra_qt/config.cpp @@ -54,6 +54,8 @@ void Config::ReadValues() { qt_config->endGroup(); qt_config->beginGroup("Renderer"); + Settings::values.use_hw_renderer = qt_config->value("use_hw_renderer", false).toBool(); + Settings::values.bg_red = qt_config->value("bg_red", 1.0).toFloat(); Settings::values.bg_green = qt_config->value("bg_green", 1.0).toFloat(); Settings::values.bg_blue = qt_config->value("bg_blue", 1.0).toFloat(); @@ -105,6 +107,8 @@ void Config::SaveValues() { qt_config->endGroup(); qt_config->beginGroup("Renderer"); + qt_config->setValue("use_hw_renderer", Settings::values.use_hw_renderer); + // Cast to double because Qt's written float values are not human-readable qt_config->setValue("bg_red", (double)Settings::values.bg_red); qt_config->setValue("bg_green", (double)Settings::values.bg_green); diff --git a/src/core/settings.h b/src/core/settings.h index 0f4700241..54c1023b8 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -45,6 +45,8 @@ struct Values { int region_value; // Renderer + bool use_hw_renderer; + float bg_red; float bg_green; float bg_blue;