diff --git a/code/nel/src/3d/texture_font.cpp b/code/nel/src/3d/texture_font.cpp index 5977a8e5a..b40083516 100644 --- a/code/nel/src/3d/texture_font.cpp +++ b/code/nel/src/3d/texture_font.cpp @@ -446,7 +446,7 @@ CTextureFont::SGlyphInfo* CTextureFont::findLetterGlyph(SLetterInfo *letter, boo uint bitmapFontSize = max((sint)_MinGlyphSize, min((sint)_MaxGlyphSize, letter->Size)); if (_GlyphSizeStep > 1 && bitmapFontSize > _GlyphSizeStepMin) { - uint size = (bitmapFontSize / _GlyphSizeStep) * _GlyphSizeStep; + bitmapFontSize = (bitmapFontSize / _GlyphSizeStep) * _GlyphSizeStep; } // CacheVersion not checked, all glyphs in cache must be rendered on texture diff --git a/code/ryzom/client/client_default.cfg b/code/ryzom/client/client_default.cfg index 92c5e1d42..ee64b0b9d 100644 --- a/code/ryzom/client/client_default.cfg +++ b/code/ryzom/client/client_default.cfg @@ -313,6 +313,12 @@ CameraSpeedMin = 2.0; CameraSpeedMax = 100.0; CameraResetSpeed = 10.0; // Speed in radian/s +// Values for UI Scale +InterfaceScale = 1.0; +InterfaceScale_min = 0.8; +InterfaceScale_max = 2.0; +InterfaceScale_step = 0.05; + // Default values for map MaxMapScale = 2.0; R2EDMaxMapScale = 8.0; diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index c38292579..c77c9b656 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -301,6 +301,9 @@ CClientConfig::CClientConfig() Gamma = 0.f; // Default Monitor Gamma. InterfaceScale = 1.0f; // Resize UI + InterfaceScale_min = 0.8f; + InterfaceScale_max = 2.0f; + InterfaceScale_step = 0.05; BilinearUI = false; VREnable = false; @@ -839,7 +842,10 @@ void CClientConfig::setValues() READ_FLOAT_FV(Gamma) // UI scaling READ_FLOAT_FV(InterfaceScale); - clamp(ClientCfg.InterfaceScale, MIN_INTERFACE_SCALE, MAX_INTERFACE_SCALE); + READ_FLOAT_FV(InterfaceScale_min); + READ_FLOAT_FV(InterfaceScale_max); + READ_FLOAT_FV(InterfaceScale_step); + clamp(ClientCfg.InterfaceScale, ClientCfg.InterfaceScale_min, ClientCfg.InterfaceScale_max); READ_BOOL_FV(BilinearUI); // 3D Driver varPtr = ClientCfg.ConfigFile.getVarPtr ("Driver3D"); diff --git a/code/ryzom/client/src/client_cfg.h b/code/ryzom/client/src/client_cfg.h index c9ecebd2d..de930a63b 100644 --- a/code/ryzom/client/src/client_cfg.h +++ b/code/ryzom/client/src/client_cfg.h @@ -46,10 +46,6 @@ using NLMISC::CVector; using NLMISC::CRGBA; using std::string; -// limits for UI scale -const float MIN_INTERFACE_SCALE = 0.8; -const float MAX_INTERFACE_SCALE = 2.0; - //--------------------------------------------------- // CClientConfig : // Struct to manage a config file for the client. @@ -151,6 +147,9 @@ struct CClientConfig // UI scaling float InterfaceScale; + float InterfaceScale_min; + float InterfaceScale_max; + float InterfaceScale_step; bool BilinearUI; // VR 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 1b3548ba2..cae8234e4 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_game.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_game.cpp @@ -3744,7 +3744,7 @@ class CHandlerSetInterfaceScale : public IActionHandler float scale; if (fromString(s, scale)) { - if (scale >= MIN_INTERFACE_SCALE && scale <= MAX_INTERFACE_SCALE) + if (scale >= ClientCfg.InterfaceScale_min && scale <= ClientCfg.InterfaceScale_max) { ClientCfg.InterfaceScale = scale; ClientCfg.writeDouble("InterfaceScale", ClientCfg.InterfaceScale); @@ -3755,7 +3755,7 @@ class CHandlerSetInterfaceScale : public IActionHandler } } - ucstring help("/setuiscale "+toString("%.1f .. %.1f", MIN_INTERFACE_SCALE, MAX_INTERFACE_SCALE)); + ucstring help("/setuiscale "+toString("%.1f .. %.1f", ClientCfg.InterfaceScale_min, ClientCfg.InterfaceScale_max)); CInterfaceManager::getInstance()->displaySystemInfo(help); } };