OpenXR - Refactor compatvr.ini file (#16270)

* OpenXR - Compat GTA games

* OpenXR - Compat 0-9 games

* OpenXR - Compat A games

* OpenXR - Compat B games part 1

* OpenXR - Compat B games part 2

* OpenXR - Compat C games part 1

* OpenXR - Compat C games part 2

* OpenXR - Compat D games

* OpenXR - Compat E games

* OpenXR - Compat F games

* OpenXR - Compat G games

* OpenXR - Compat H games

* OpenXR - Compat I games

* OpenXR - Compat J games

* OpenXR - Compat K games

* OpenXR - Compat L games

* OpenXR - Compat M games

* OpenXR - Compat N games

* OpenXR - Compat P games

* OpenXR - Compat R games

* OpenXR - Compat S games

* OpenXR - Compat T games

* OpenXR - Compat U games

* OpenXR - Compat V games

* OpenXR - Compat W games

* OpenXR - Compat games sorting out part 1

* OpenXR - Compat games sorting out part 2

* OpenXR - Compat games sorting out part 3

* OpenXR - Compat games sorting out part 4

* OpenXR - Compat games sorting out part 5

* OpenXR - Compat games sorting out part 6

* OpenXR - Compat list description

* OpenXR - Support getting compatvr.ini from filesystem
This commit is contained in:
Luboš Vonásek authored and GitHub committed 2022-10-22 16:16:23 +02:00
1 parent 6a6ccb4c68
commit f4d5c59b2e
3 files changed
+1194 -550

No files matched your search

+17 -4
View File
@@ -42,21 +42,29 @@ void Compatibility::Load(const std::string &gameID) {
}
}
{
IniFile compat2;
// This one is user-editable. Need to load it after the system one.
Path path = GetSysDirectory(DIRECTORY_SYSTEM) / "compat.ini";
if (compat2.Load(path.ToString())) {
CheckSettings(compat2, gameID);
}
}
{
IniFile compat;
// This loads from assets.
if (compat.LoadFromVFS("compatvr.ini")) {
CheckSetting(compat, gameID, "Skyplane", &vrCompat_.Skyplane);
CheckSetting(compat, gameID, "UnitsPerMeter", &vrCompat_.UnitsPerMeter);
CheckVRSettings(compat, gameID);
}
}
{
IniFile compat2;
// This one is user-editable. Need to load it after the system one.
Path path = GetSysDirectory(DIRECTORY_SYSTEM) / "compat.ini";
Path path = GetSysDirectory(DIRECTORY_SYSTEM) / "compatvr.ini";
if (compat2.Load(path.ToString())) {
CheckSettings(compat2, gameID);
CheckVRSettings(compat2, gameID);
}
}
}
@@ -111,6 +119,11 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) {
CheckSetting(iniFile, gameID, "NearestFilteringOnFramebufferCreate", &flags_.NearestFilteringOnFramebufferCreate);
}
void Compatibility::CheckVRSettings(IniFile &iniFile, const std::string &gameID) {
CheckSetting(iniFile, gameID, "Skyplane", &vrCompat_.Skyplane);
CheckSetting(iniFile, gameID, "UnitsPerMeter", &vrCompat_.UnitsPerMeter);
}
void Compatibility::CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, bool *flag) {
if (ignored_.find(option) == ignored_.end()) {
iniFile.Get(option, gameID.c_str(), flag, *flag);