diff options
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/fs/path_util.cpp | 6 | ||||
| -rw-r--r-- | src/common/fs/path_util.h | 2 | ||||
| -rw-r--r-- | src/common/settings.cpp | 2 | ||||
| -rw-r--r-- | src/common/settings.h | 10 | ||||
| -rw-r--r-- | src/common/settings_common.h | 1 | ||||
| -rw-r--r-- | src/common/settings_enums.h | 7 | ||||
| -rw-r--r-- | src/common/settings_setting.h | 5 |
7 files changed, 19 insertions, 14 deletions
diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp index d2f50432a..4f69db6f5 100644 --- a/src/common/fs/path_util.cpp +++ b/src/common/fs/path_util.cpp | |||
| @@ -418,9 +418,9 @@ std::string SanitizePath(std::string_view path_, DirectorySeparator directory_se | |||
| 418 | return std::string(RemoveTrailingSlash(path)); | 418 | return std::string(RemoveTrailingSlash(path)); |
| 419 | } | 419 | } |
| 420 | 420 | ||
| 421 | std::string_view GetParentPath(std::string_view path) { | 421 | std::string GetParentPath(std::string_view path) { |
| 422 | if (path.empty()) { | 422 | if (path.empty()) { |
| 423 | return path; | 423 | return std::string(path); |
| 424 | } | 424 | } |
| 425 | 425 | ||
| 426 | #ifdef ANDROID | 426 | #ifdef ANDROID |
| @@ -439,7 +439,7 @@ std::string_view GetParentPath(std::string_view path) { | |||
| 439 | name_index = std::max(name_bck_index, name_fwd_index); | 439 | name_index = std::max(name_bck_index, name_fwd_index); |
| 440 | } | 440 | } |
| 441 | 441 | ||
| 442 | return path.substr(0, name_index); | 442 | return std::string(path.substr(0, name_index)); |
| 443 | } | 443 | } |
| 444 | 444 | ||
| 445 | std::string_view GetPathWithoutTop(std::string_view path) { | 445 | std::string_view GetPathWithoutTop(std::string_view path) { |
diff --git a/src/common/fs/path_util.h b/src/common/fs/path_util.h index 23c8b1359..59301e7ed 100644 --- a/src/common/fs/path_util.h +++ b/src/common/fs/path_util.h | |||
| @@ -302,7 +302,7 @@ enum class DirectorySeparator { | |||
| 302 | DirectorySeparator directory_separator = DirectorySeparator::ForwardSlash); | 302 | DirectorySeparator directory_separator = DirectorySeparator::ForwardSlash); |
| 303 | 303 | ||
| 304 | // Gets all of the text up to the last '/' or '\' in the path. | 304 | // Gets all of the text up to the last '/' or '\' in the path. |
| 305 | [[nodiscard]] std::string_view GetParentPath(std::string_view path); | 305 | [[nodiscard]] std::string GetParentPath(std::string_view path); |
| 306 | 306 | ||
| 307 | // Gets all of the text after the first '/' or '\' in the path. | 307 | // Gets all of the text after the first '/' or '\' in the path. |
| 308 | [[nodiscard]] std::string_view GetPathWithoutTop(std::string_view path); | 308 | [[nodiscard]] std::string_view GetPathWithoutTop(std::string_view path); |
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 88f509ba7..ea52bbfa6 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -211,6 +211,8 @@ const char* TranslateCategory(Category category) { | |||
| 211 | case Category::Debugging: | 211 | case Category::Debugging: |
| 212 | case Category::DebuggingGraphics: | 212 | case Category::DebuggingGraphics: |
| 213 | return "Debugging"; | 213 | return "Debugging"; |
| 214 | case Category::GpuDriver: | ||
| 215 | return "GpuDriver"; | ||
| 214 | case Category::Miscellaneous: | 216 | case Category::Miscellaneous: |
| 215 | return "Miscellaneous"; | 217 | return "Miscellaneous"; |
| 216 | case Category::Network: | 218 | case Category::Network: |
diff --git a/src/common/settings.h b/src/common/settings.h index 7dc18fffe..07dba53ab 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -197,7 +197,7 @@ struct Values { | |||
| 197 | SwitchableSetting<CpuAccuracy, true> cpu_accuracy{linkage, CpuAccuracy::Auto, | 197 | SwitchableSetting<CpuAccuracy, true> cpu_accuracy{linkage, CpuAccuracy::Auto, |
| 198 | CpuAccuracy::Auto, CpuAccuracy::Paranoid, | 198 | CpuAccuracy::Auto, CpuAccuracy::Paranoid, |
| 199 | "cpu_accuracy", Category::Cpu}; | 199 | "cpu_accuracy", Category::Cpu}; |
| 200 | Setting<bool> cpu_debug_mode{linkage, false, "cpu_debug_mode", Category::CpuDebug}; | 200 | SwitchableSetting<bool> cpu_debug_mode{linkage, false, "cpu_debug_mode", Category::CpuDebug}; |
| 201 | 201 | ||
| 202 | Setting<bool> cpuopt_page_tables{linkage, true, "cpuopt_page_tables", Category::CpuDebug}; | 202 | Setting<bool> cpuopt_page_tables{linkage, true, "cpuopt_page_tables", Category::CpuDebug}; |
| 203 | Setting<bool> cpuopt_block_linking{linkage, true, "cpuopt_block_linking", Category::CpuDebug}; | 203 | Setting<bool> cpuopt_block_linking{linkage, true, "cpuopt_block_linking", Category::CpuDebug}; |
| @@ -211,9 +211,9 @@ struct Values { | |||
| 211 | Setting<bool> cpuopt_misc_ir{linkage, true, "cpuopt_misc_ir", Category::CpuDebug}; | 211 | Setting<bool> cpuopt_misc_ir{linkage, true, "cpuopt_misc_ir", Category::CpuDebug}; |
| 212 | Setting<bool> cpuopt_reduce_misalign_checks{linkage, true, "cpuopt_reduce_misalign_checks", | 212 | Setting<bool> cpuopt_reduce_misalign_checks{linkage, true, "cpuopt_reduce_misalign_checks", |
| 213 | Category::CpuDebug}; | 213 | Category::CpuDebug}; |
| 214 | Setting<bool> cpuopt_fastmem{linkage, true, "cpuopt_fastmem", Category::CpuDebug}; | 214 | SwitchableSetting<bool> cpuopt_fastmem{linkage, true, "cpuopt_fastmem", Category::CpuDebug}; |
| 215 | Setting<bool> cpuopt_fastmem_exclusives{linkage, true, "cpuopt_fastmem_exclusives", | 215 | SwitchableSetting<bool> cpuopt_fastmem_exclusives{linkage, true, "cpuopt_fastmem_exclusives", |
| 216 | Category::CpuDebug}; | 216 | Category::CpuDebug}; |
| 217 | Setting<bool> cpuopt_recompile_exclusives{linkage, true, "cpuopt_recompile_exclusives", | 217 | Setting<bool> cpuopt_recompile_exclusives{linkage, true, "cpuopt_recompile_exclusives", |
| 218 | Category::CpuDebug}; | 218 | Category::CpuDebug}; |
| 219 | Setting<bool> cpuopt_ignore_memory_aborts{linkage, true, "cpuopt_ignore_memory_aborts", | 219 | Setting<bool> cpuopt_ignore_memory_aborts{linkage, true, "cpuopt_ignore_memory_aborts", |
| @@ -256,7 +256,7 @@ struct Values { | |||
| 256 | AstcDecodeMode::CpuAsynchronous, | 256 | AstcDecodeMode::CpuAsynchronous, |
| 257 | "accelerate_astc", | 257 | "accelerate_astc", |
| 258 | Category::Renderer}; | 258 | Category::Renderer}; |
| 259 | Setting<VSyncMode, true> vsync_mode{ | 259 | SwitchableSetting<VSyncMode, true> vsync_mode{ |
| 260 | linkage, VSyncMode::Fifo, VSyncMode::Immediate, VSyncMode::FifoRelaxed, | 260 | linkage, VSyncMode::Fifo, VSyncMode::Immediate, VSyncMode::FifoRelaxed, |
| 261 | "use_vsync", Category::Renderer, Specialization::RuntimeList, true, | 261 | "use_vsync", Category::Renderer, Specialization::RuntimeList, true, |
| 262 | true}; | 262 | true}; |
diff --git a/src/common/settings_common.h b/src/common/settings_common.h index 344c04439..c82e17495 100644 --- a/src/common/settings_common.h +++ b/src/common/settings_common.h | |||
| @@ -26,6 +26,7 @@ enum class Category : u32 { | |||
| 26 | DataStorage, | 26 | DataStorage, |
| 27 | Debugging, | 27 | Debugging, |
| 28 | DebuggingGraphics, | 28 | DebuggingGraphics, |
| 29 | GpuDriver, | ||
| 29 | Miscellaneous, | 30 | Miscellaneous, |
| 30 | Network, | 31 | Network, |
| 31 | WebService, | 32 | WebService, |
diff --git a/src/common/settings_enums.h b/src/common/settings_enums.h index d6351e57e..617036588 100644 --- a/src/common/settings_enums.h +++ b/src/common/settings_enums.h | |||
| @@ -82,16 +82,15 @@ enum class AudioEngine : u32 { | |||
| 82 | Cubeb, | 82 | Cubeb, |
| 83 | Sdl2, | 83 | Sdl2, |
| 84 | Null, | 84 | Null, |
| 85 | Oboe, | ||
| 85 | }; | 86 | }; |
| 86 | 87 | ||
| 87 | template <> | 88 | template <> |
| 88 | inline std::vector<std::pair<std::string, AudioEngine>> | 89 | inline std::vector<std::pair<std::string, AudioEngine>> |
| 89 | EnumMetadata<AudioEngine>::Canonicalizations() { | 90 | EnumMetadata<AudioEngine>::Canonicalizations() { |
| 90 | return { | 91 | return { |
| 91 | {"auto", AudioEngine::Auto}, | 92 | {"auto", AudioEngine::Auto}, {"cubeb", AudioEngine::Cubeb}, {"sdl2", AudioEngine::Sdl2}, |
| 92 | {"cubeb", AudioEngine::Cubeb}, | 93 | {"null", AudioEngine::Null}, {"oboe", AudioEngine::Oboe}, |
| 93 | {"sdl2", AudioEngine::Sdl2}, | ||
| 94 | {"null", AudioEngine::Null}, | ||
| 95 | }; | 94 | }; |
| 96 | } | 95 | } |
| 97 | 96 | ||
diff --git a/src/common/settings_setting.h b/src/common/settings_setting.h index 3175ab07d..0b18ca5ec 100644 --- a/src/common/settings_setting.h +++ b/src/common/settings_setting.h | |||
| @@ -81,6 +81,9 @@ public: | |||
| 81 | [[nodiscard]] virtual const Type& GetValue() const { | 81 | [[nodiscard]] virtual const Type& GetValue() const { |
| 82 | return value; | 82 | return value; |
| 83 | } | 83 | } |
| 84 | [[nodiscard]] virtual const Type& GetValue(bool need_global) const { | ||
| 85 | return value; | ||
| 86 | } | ||
| 84 | 87 | ||
| 85 | /** | 88 | /** |
| 86 | * Sets the setting to the given value. | 89 | * Sets the setting to the given value. |
| @@ -353,7 +356,7 @@ public: | |||
| 353 | } | 356 | } |
| 354 | return custom; | 357 | return custom; |
| 355 | } | 358 | } |
| 356 | [[nodiscard]] const Type& GetValue(bool need_global) const { | 359 | [[nodiscard]] const Type& GetValue(bool need_global) const override final { |
| 357 | if (use_global || need_global) { | 360 | if (use_global || need_global) { |
| 358 | return this->value; | 361 | return this->value; |
| 359 | } | 362 | } |