Merge pull request #16488 from lvonasek/config_openxr_update

OpenXR - Fixes for release candidate
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2022-12-11 13:37:09 +01:00
commit af59bc161b
7 files changed
+72 -20

No files matched your search

+32 -10
View File
@@ -516,6 +516,10 @@ static bool DefaultEnableStateUndo() {
return true;
}
static float DefaultUISaturation() {
return IsVREnabled() ? 1.5f : 1.0f;
}
struct ConfigSectionSettings {
const char *section;
ConfigSetting *settings;
@@ -597,7 +601,7 @@ static ConfigSetting generalSettings[] = {
ConfigSetting("BackgroundAnimation", &g_Config.iBackgroundAnimation, 1, true, false),
ConfigSetting("UITint", &g_Config.fUITint, 0.0, true, false),
ConfigSetting("UISaturation", &g_Config.fUISaturation, 1.0, true, false),
ConfigSetting("UISaturation", &g_Config.fUISaturation, &DefaultUISaturation, true, false),
#if defined(USING_WIN_UI)
ConfigSetting("TopMost", &g_Config.bTopMost, false),
@@ -644,6 +648,9 @@ static int DefaultInternalResolution() {
#if defined(USING_WIN_UI) || defined(USING_QT_UI)
return 0;
#else
if (System_GetPropertyInt(SYSPROP_DEVICE_TYPE) == DEVICE_TYPE_VR) {
return 4;
}
int longestDisplaySide = std::max(System_GetPropertyInt(SYSPROP_DISPLAY_XRES), System_GetPropertyInt(SYSPROP_DISPLAY_YRES));
int scale = longestDisplaySide >= 1000 ? 2 : 1;
INFO_LOG(G3D, "Longest display side: %d pixels. Choosing scale %d", longestDisplaySide, scale);
@@ -887,7 +894,7 @@ static ConfigSetting graphicsSettings[] = {
ReportedConfigSetting("HighQualityDepth", &g_Config.bHighQualityDepth, true, true, true),
ReportedConfigSetting("FrameSkip", &g_Config.iFrameSkip, 0, true, true),
ReportedConfigSetting("FrameSkipType", &g_Config.iFrameSkipType, 0, true, true),
ReportedConfigSetting("AutoFrameSkip", &g_Config.bAutoFrameSkip, false, true, true),
ReportedConfigSetting("AutoFrameSkip", &g_Config.bAutoFrameSkip, IsVREnabled(), true, true),
ConfigSetting("StereoRendering", &g_Config.bStereoRendering, false, true, true),
ConfigSetting("StereoToMonoShader", &g_Config.sStereoToMonoShader, "RedBlue", true, true),
ConfigSetting("FrameRate", &g_Config.iFpsLimit1, 0, true, true),
@@ -1216,7 +1223,7 @@ static ConfigSetting vrSettings[] = {
ConfigSetting("VRCameraDistance", &g_Config.fCameraDistance, 0.0f),
ConfigSetting("VRCameraHeight", &g_Config.fCameraHeight, 0.0f),
ConfigSetting("VRCameraSide", &g_Config.fCameraSide, 0.0f),
ConfigSetting("VRCanvasDistance", &g_Config.fCanvasDistance, 6.0f),
ConfigSetting("VRCanvasDistance", &g_Config.fCanvasDistance, 12.0f),
ConfigSetting("VRFieldOfView", &g_Config.fFieldOfViewPercentage, 100.0f),
ConfigSetting("VRHeadUpDisplayScale", &g_Config.fHeadUpDisplayScale, 0.3f),
ConfigSetting("VRMotionLength", &g_Config.fMotionLength, 0.5f),
@@ -1326,9 +1333,11 @@ void Config::Reload() {
// really think of any other legit uses).
void Config::UpdateIniLocation(const char *iniFileName, const char *controllerIniFilename) {
const bool useIniFilename = iniFileName != nullptr && strlen(iniFileName) > 0;
iniFilename_ = FindConfigFile(useIniFilename ? iniFileName : "ppsspp.ini");
const char *ppssppIniFilename = IsVREnabled() ? "ppssppvr.ini" : "ppsspp.ini";
iniFilename_ = FindConfigFile(useIniFilename ? iniFileName : ppssppIniFilename);
const bool useControllerIniFilename = controllerIniFilename != nullptr && strlen(controllerIniFilename) > 0;
controllerIniFilename_ = FindConfigFile(useControllerIniFilename ? controllerIniFilename : "controls.ini");
const char *controlsIniFilename = IsVREnabled() ? "controlsvr.ini" : "controls.ini";
controllerIniFilename_ = FindConfigFile(useControllerIniFilename ? controllerIniFilename : controlsIniFilename);
}
void Config::Load(const char *iniFileName, const char *controllerIniFilename) {
@@ -1402,15 +1411,27 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) {
}
}
auto postShaderSetting = iniFile.GetOrCreateSection("PostShaderSetting")->ToMap();
// Default values for post process shaders
bool postShadersInitialized = iniFile.HasSection("PostShaderList");
Section *postShaderChain = iniFile.GetOrCreateSection("PostShaderList");
Section *postShaderSetting = iniFile.GetOrCreateSection("PostShaderSetting");
if (IsVREnabled() && !postShadersInitialized) {
postShaderChain->Set("PostShader1", "ColorCorrection");
postShaderSetting->Set("ColorCorrectionSettingValue1",1.0f);
postShaderSetting->Set("ColorCorrectionSettingValue2",1.5f);
postShaderSetting->Set("ColorCorrectionSettingValue3",1.1f);
postShaderSetting->Set("ColorCorrectionSettingValue4",1.0f);
}
// Load post process shader values
mPostShaderSetting.clear();
for (auto it : postShaderSetting) {
for (const auto& it : postShaderSetting->ToMap()) {
mPostShaderSetting[it.first] = std::stof(it.second);
}
auto postShaderChain = iniFile.GetOrCreateSection("PostShaderList")->ToMap();
// Load post process shader names
vPostShaderNames.clear();
for (auto it : postShaderChain) {
for (const auto& it : postShaderChain->ToMap()) {
if (it.second != "Off")
vPostShaderNames.push_back(it.second);
}
@@ -1821,7 +1842,8 @@ bool Config::deleteGameConfig(const std::string& pGameId) {
}
Path Config::getGameConfigFile(const std::string &pGameId) {
std::string iniFileName = pGameId + "_ppsspp.ini";
const char *ppssppIniFilename = IsVREnabled() ? "_ppssppvr.ini" : "_ppsspp.ini";
std::string iniFileName = pGameId + ppssppIniFilename;
Path iniFileNameFull = FindConfigFile(iniFileName);
return iniFileNameFull;