mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 01:29:41 +01:00
Config: Make the setting tables constexpr
SETTING now takes offsets with offsetof and passes them along with the setting's type, instead of the block and member pointers, and the ConfigSetting constructors are constexpr. So the tables are built at compile time, and later per-setting metadata can be checked by the compiler too. Defaults that weren't constants had to change: - AutoFrameSkip called IsVREnabled() during static initialization, before VR is set up. It's now a default callback, evaluated when the config is loaded or reset, which can turn it on by default on VR devices. - DisplayRefreshRate read g_Config's own initial value, which is 60. Path defaults now share the string member of the default union. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
71b38e58e6
commit
729047d449
3 files changed
+115
-150
No files matched your search
@@ -139,7 +139,7 @@ bool ConfigSetting::ReadFromIniSection(ConfigBlock *configBlock, const Section *
|
||||
if (defaultCallback_.p) {
|
||||
*target = defaultCallback_.p();
|
||||
} else {
|
||||
*target = Path(default_.p);
|
||||
*target = Path(default_.s);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -351,8 +351,8 @@ bool ConfigSetting::RestoreToDefault(ConfigBlock *configBlock, bool log) const {
|
||||
if (defaultCallback_.p) {
|
||||
*ptr_path = defaultCallback_.p();
|
||||
break;
|
||||
} else if (default_.p) {
|
||||
*ptr_path = Path(default_.p);
|
||||
} else if (default_.s) {
|
||||
*ptr_path = Path(default_.s);
|
||||
} else {
|
||||
ptr_path->clear();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user