diff options
author | lat9nq <22451773+lat9nq@users.noreply.github.com> | 2023-06-12 17:05:30 -0400 |
---|---|---|
committer | lat9nq <22451773+lat9nq@users.noreply.github.com> | 2023-07-21 10:56:54 -0400 |
commit | 11e7e1b8cec5a665bdc6c9e702f83ad6ea35dd6b (patch) | |
tree | c308cfcddc0ffd20561114559329411242e31bb5 /src/common/settings_common.cpp | |
parent | 4903f40efe7b0c193309708ea01bd6abea8bac16 (diff) |
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.cpp | 45 |
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 @@ +// 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_) + : label{name}, category{category_}, id{linkage.count}, save{save_}, runtime_modifiable{ + runtime_modifiable_} { + linkage.by_category[category].push_front(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::Category() const { + return category; +} + +const std::string& BasicSetting::GetLabel() const { + return label; +} + +} // namespace Settings |