diff options
Diffstat (limited to 'src/common/settings_common.cpp')
| -rw-r--r-- | src/common/settings_common.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/common/settings_common.cpp b/src/common/settings_common.cpp new file mode 100644 index 000000000..dedf5ef90 --- /dev/null +++ b/src/common/settings_common.cpp | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #include <string> | ||
| 5 | #include "common/settings_common.h" | ||
| 6 | |||
| 7 | namespace Settings { | ||
| 8 | |||
| 9 | BasicSetting::BasicSetting(Linkage& linkage, const std::string& name, enum Category category_, | ||
| 10 | bool save_, bool runtime_modifiable_, u32 specialization_, | ||
| 11 | BasicSetting* other_setting_) | ||
| 12 | : label{name}, category{category_}, id{linkage.count}, save{save_}, | ||
| 13 | runtime_modifiable{runtime_modifiable_}, specialization{specialization_}, | ||
| 14 | other_setting{other_setting_} { | ||
| 15 | linkage.by_category[category].push_back(this); | ||
| 16 | linkage.count++; | ||
| 17 | } | ||
| 18 | |||
| 19 | BasicSetting::~BasicSetting() = default; | ||
| 20 | |||
| 21 | std::string BasicSetting::ToStringGlobal() const { | ||
| 22 | return this->ToString(); | ||
| 23 | } | ||
| 24 | |||
| 25 | bool BasicSetting::UsingGlobal() const { | ||
| 26 | return true; | ||
| 27 | } | ||
| 28 | |||
| 29 | void BasicSetting::SetGlobal(bool global) {} | ||
| 30 | |||
| 31 | bool BasicSetting::Save() const { | ||
| 32 | return save; | ||
| 33 | } | ||
| 34 | |||
| 35 | bool BasicSetting::RuntimeModfiable() const { | ||
| 36 | return runtime_modifiable; | ||
| 37 | } | ||
| 38 | |||
| 39 | Category BasicSetting::GetCategory() const { | ||
| 40 | return category; | ||
| 41 | } | ||
| 42 | |||
| 43 | u32 BasicSetting::Specialization() const { | ||
| 44 | return specialization; | ||
| 45 | } | ||
| 46 | |||
| 47 | BasicSetting* BasicSetting::PairedSetting() const { | ||
| 48 | return other_setting; | ||
| 49 | } | ||
| 50 | |||
| 51 | const std::string& BasicSetting::GetLabel() const { | ||
| 52 | return label; | ||
| 53 | } | ||
| 54 | |||
| 55 | Linkage::Linkage(u32 initial_count) : count{initial_count} {} | ||
| 56 | Linkage::~Linkage() = default; | ||
| 57 | |||
| 58 | } // namespace Settings | ||