Merge with develop

--HG--
branch : compatibility-develop
hg/compatibility-develop
Nimetu 6 years ago
commit 002005f294

@ -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

@ -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;

@ -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");

@ -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

@ -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);
}
};

Loading…
Cancel
Save