From e96f954a876dc1fe49c435cf2293a85f41b213d0 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 2 Dec 2015 18:55:31 +0100 Subject: [PATCH 1/6] Changed: Minor changes --- code/ryzom/client/src/init_main_loop.cpp | 6 ++--- .../src/interface_v3/action_handler_game.cpp | 6 +++-- code/ryzom/client/src/main_loop.h | 23 +------------------ 3 files changed, 8 insertions(+), 27 deletions(-) diff --git a/code/ryzom/client/src/init_main_loop.cpp b/code/ryzom/client/src/init_main_loop.cpp index 48b970d11..ccab8b337 100644 --- a/code/ryzom/client/src/init_main_loop.cpp +++ b/code/ryzom/client/src/init_main_loop.cpp @@ -1340,10 +1340,10 @@ void initMainLoop() // init CSessionBrowserImpl CSessionBrowserImpl::getInstance().init(CLuaManager::getInstance().getLuaState()); - // active/desactive welcome window + // enable/disable welcome window initWelcomeWindow(); - // active/desactive bloom config interface + // enable/disable bloom config interface initBloomConfigUI(); // popup to offer hardware cursor activation @@ -1364,7 +1364,7 @@ void destroyLoadingBitmap () // Destroy the Loading Background. Driver->deleteTextureFile(LoadingBitmap); LoadingBitmap = NULL; - LoadingBitmapFilename = ""; + LoadingBitmapFilename.clear(); LoadingMaterial.setTexture (0, NULL); } if (LoadingBitmapFull && Driver) diff --git a/code/ryzom/client/src/interface_v3/action_handler_game.cpp b/code/ryzom/client/src/interface_v3/action_handler_game.cpp index 8457185e7..da005e56c 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_game.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_game.cpp @@ -3034,7 +3034,7 @@ public: // **** Init Texture Size Modes // init the combo box, according to Texture Installed or not - pCB= dynamic_cast(CWidgetManager::getInstance()->getElementFromId( GAME_CONFIG_TEXTURE_MODE_COMBO )); + pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId( GAME_CONFIG_TEXTURE_MODE_COMBO )); if( pCB ) { pCB->resetTexts(); @@ -3050,6 +3050,7 @@ public: { pBut->setPushed(ClientCfg.VREnable); } + updateVRDevicesComboUI(ClientCfg.VREnable); // init the mode in DB @@ -3060,6 +3061,7 @@ public: texMode= HighTextureMode; else texMode= NormalTextureMode; + // -1 is important to indicate we set this value in edit mode NLGUI::CDBManager::getInstance()->getDbProp( GAME_CONFIG_TEXTURE_MODE_DB )->setValue32(-1); NLGUI::CDBManager::getInstance()->getDbProp( GAME_CONFIG_TEXTURE_MODE_DB )->setValue32(texMode); @@ -3485,7 +3487,7 @@ class CHandlerGameConfigApply : public IActionHandler // *** Apply the language code // only if not in "work" language mode (else strange requestReboot) - if(ClientCfg.LanguageCode!="wk") + if (ClientCfg.LanguageCode!="wk") { sint newOne = NLGUI::CDBManager::getInstance()->getDbProp( GAME_CONFIG_LANGUAGE )->getValue32(); //string newVal = (newOne==2)?"de":(newOne==1)?"fr":"en"; diff --git a/code/ryzom/client/src/main_loop.h b/code/ryzom/client/src/main_loop.h index 93e4db36d..79ebc69fa 100644 --- a/code/ryzom/client/src/main_loop.h +++ b/code/ryzom/client/src/main_loop.h @@ -59,30 +59,9 @@ void displayDebugUIUnderMouse(); void inGamePatchUncompleteWarning(); -// active/desactive bloom config interface +// enable/disable bloom config interface void initBloomConfigUI(); #endif // CL_MAIN_LOOP_H /* End of main_loop.h */ - - - - - - - - - - - - - - - - - - - - - From f720072e7bedfa36e62733e842ea02822afe9a14 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 2 Dec 2015 18:56:49 +0100 Subject: [PATCH 2/6] Fixed: Getters for Anisotropic Filtering --- code/nel/include/nel/3d/driver.h | 10 ++++++++++ code/nel/include/nel/3d/driver_user.h | 2 ++ code/nel/include/nel/3d/u_driver.h | 10 ++++++++++ code/nel/src/3d/driver.cpp | 2 +- .../src/3d/driver/direct3d/driver_direct3d.cpp | 18 ++++++++++++++++++ .../src/3d/driver/direct3d/driver_direct3d.h | 2 ++ code/nel/src/3d/driver/opengl/driver_opengl.h | 2 ++ .../3d/driver/opengl/driver_opengl_texture.cpp | 16 ++++++++++++++++ code/nel/src/3d/driver_user.cpp | 14 ++++++++++++++ 9 files changed, 75 insertions(+), 1 deletion(-) diff --git a/code/nel/include/nel/3d/driver.h b/code/nel/include/nel/3d/driver.h index 39cafc2de..8e2eb8409 100644 --- a/code/nel/include/nel/3d/driver.h +++ b/code/nel/include/nel/3d/driver.h @@ -415,6 +415,16 @@ public: */ virtual void setAnisotropicFilter(sint filter) = 0; + /** + * Get current anisotropic filter value + */ + virtual uint getAnisotropicFilter() const = 0; + + /** + * Get maximum anisotropic filter value + */ + virtual uint getAnisotropicFilterMaximum() const = 0; + /** if !=1, force mostly all the textures (but TextureFonts lightmaps, interfaces etc..) * to be divided by Divisor (2, 4, 8...) * Default is 1. diff --git a/code/nel/include/nel/3d/driver_user.h b/code/nel/include/nel/3d/driver_user.h index f1e1fad84..761a03114 100644 --- a/code/nel/include/nel/3d/driver_user.h +++ b/code/nel/include/nel/3d/driver_user.h @@ -474,6 +474,8 @@ public: virtual TPolygonMode getPolygonMode (); virtual void forceDXTCCompression(bool dxtcComp); virtual void setAnisotropicFilter(sint filter); + virtual uint getAnisotropicFilter() const; + virtual uint getAnisotropicFilterMaximum() const; virtual void forceTextureResize(uint divisor); virtual bool setMonitorColorProperties (const CMonitorColorProperties &properties); // @} diff --git a/code/nel/include/nel/3d/u_driver.h b/code/nel/include/nel/3d/u_driver.h index dc2b02e56..f880c9f47 100644 --- a/code/nel/include/nel/3d/u_driver.h +++ b/code/nel/include/nel/3d/u_driver.h @@ -646,6 +646,16 @@ public: */ virtual void setAnisotropicFilter(sint filter)=0; + /** + * Get current anisotropic filter value + */ + virtual uint getAnisotropicFilter() const = 0; + + /** + * Get maximum anisotropic filter value + */ + virtual uint getAnisotropicFilterMaximum() const = 0; + /** if !=1, force mostly all the textures (but TextureFonts lightmaps, interfaces etc..) * to be divided by Divisor (2, 4, 8...) * Default is 1. diff --git a/code/nel/src/3d/driver.cpp b/code/nel/src/3d/driver.cpp index 791172700..f6fa074f0 100644 --- a/code/nel/src/3d/driver.cpp +++ b/code/nel/src/3d/driver.cpp @@ -32,7 +32,7 @@ namespace NL3D { // *************************************************************************** -const uint32 IDriver::InterfaceVersion = 0x6e; // gpu program interface +const uint32 IDriver::InterfaceVersion = 0x6f; // getters for anisotropic filter // *************************************************************************** IDriver::IDriver() : _SyncTexDrvInfos( "IDriver::_SyncTexDrvInfos" ) diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp index 5ffaceda6..fb310bd7d 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp @@ -2103,6 +2103,24 @@ void CDriverD3D::setAnisotropicFilter(sint filter) // *************************************************************************** +uint CDriverD3D::getAnisotropicFilter() const +{ + H_AUTO_D3D(CDriverD3D_getAnisotropicFilter); + + return _AnisotropicFilter; +} + +// *************************************************************************** + +uint CDriverD3D::getAnisotropicFilterMaximum() const +{ + H_AUTO_D3D(CDriverD3D_getAnisotropicFilterMaximum); + + return _MaxAnisotropy; +} + +// *************************************************************************** + void CDriverD3D::forceTextureResize(uint divisor) { H_AUTO_D3D(CDriverD3D_forceTextureResize); diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.h b/code/nel/src/3d/driver/direct3d/driver_direct3d.h index 039b6f3ed..830694a42 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.h +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.h @@ -879,6 +879,8 @@ public: virtual void disableHardwareTextureShader(); virtual void forceDXTCCompression(bool dxtcComp); virtual void setAnisotropicFilter(sint filter); + virtual uint getAnisotropicFilter() const; + virtual uint getAnisotropicFilterMaximum() const; virtual void forceTextureResize(uint divisor); // Driver information diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.h b/code/nel/src/3d/driver/opengl/driver_opengl.h index 1a7ca6825..6affa6929 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.h +++ b/code/nel/src/3d/driver/opengl/driver_opengl.h @@ -381,6 +381,8 @@ public: virtual void forceDXTCCompression(bool dxtcComp); virtual void setAnisotropicFilter(sint filter); + virtual uint getAnisotropicFilter() const; + virtual uint getAnisotropicFilterMaximum() const; virtual void forceTextureResize(uint divisor); diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp index 7b49e20a0..a46f7ef12 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp @@ -2128,6 +2128,22 @@ void CDriverGL::setAnisotropicFilter(sint filtering) } } +// *************************************************************************** +uint CDriverGL::getAnisotropicFilter() const +{ + H_AUTO_OGL(CDriverGL_getAnisotropicFilter); + + return (uint)_AnisotropicFilter; +} + +// *************************************************************************** +uint CDriverGL::getAnisotropicFilterMaximum() const +{ + H_AUTO_OGL(CDriverGL_getAnisotropicFilterMaximum); + + return (uint)_Extensions.EXTTextureFilterAnisotropicMaximum; +} + // *************************************************************************** void CDriverGL::forceTextureResize(uint divisor) { diff --git a/code/nel/src/3d/driver_user.cpp b/code/nel/src/3d/driver_user.cpp index 017a2b6dc..457197d70 100644 --- a/code/nel/src/3d/driver_user.cpp +++ b/code/nel/src/3d/driver_user.cpp @@ -1481,6 +1481,20 @@ void CDriverUser::setAnisotropicFilter(sint filter) _Driver->setAnisotropicFilter(filter); } +uint CDriverUser::getAnisotropicFilter() const +{ + NL3D_HAUTO_UI_DRIVER; + + return _Driver->getAnisotropicFilter(); +} + +uint CDriverUser::getAnisotropicFilterMaximum() const +{ + NL3D_HAUTO_UI_DRIVER; + + return _Driver->getAnisotropicFilterMaximum(); +} + void CDriverUser::forceTextureResize(uint divisor) { NL3D_HAUTO_UI_DRIVER; From 7e7deb34e2abe991094a8b6b4e5a3f646647bf5e Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 2 Dec 2015 18:57:21 +0100 Subject: [PATCH 3/6] Fixed: Bug when CURLMOPT_MAX_HOST_CONNECTIONS is not supported --- code/nel/src/gui/group_html.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 7d451d561..24610f7eb 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -2087,14 +2087,14 @@ namespace NLGUI clearContext(); MultiCurl = curl_multi_init(); +#ifdef CURLMOPT_MAX_HOST_CONNECTIONS if (MultiCurl) { -#ifdef CURLMOPT_MAX_HOST_CONNECTIONS // added in libcurl 7.30.0 curl_multi_setopt(MultiCurl, CURLMOPT_MAX_HOST_CONNECTIONS, options.curlMaxConnections); -#endif curl_multi_setopt(MultiCurl, CURLMOPT_PIPELINING, 1); } +#endif RunningCurls = 0; _CurlWWW = NULL; From 5386d0ba9979b8dc42a9d2f9431426044e253a9a Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 2 Dec 2015 18:59:26 +0100 Subject: [PATCH 4/6] Changed: Increased size of some combo boxes --- .../data/gamedev/interfaces_v3/game_config.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/game_config.xml b/code/ryzom/client/data/gamedev/interfaces_v3/game_config.xml index c2b62cebd..614b85dbf 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/game_config.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/game_config.xml @@ -183,7 +183,7 @@ posref="BL BL" scale="true" y="4" - w="86" + w="110" h="2" texture="W_line_hor2.tga" /> @@ -916,7 +916,7 @@ Date: Wed, 2 Dec 2015 19:00:55 +0100 Subject: [PATCH 5/6] Changed: Support 64x64 icon size --- code/ryzom/client/src/init.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index 8270d6f21..6b75933e8 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -1115,6 +1115,7 @@ void prelogInit() iconSizes.push_back(256); iconSizes.push_back(128); iconSizes.push_back(96); + iconSizes.push_back(64); iconSizes.push_back(48); iconSizes.push_back(32); iconSizes.push_back(24); From e35db6756dc689e346ab00acc099d15c0cf37755 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 2 Dec 2015 19:25:24 +0100 Subject: [PATCH 6/6] Changed: Add Anisotropic Filtering in game config options --- .../gamedev/interfaces_v3/game_config.xml | 41 ++++++++- .../src/interface_v3/action_handler_game.cpp | 90 +++++++++++++++++++ 2 files changed, 130 insertions(+), 1 deletion(-) diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/game_config.xml b/code/ryzom/client/data/gamedev/interfaces_v3/game_config.xml index 614b85dbf..bd0952277 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/game_config.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/game_config.xml @@ -429,6 +429,9 @@ + @@ -1237,10 +1240,41 @@ posref="BL TL" x="0" y="-12" /> - + + + + + + + + VideoModes; #define GAME_CONFIG_TEXTURE_MODE_COMBO "ui:interface:game_config:content:general:texture_mode:combo" #define GAME_CONFIG_TEXTURE_MODE_DB "UI:TEMP:TEXTURE_MODE" +// Anisotropic Filtering controls +#define GAME_CONFIG_ANISOTROPIC_COMBO "ui:interface:game_config:content:fx:anisotropic_gr:anisotropic" +#define GAME_CONFIG_ANISOTROPIC_DB "UI:TEMP:ANISOTROPIC" + // The 3 possible modes editable (NB: do not allow client.cfg HDEntityTexture==1 and DivideTextureSizeBy2=2 enum TTextureMode {LowTextureMode= 0, NormalTextureMode= 1, HighTextureMode= 2}; @@ -3044,6 +3048,37 @@ public: pCB->addText(CI18N::get("uigcHighTextureMode")); } + // Anisotropic Filtering + pCB = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GAME_CONFIG_ANISOTROPIC_COMBO)); + + sint nAnisotropic = 0; + + if (pCB) + { + uint maxAnisotropic = Driver->getAnisotropicFilterMaximum(); + + pCB->resetTexts(); + pCB->addText(CI18N::get("uigcFxAnisotropicFilterNone")); + + uint anisotropic = 2; + uint i = 1; + + while (anisotropic <= maxAnisotropic) + { + pCB->addText(ucstring(NLMISC::toString("%ux", anisotropic))); + + if (ClientCfg.AnisotropicFilter == anisotropic) + nAnisotropic = i; + + anisotropic <<= 1; + ++i; + } + } + + // -1 is important to indicate we set this value in edit mode + NLGUI::CDBManager::getInstance()->getDbProp( GAME_CONFIG_ANISOTROPIC_DB )->setValue32(-1); + NLGUI::CDBManager::getInstance()->getDbProp( GAME_CONFIG_ANISOTROPIC_DB )->setValue32(nAnisotropic); + // VR_CONFIG pBut = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(GAME_CONFIG_VR_ENABLE_BUTTON)); if (pBut) @@ -3481,6 +3516,34 @@ class CHandlerGameConfigApply : public IActionHandler } } + // **** Apply Anisotropic Filtering + sint nAnisotropic = NLGUI::CDBManager::getInstance()->getDbProp( GAME_CONFIG_ANISOTROPIC_DB )->getValue32(); + + if (nAnisotropic >= 0) + { + uint anisotropic = 0; + + // compute the real anisotropic value + if (nAnisotropic > 0) + { + anisotropic = 1; + + for(size_t i = 0; i < nAnisotropic; ++i) + { + anisotropic <<= 1; + } + } + + + if (ClientCfg.AnisotropicFilter != anisotropic) + { + ClientCfg.AnisotropicFilter = anisotropic; + ClientCfg.writeInt("AnisotropicFilter", anisotropic); + requestReboot = true; + } + } + + // *** Apply the Screen AR // since already set in the config file, need only to bkup the current version CHandlerGameConfigInit::BkupScreenAspectRatio= ClientCfg.ScreenAspectRatio; @@ -3597,6 +3660,33 @@ class CHandlerGameConfigChangeScreenRatioMode : public IActionHandler REGISTER_ACTION_HANDLER (CHandlerGameConfigChangeScreenRatioMode, "game_config_change_screen_ratio_mode"); +// *************************************************************************** +class CHandlerGameConfigChangeAnisotropic : public IActionHandler +{ + virtual void execute (CCtrlBase * /* pCaller */, const string &/* Params */) + { + if (CInterfaceLink::isUpdatingAllLinks()) return; // don't want to trash the value in client.cfg at init, due to 'updateAllLinks' being called + + CInterfaceManager *pIM = CInterfaceManager::getInstance(); + + // get values of anisotropic filtering + sint oldAnisotropic = NLGUI::CDBManager::getInstance()->getDbProp(GAME_CONFIG_ANISOTROPIC_DB)->getOldValue32(); + sint anisotropic = NLGUI::CDBManager::getInstance()->getDbProp(GAME_CONFIG_ANISOTROPIC_DB)->getValue32(); + + // dirt the apply button of the DDX. + // don't do it at init! + if(oldAnisotropic != anisotropic && oldAnisotropic != -1 && anisotropic != -1) + { + CDDXManager *pDM = CDDXManager::getInstance(); + CInterfaceDDX *pDDX = pDM->get(GAME_CONFIG_DDX); + if(pDDX) + pDDX->validateApplyButton(); + } + } +}; +REGISTER_ACTION_HANDLER (CHandlerGameConfigChangeAnisotropic, "game_config_change_anisotropic"); + + // *************************************************************************** class CHandlerGameConfigChangeScreenRatioCustom : public IActionHandler {