More config refactor

This commit is contained in:
Henrik Rydgård committed 2025-10-29 15:41:41 +01:00
1 parent a26529fd03
commit 7578a1935b
4 files changed
+51 -52

No files matched your search

+3 -8
View File
@@ -8,16 +8,11 @@
#include "Core/ConfigValues.h"
#include "Core/Config.h"
std::unordered_map<void*, ConfigSetting*>& ConfigSetting::getPtrLUT() {
static std::unordered_map<void*, ConfigSetting*> lut;
return lut;
}
bool ConfigSetting::perGame(void *ptr) {
return g_Config.bGameSpecific && getPtrLUT().count(ptr) > 0 && getPtrLUT()[ptr]->PerGame();
return g_Config.bGameSpecific && g_Config.getPtrLUT().count(ptr) > 0 && g_Config.getPtrLUT()[ptr]->PerGame();
}
bool ConfigSetting::Get(const Section *section) const {
bool ConfigSetting::ReadFromIniSection(const Section *section) const {
switch (type_) {
case TYPE_BOOL:
return section->Get(iniKey_, ptr_.b, cb_.b ? cb_.b() : default_.b);
@@ -86,7 +81,7 @@ bool ConfigSetting::Get(const Section *section) const {
}
}
void ConfigSetting::Set(Section *section) const {
void ConfigSetting::WriteToIniSection(Section *section) const {
if (!SaveSetting()) {
return;
}