From eea1bbb0e272efc6b2f8e1601b82fc6ac46c34ed Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 27 May 2016 22:15:14 +0200 Subject: [PATCH 1/6] Fixed: VSync inverted under Windows and in OpenGL ES --HG-- branch : develop --- code/nel/src/3d/driver/opengl/driver_opengl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.cpp b/code/nel/src/3d/driver/opengl/driver_opengl.cpp index 8ad9228ef..a9a50226c 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl.cpp @@ -2293,11 +2293,11 @@ void CDriverGL::setSwapVBLInterval(uint interval) bool res = true; #ifdef USE_OPENGLES - res = eglSwapInterval(_EglDisplay, _Interval) == EGL_TRUE; + res = eglSwapInterval(_EglDisplay, interval) == EGL_TRUE; #elif defined(NL_OS_WINDOWS) if(_Extensions.WGLEXTSwapControl) { - res = nwglSwapIntervalEXT(_Interval) == TRUE; + res = nwglSwapIntervalEXT(interval) == TRUE; } #elif defined(NL_OS_MAC) [_ctx setValues:(GLint*)&interval forParameter:NSOpenGLCPSwapInterval]; From ae7fa4da2e654747bb17f3e50cd435f594d699b0 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 27 May 2016 22:15:58 +0200 Subject: [PATCH 2/6] Changed: Instead of forcing VSYNC, get initial value --HG-- branch : develop --- code/nel/src/3d/driver/opengl/driver_opengl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.cpp b/code/nel/src/3d/driver/opengl/driver_opengl.cpp index a9a50226c..36fc7180b 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl.cpp @@ -676,8 +676,8 @@ bool CDriverGL::setupDisplay() } #endif - // Reset the vbl interval - setSwapVBLInterval(_Interval); + // Get initial VBL interval + _Interval = getSwapVBLInterval(); return true; } From b29441f22e1f6d795f19b690ba83c1710e9f12f4 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 27 May 2016 22:16:29 +0200 Subject: [PATCH 3/6] Changed: Display a warning if setSwapVBLInterval is called before OpenGL initialization --HG-- branch : develop --- code/nel/src/3d/driver/opengl/driver_opengl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.cpp b/code/nel/src/3d/driver/opengl/driver_opengl.cpp index 36fc7180b..db0100167 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl.cpp @@ -2288,7 +2288,10 @@ void CDriverGL::setSwapVBLInterval(uint interval) H_AUTO_OGL(CDriverGL_setSwapVBLInterval); if (!_Initialized) + { + nlwarning("OpenGL driver not initialized when calling setSwapVBLInterval"); return; + } bool res = true; From cb8bb5f6f4888fb6914fb1461cbf811eee10d863 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 27 May 2016 22:16:44 +0200 Subject: [PATCH 4/6] Changed: No need to change VSync if same value --HG-- branch : develop --- code/nel/src/3d/driver/opengl/driver_opengl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.cpp b/code/nel/src/3d/driver/opengl/driver_opengl.cpp index db0100167..6ab0e3336 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl.cpp @@ -2295,6 +2295,9 @@ void CDriverGL::setSwapVBLInterval(uint interval) bool res = true; + // don't try to change VBL if interval didn't change + if (_Interval == interval) return; + #ifdef USE_OPENGLES res = eglSwapInterval(_EglDisplay, interval) == EGL_TRUE; #elif defined(NL_OS_WINDOWS) From aeb33f9967ef3df7518536de85f529651923105e Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 27 May 2016 22:17:25 +0200 Subject: [PATCH 5/6] Fixed: Set VSync value after 3D driver initialized --HG-- branch : develop --- code/ryzom/client/src/init.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index f7a5af7af..d96147da8 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -1119,12 +1119,6 @@ void prelogInit() if(ClientCfg.DisableTextureShdr) Driver->disableHardwareTextureShader(); - // Enable or disable VSync - if(ClientCfg.WaitVBL) - Driver->setSwapVBLInterval(1); - else - Driver->setSwapVBLInterval(0); - if (StereoDisplay) // VR_CONFIG // VR_DRIVER { // override mode TODO @@ -1150,6 +1144,12 @@ void prelogInit() return; } + // Enable or disable VSync + if (ClientCfg.WaitVBL) + Driver->setSwapVBLInterval(1); + else + Driver->setSwapVBLInterval(0); + // initialize system utils class CSystemUtils::init(); CSystemUtils::setWindow(Driver->getDisplay()); From 2270796556ec7e3ba07d0eb6345b0a67bbdba3a2 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 27 May 2016 22:20:41 +0200 Subject: [PATCH 6/6] Changed: Use product variables from installer.ini --HG-- branch : develop --- .../client/ryzom_installer/src/configfile.cpp | 50 ++++++++++++++++++- .../client/ryzom_installer/src/configfile.h | 18 ++++++- .../ryzom_installer/src/operationdialog.cpp | 17 +++---- 3 files changed, 74 insertions(+), 11 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp index b855e7905..4574e00b5 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp @@ -59,6 +59,15 @@ bool CConfigFile::load(const QString &filename) m_use64BitsClient = settings.value("use_64bits_client").toBool(); settings.endGroup(); + settings.beginGroup("product"); + m_productName = settings.value("name").toString(); + m_productPublisher = settings.value("publisher").toString(); + m_productAboutUrl = settings.value("url_about").toString(); + m_productUpdateUrl = settings.value("url_update").toString(); + m_productHelpUrl = settings.value("url_help").toString(); + m_productComments = settings.value("comments").toString(); + settings.endGroup(); + settings.beginGroup("servers"); int serversCount = settings.value("size").toInt(); m_defaultServerIndex = settings.value("default").toInt(); @@ -142,6 +151,15 @@ bool CConfigFile::save() const settings.setValue("use_64bits_client", m_use64BitsClient); settings.endGroup(); + settings.beginGroup("product"); + settings.setValue("name", m_productName); + settings.setValue("publisher", m_productPublisher); + settings.setValue("url_about", m_productAboutUrl); + settings.setValue("url_update", m_productUpdateUrl); + settings.setValue("url_help", m_productHelpUrl); + settings.setValue("comments", m_productComments); + settings.endGroup(); + settings.beginGroup("servers"); settings.setValue("size", m_servers.size()); settings.setValue("default", m_defaultServerIndex); @@ -345,7 +363,7 @@ void CConfigFile::setUse64BitsClient(bool on) m_use64BitsClient = on; } -QString CConfigFile::expandVariables(const QString &str) +QString CConfigFile::expandVariables(const QString &str) const { QString res = str; @@ -721,3 +739,33 @@ CConfigFile::InstallationStep CConfigFile::getNextStep() const return Done; } + +QString CConfigFile::getProductName() const +{ + return m_productName; +} + +QString CConfigFile::getProductPublisher() const +{ + return m_productPublisher; +} + +QString CConfigFile::getProductAboutUrl() const +{ + return expandVariables(m_productAboutUrl); +} + +QString CConfigFile::getProductUpdateUrl() const +{ + return expandVariables(m_productUpdateUrl); +} + +QString CConfigFile::getProductHelpUrl() const +{ + return expandVariables(m_productHelpUrl); +} + +QString CConfigFile::getProductComments() const +{ + return m_productComments; +} diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.h b/code/ryzom/tools/client/ryzom_installer/src/configfile.h index 72325667b..7a8f2307c 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.h +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.h @@ -164,7 +164,7 @@ public: bool use64BitsClient() const; void setUse64BitsClient(bool on); - QString expandVariables(const QString &str); + QString expandVariables(const QString &str) const; QString getClientArch() const; @@ -174,6 +174,14 @@ public: InstallationStep getNextStep() const; + // product details + QString getProductName() const; + QString getProductPublisher() const; + QString getProductAboutUrl() const; + QString getProductUpdateUrl() const; + QString getProductHelpUrl() const; + QString getProductComments() const; + private: int m_defaultServerIndex; int m_defaultProfileIndex; @@ -189,6 +197,14 @@ private: QString m_defaultConfigPath; QString m_configPath; + // product + QString m_productName; + QString m_productPublisher; + QString m_productAboutUrl; + QString m_productUpdateUrl; + QString m_productHelpUrl; + QString m_productComments; + static CConfigFile *s_instance; }; diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index d2c0a2593..736ed4cd0 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -486,7 +486,6 @@ bool COperationDialog::createDefaultProfile() CServer server = config->getServer(config->getDefaultServerIndex()); m_currentOperation = QApplication::tr("Create default profile"); -// m_currentOperationProgressFormat = QApplication::tr("Deleting %1..."); CProfile profile; @@ -539,9 +538,10 @@ bool COperationDialog::createAddRemoveEntry() QSettings settings("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Ryzom", QSettings::NativeFormat); QStringList versionTokens = QString(RYZOM_VERSION).split('.'); + QString nativeFullPath = QDir::toNativeSeparators(newInstallerFullPath); settings.setValue("Comments", ""); - settings.setValue("DisplayIcon", QDir::toNativeSeparators(newInstallerFullPath) + ",0"); + settings.setValue("DisplayIcon", nativeFullPath + ",0"); settings.setValue("DisplayName", "Ryzom"); settings.setValue("DisplayVersion", RYZOM_VERSION); settings.setValue("EstimatedSize", 1500000); // TODO: compute real size @@ -552,13 +552,12 @@ bool COperationDialog::createAddRemoveEntry() settings.setValue("NoModify", 0); settings.setValue("NoRemove", 0); settings.setValue("NoRepair", 0); - settings.setValue("Publisher", AUTHOR); - settings.setValue("QuietUninstallString", QDir::toNativeSeparators(newInstallerFullPath) + " -u -s"); - settings.setValue("UninstallString", QDir::toNativeSeparators(newInstallerFullPath) + " -u"); - settings.setValue("URLUpdateInfo", "http://ryzom.fr/info"); - settings.setValue("URLInfoAbout", "http://ryzom.fr/info2"); - // settings.setValue("sEstimatedSize2", 0); - settings.setValue("HelpLink", "http://ryzom.fr/support"); + if (!config->getProductPublisher().isEmpty()) settings.setValue("Publisher", config->getProductPublisher()); + settings.setValue("QuietUninstallString", nativeFullPath + " -u -s"); + settings.setValue("UninstallString", nativeFullPath + " -u"); + if (!config->getProductUpdateUrl().isEmpty()) settings.setValue("URLUpdateInfo", config->getProductUpdateUrl()); + if (!config->getProductAboutUrl().isEmpty()) settings.setValue("URLInfoAbout", config->getProductAboutUrl()); + if (!config->getProductHelpUrl().isEmpty()) settings.setValue("HelpLink", config->getProductHelpUrl()); // ModifyPath #endif }