about summary refs log tree commit diff
path: root/src/game/client/ui.cpp
diff options
context:
space:
mode:
authorDamian Kaczmarek <rush@rushbase.net>2010-12-14 01:20:47 +0100
committeroy <Tom_Adams@web.de>2011-01-05 12:14:36 +0100
commit073044747b5a3f172e5b03ab58b373cdd645c087 (patch)
tree6c8425d2346f61d5f9bab3a0ae79a1a0281c8d5a /src/game/client/ui.cpp
parentaad2438882943b23a72cee28c1b71d217883ebf9 (diff)
downloadzcatch-073044747b5a3f172e5b03ab58b373cdd645c087.tar.gz
zcatch-073044747b5a3f172e5b03ab58b373cdd645c087.zip
-Working ui_scale parameter.
(doing it properly would require lots of framework/interface job ...)
Diffstat (limited to 'src/game/client/ui.cpp')
-rw-r--r--src/game/client/ui.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/game/client/ui.cpp b/src/game/client/ui.cpp
index 3b323e56..020a0c70 100644
--- a/src/game/client/ui.cpp
+++ b/src/game/client/ui.cpp
@@ -69,13 +69,18 @@ CUIRect *CUI::Screen()
 
 void CUI::SetScale(float s)
 {
-    //config.UI()->Scale = (int)(s*100.0f);
+    g_Config.m_UiScale = (int)(s*100.0f);
 }
 
-/*float CUI::Scale()
+float CUI::Scale()
 {
-    return config.UI()->Scale/100.0f;
-}*/
+	return g_Config.m_UiScale/100.0f; 
+}
+
+float CUIRect::Scale() const
+{
+	return g_Config.m_UiScale/100.0f; 
+}
 
 void CUI::ClipEnable(const CUIRect *r)
 {
@@ -138,6 +143,7 @@ void CUIRect::VSplitMid(CUIRect *pLeft, CUIRect *pRight) const
 {
     CUIRect r = *this;
     float Cut = r.w/2;
+//    Cut *= Scale();
 
     if (pLeft)
     {
@@ -313,7 +319,6 @@ void CUI::DoLabel(const CUIRect *r, const char *pText, float Size, int Align, in
 {
 	// TODO: FIX ME!!!!
     //Graphics()->BlendNormal();
-    Size *= Scale();
     if(Align == 0)
     {
     	float tw = TextRender()->TextWidth(0, Size, pText, MaxWidth);
@@ -327,3 +332,8 @@ void CUI::DoLabel(const CUIRect *r, const char *pText, float Size, int Align, in
     	TextRender()->Text(0, r->x + r->w-tw, r->y - Size/10, Size, pText, MaxWidth);
 	}
 }
+
+void CUI::DoLabelScaled(const CUIRect *r, const char *pText, float Size, int Align, int MaxWidth)
+{
+  DoLabel(r, pText, Size*Scale(), Align, MaxWidth);
+}
\ No newline at end of file