From 4e761f69d68db8eb51ac0ba811506d1788782047 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 26 Jun 2016 14:54:28 +0200 Subject: [PATCH 01/11] Changed: Use toString instead of std::stringstream --HG-- branch : develop --- code/ryzom/client/src/init.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index ffc6aa308..7b1ca728f 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -46,9 +46,6 @@ // Ligo. #include "nel/ligo/ligo_config.h" -// Std. -#include -#include // Client #include "init.h" #include "input.h" @@ -578,14 +575,12 @@ void listStereoDisplayDevices(std::vector &devices) IStereoDisplay::listDevices(devices); for (std::vector::iterator it(devices.begin()), end(devices.end()); it != end; ++it) { - std::stringstream name; - name << IStereoDisplay::getLibraryName(it->Library) << " - " << it->Manufacturer << " - " << it->ProductName; - std::stringstream fullname; - fullname << std::string("[") << name.str() << "] [" << it->Serial << "]"; - nlinfo("VR [C]: Stereo Display: %s", name.str().c_str()); + std::string name = toString("%s - %s - %s", IStereoDisplay::getLibraryName(it->Library), it->Manufacturer.c_str(), it->ProductName.c_str()); + std::string fullname = toString("[%s] [%s]", name.c_str(), it->Serial.c_str()); + nlinfo("VR [C]: Stereo Display: %s", name.c_str()); if (cache) { - VRDeviceCache.push_back(std::pair(name.str(), it->Serial)); // VR_CONFIG + VRDeviceCache.push_back(std::pair(name, it->Serial)); // VR_CONFIG } } } @@ -623,9 +618,8 @@ void initStereoDisplayDevice() { for (std::vector::iterator it(devices.begin()), end(devices.end()); it != end; ++it) { - std::stringstream name; - name << IStereoDisplay::getLibraryName(it->Library) << " - " << it->Manufacturer << " - " << it->ProductName; - if (name.str() == ClientCfg.VRDisplayDevice) + std::string name = toString("%s - %s - %s", IStereoDisplay::getLibraryName(it->Library), it->Manufacturer.c_str(), it->ProductName.c_str()); + if (name == ClientCfg.VRDisplayDevice) deviceInfo = &(*it); if (ClientCfg.VRDisplayDeviceId == it->Serial) break; From 58f0ee5e9e81db21394cfcebbaeeed57573f488c Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 26 Jun 2016 15:17:32 +0200 Subject: [PATCH 02/11] Fixed: The height of a CViewText was wrong in some cases because "|" is not the tallest character of the current font (ryzom.ttf) --HG-- branch : develop --- code/nel/src/gui/view_text.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/code/nel/src/gui/view_text.cpp b/code/nel/src/gui/view_text.cpp index 022347525..8c2ca96d3 100644 --- a/code/nel/src/gui/view_text.cpp +++ b/code/nel/src/gui/view_text.cpp @@ -2718,9 +2718,18 @@ namespace NLGUI TextContext->setOblique (_Oblique); // Letter size - UTextContext::CStringInfo si = TextContext->getStringInfo(ucstring("|")); // for now we can't now that directly from UTextContext - _FontHeight = (uint) si.StringHeight; // + (_Shadow?(_ShadowOutline?2:1):0); - _FontLegHeight = (uint) si.StringLine; // + (_Shadow?(_ShadowOutline?2:1):0); + ucstring chars; + // instead of using the height of "|" that depends on font, + // we're using 2 characters: + // - "_" that should be the character with the lowest part + // - A with an accent for the highest part + chars.fromUtf8("_\xc3\x84"); + + // for now we can't know that directly from UTextContext + UTextContext::CStringInfo si = TextContext->getStringInfo(chars); + // add a padding of 1 pixel else the top will be truncated + _FontHeight = (uint) si.StringHeight+1; + _FontLegHeight = (uint) si.StringLine; // Space width si = TextContext->getStringInfo(ucstring(" ")); From c6f3c0fb7309ff848cc4420229573ae90e59909c Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 26 Jun 2016 18:49:27 +0200 Subject: [PATCH 03/11] Fixed: Wrong alignment of text on login screen --HG-- branch : develop --- .../data/gamedev/interfaces_v3/login_main.xml | 26 +++++++++---------- .../gamedev/interfaces_v3/login_widgets.xml | 12 ++++----- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/login_main.xml b/code/ryzom/client/data/gamedev/interfaces_v3/login_main.xml index f74967f41..d87dfb51b 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/login_main.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/login_main.xml @@ -41,13 +41,13 @@ - - - - + + @@ -297,7 +297,7 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t - + @@ -626,7 +626,7 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t - + @@ -647,8 +647,8 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t - @@ -656,7 +656,7 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t - - - diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/login_widgets.xml b/code/ryzom/client/data/gamedev/interfaces_v3/login_widgets.xml index 9821bd34a..fb48663de 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/login_widgets.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/login_widgets.xml @@ -63,7 +63,7 @@ -