summaryrefslogtreecommitdiff
path: root/src/common/settings_common.cpp
diff options
context:
space:
mode:
authorGravatar lat9nq2023-06-12 17:05:30 -0400
committerGravatar lat9nq2023-07-21 10:56:54 -0400
commit11e7e1b8cec5a665bdc6c9e702f83ad6ea35dd6b (patch)
treec308cfcddc0ffd20561114559329411242e31bb5 /src/common/settings_common.cpp
parentsettings_setting: Fix errors (diff)
downloadyuzu-11e7e1b8cec5a665bdc6c9e702f83ad6ea35dd6b.tar.gz
yuzu-11e7e1b8cec5a665bdc6c9e702f83ad6ea35dd6b.tar.xz
yuzu-11e7e1b8cec5a665bdc6c9e702f83ad6ea35dd6b.zip
settings: Move some simple data to BasicSetting
Reduces the need for the compiler to duplicate this code, by about 100KB executable size.
Diffstat (limited to 'src/common/settings_common.cpp')
-rw-r--r--src/common/settings_common.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/common/settings_common.cpp b/src/common/settings_common.cpp
new file mode 100644
index 000000000..a7ce99515
--- /dev/null
+++ b/src/common/settings_common.cpp
@@ -0,0 +1,45 @@
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
7namespace Settings {
8
9BasicSetting::BasicSetting(Linkage& linkage, const std::string& name, enum Category category_,
10 bool save_, bool runtime_modifiable_)
11 : label{name}, category{category_}, id{linkage.count}, save{save_}, runtime_modifiable{
12 runtime_modifiable_} {
13 linkage.by_category[category].push_front(this);
14 linkage.count++;
15}
16
17BasicSetting::~BasicSetting() = default;
18
19std::string BasicSetting::ToStringGlobal() const {
20 return this->ToString();
21}
22
23bool BasicSetting::UsingGlobal() const {
24 return true;
25}
26
27void BasicSetting::SetGlobal(bool global) {}
28
29bool BasicSetting::Save() const {
30 return save;
31}
32
33bool BasicSetting::RuntimeModfiable() const {
34 return runtime_modifiable;
35}
36
37Category BasicSetting::Category() const {
38 return category;
39}
40
41const std::string& BasicSetting::GetLabel() const {
42 return label;
43}
44
45} // namespace Settings