Merge with develop

This commit is contained in:
kervala 2016-05-27 22:24:20 +02:00
parent 6fbf8c5326
commit ac448eac18
5 changed files with 90 additions and 21 deletions

View file

@ -676,8 +676,8 @@ bool CDriverGL::setupDisplay()
} }
#endif #endif
// Reset the vbl interval // Get initial VBL interval
setSwapVBLInterval(_Interval); _Interval = getSwapVBLInterval();
return true; return true;
} }
@ -2288,16 +2288,22 @@ void CDriverGL::setSwapVBLInterval(uint interval)
H_AUTO_OGL(CDriverGL_setSwapVBLInterval); H_AUTO_OGL(CDriverGL_setSwapVBLInterval);
if (!_Initialized) if (!_Initialized)
{
nlwarning("OpenGL driver not initialized when calling setSwapVBLInterval");
return; return;
}
bool res = true; bool res = true;
// don't try to change VBL if interval didn't change
if (_Interval == interval) return;
#ifdef USE_OPENGLES #ifdef USE_OPENGLES
res = eglSwapInterval(_EglDisplay, _Interval) == EGL_TRUE; res = eglSwapInterval(_EglDisplay, interval) == EGL_TRUE;
#elif defined(NL_OS_WINDOWS) #elif defined(NL_OS_WINDOWS)
if(_Extensions.WGLEXTSwapControl) if(_Extensions.WGLEXTSwapControl)
{ {
res = nwglSwapIntervalEXT(_Interval) == TRUE; res = nwglSwapIntervalEXT(interval) == TRUE;
} }
#elif defined(NL_OS_MAC) #elif defined(NL_OS_MAC)
[_ctx setValues:(GLint*)&interval forParameter:NSOpenGLCPSwapInterval]; [_ctx setValues:(GLint*)&interval forParameter:NSOpenGLCPSwapInterval];

View file

@ -1119,12 +1119,6 @@ void prelogInit()
if(ClientCfg.DisableTextureShdr) if(ClientCfg.DisableTextureShdr)
Driver->disableHardwareTextureShader(); Driver->disableHardwareTextureShader();
// Enable or disable VSync
if(ClientCfg.WaitVBL)
Driver->setSwapVBLInterval(1);
else
Driver->setSwapVBLInterval(0);
if (StereoDisplay) // VR_CONFIG // VR_DRIVER if (StereoDisplay) // VR_CONFIG // VR_DRIVER
{ {
// override mode TODO // override mode TODO
@ -1150,6 +1144,12 @@ void prelogInit()
return; return;
} }
// Enable or disable VSync
if (ClientCfg.WaitVBL)
Driver->setSwapVBLInterval(1);
else
Driver->setSwapVBLInterval(0);
// initialize system utils class // initialize system utils class
CSystemUtils::init(); CSystemUtils::init();
CSystemUtils::setWindow(Driver->getDisplay()); CSystemUtils::setWindow(Driver->getDisplay());

View file

@ -59,6 +59,15 @@ bool CConfigFile::load(const QString &filename)
m_use64BitsClient = settings.value("use_64bits_client").toBool(); m_use64BitsClient = settings.value("use_64bits_client").toBool();
settings.endGroup(); 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"); settings.beginGroup("servers");
int serversCount = settings.value("size").toInt(); int serversCount = settings.value("size").toInt();
m_defaultServerIndex = settings.value("default").toInt(); m_defaultServerIndex = settings.value("default").toInt();
@ -142,6 +151,15 @@ bool CConfigFile::save() const
settings.setValue("use_64bits_client", m_use64BitsClient); settings.setValue("use_64bits_client", m_use64BitsClient);
settings.endGroup(); 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.beginGroup("servers");
settings.setValue("size", m_servers.size()); settings.setValue("size", m_servers.size());
settings.setValue("default", m_defaultServerIndex); settings.setValue("default", m_defaultServerIndex);
@ -345,7 +363,7 @@ void CConfigFile::setUse64BitsClient(bool on)
m_use64BitsClient = on; m_use64BitsClient = on;
} }
QString CConfigFile::expandVariables(const QString &str) QString CConfigFile::expandVariables(const QString &str) const
{ {
QString res = str; QString res = str;
@ -721,3 +739,33 @@ CConfigFile::InstallationStep CConfigFile::getNextStep() const
return Done; 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;
}

View file

@ -164,7 +164,7 @@ public:
bool use64BitsClient() const; bool use64BitsClient() const;
void setUse64BitsClient(bool on); void setUse64BitsClient(bool on);
QString expandVariables(const QString &str); QString expandVariables(const QString &str) const;
QString getClientArch() const; QString getClientArch() const;
@ -174,6 +174,14 @@ public:
InstallationStep getNextStep() const; InstallationStep getNextStep() const;
// product details
QString getProductName() const;
QString getProductPublisher() const;
QString getProductAboutUrl() const;
QString getProductUpdateUrl() const;
QString getProductHelpUrl() const;
QString getProductComments() const;
private: private:
int m_defaultServerIndex; int m_defaultServerIndex;
int m_defaultProfileIndex; int m_defaultProfileIndex;
@ -189,6 +197,14 @@ private:
QString m_defaultConfigPath; QString m_defaultConfigPath;
QString m_configPath; 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; static CConfigFile *s_instance;
}; };

