diff options
| author | liamwhite <liamwhite@users.noreply.github.com> | 2023-08-02 14:25:52 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-02 14:25:52 -0400 |
| commit | 28b236b988a7680ac29162ff0b3e98ca514e21e3 (patch) | |
| tree | bbded6cf80886c6def87bae92cf6784340165de9 /src/common/settings_common.cpp | |
| parent | 14f64dd3e14e857934e952f8535462b23f2ae918 (diff) | |
| parent | 53f9d7d61aa8c0526bf57e9d9d275af12595d2d9 (diff) | |
Merge pull request #10839 from lat9nq/pgc-plus
general: Reimplement per-game configurations
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 0000000000..dedf5ef909 --- /dev/null +++ b/src/common/settings_common.cpp @@ -0,0 +1,58 @@ +// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include <string> +#include "common/settings_common.h" + +namespace Settings { + +BasicSetting::BasicSetting(Linkage& linkage, const std::string& name, enum Category category_, + bool save_, bool runtime_modifiable_, u32 specialization_, + BasicSetting* other_setting_) + : label{name}, category{category_}, id{linkage.count}, save{save_}, + runtime_modifiable{runtime_modifiable_}, specialization{specialization_}, + other_setting{other_setting_} { + linkage.by_category[category].push_back(this); + linkage.count++; +} + +BasicSetting::~BasicSetting() = default; + +std::string BasicSetting::ToStringGlobal() const { + return this->ToString(); +} + +bool BasicSetting::UsingGlobal() const { + return true; +} + +void BasicSetting::SetGlobal(bool global) {} + +bool BasicSetting::Save() const { + return save; +} + +bool BasicSetting::RuntimeModfiable() const { + return runtime_modifiable; +} + +Category BasicSetting::GetCategory() const { + return category; +} + +u32 BasicSetting::Specialization() const { + return specialization; +} + +BasicSetting* BasicSetting::PairedSetting() const { + return other_setting; +} + +const std::string& BasicSetting::GetLabel() const { + return label; +} + +Linkage::Linkage(u32 initial_count) : count{initial_count} {} +Linkage::~Linkage() = default; + +} // namespace Settings |
