From 2f265295ccf4a1e26f757829c9885b450d4e4d0b Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 5 Nov 2015 17:18:14 +0100 Subject: [PATCH] Fixed: Update also Depth and Frequency with default resolution --- code/ryzom/client/src/init.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index 4f8314bbb..3a51b82a0 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -948,14 +948,28 @@ void prelogInit() return; } + // used to determine screen default resolution if (ClientCfg.Width < 800 || ClientCfg.Height < 600) { UDriver::CMode mode; + CConfigFile::CVar *varPtr = NULL; + if (!ClientCfg.Windowed && Driver->getCurrentScreenMode(mode)) { ClientCfg.Width = mode.Width; ClientCfg.Height = mode.Height; + ClientCfg.Depth = mode.Depth; + ClientCfg.Frequency = mode.Frequency; + + // update client.cfg with detected depth and frequency + varPtr = ClientCfg.ConfigFile.getVarPtr("Depth"); + if(varPtr) + varPtr->forceAsInt(ClientCfg.Depth); + + varPtr = ClientCfg.ConfigFile.getVarPtr("Frequency"); + if(varPtr) + varPtr->forceAsInt(ClientCfg.Frequency); } else { @@ -964,7 +978,7 @@ void prelogInit() } // update client.cfg with detected resolution - CConfigFile::CVar *varPtr = ClientCfg.ConfigFile.getVarPtr("Width"); + varPtr = ClientCfg.ConfigFile.getVarPtr("Width"); if(varPtr) varPtr->forceAsInt(ClientCfg.Width);