View file

@ -486,7 +486,6 @@ bool COperationDialog::createDefaultProfile()
CServer server = config->getServer(config->getDefaultServerIndex()); CServer server = config->getServer(config->getDefaultServerIndex());
m_currentOperation = QApplication::tr("Create default profile"); m_currentOperation = QApplication::tr("Create default profile");
// m_currentOperationProgressFormat = QApplication::tr("Deleting %1...");
CProfile profile; CProfile profile;
@ -539,9 +538,10 @@ bool COperationDialog::createAddRemoveEntry()
QSettings settings("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Ryzom", QSettings::NativeFormat); QSettings settings("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Ryzom", QSettings::NativeFormat);
QStringList versionTokens = QString(RYZOM_VERSION).split('.'); QStringList versionTokens = QString(RYZOM_VERSION).split('.');
QString nativeFullPath = QDir::toNativeSeparators(newInstallerFullPath);
settings.setValue("Comments", ""); settings.setValue("Comments", "");
settings.setValue("DisplayIcon", QDir::toNativeSeparators(newInstallerFullPath) + ",0"); settings.setValue("DisplayIcon", nativeFullPath + ",0");
settings.setValue("DisplayName", "Ryzom"); settings.setValue("DisplayName", "Ryzom");
settings.setValue("DisplayVersion", RYZOM_VERSION); settings.setValue("DisplayVersion", RYZOM_VERSION);
settings.setValue("EstimatedSize", 1500000); // TODO: compute real size settings.setValue("EstimatedSize", 1500000); // TODO: compute real size
@ -552,13 +552,12 @@ bool COperationDialog::createAddRemoveEntry()
settings.setValue("NoModify", 0); settings.setValue("NoModify", 0);
settings.setValue("NoRemove", 0); settings.setValue("NoRemove", 0);
settings.setValue("NoRepair", 0); settings.setValue("NoRepair", 0);
settings.setValue("Publisher", AUTHOR); if (!config->getProductPublisher().isEmpty()) settings.setValue("Publisher", config->getProductPublisher());
settings.setValue("QuietUninstallString", QDir::toNativeSeparators(newInstallerFullPath) + " -u -s"); settings.setValue("QuietUninstallString", nativeFullPath + " -u -s");
settings.setValue("UninstallString", QDir::toNativeSeparators(newInstallerFullPath) + " -u"); settings.setValue("UninstallString", nativeFullPath + " -u");
settings.setValue("URLUpdateInfo", "http://ryzom.fr/info"); if (!config->getProductUpdateUrl().isEmpty()) settings.setValue("URLUpdateInfo", config->getProductUpdateUrl());
settings.setValue("URLInfoAbout", "http://ryzom.fr/info2"); if (!config->getProductAboutUrl().isEmpty()) settings.setValue("URLInfoAbout", config->getProductAboutUrl());
// settings.setValue("sEstimatedSize2", 0); if (!config->getProductHelpUrl().isEmpty()) settings.setValue("HelpLink", config->getProductHelpUrl());
settings.setValue("HelpLink", "http://ryzom.fr/support");
// ModifyPath // ModifyPath
#endif #endif
} }