dmuratshin 9 years ago
parent
commit
3dec7910c5

+ 1 - 1
oxygine/src/Stage.cpp

@@ -117,7 +117,7 @@ namespace oxygine
 
     RectF Stage::getDestRect() const
     {
-        OX_ASSERT(0);
+//        OX_ASSERT(0);
         Vector2 s = getSize() + getPosition();
         return RectF(-getPosition(), s);
     }

+ 2 - 0
oxygine/src/oxygine-include.h

@@ -31,6 +31,8 @@
 #define HAVE_NPOT_RT()  (true)
 #endif
 
+#define OX_HAS_GLOBAL_TF_SCALE 1
+
 //#define OXYGINE_NO_YEILD 1
 
 // Bypass SDL file functions and use plain fopen, fread etc.

+ 20 - 0
oxygine/src/res/ResFont.cpp

@@ -0,0 +1,20 @@
+#include "ResFont.h"
+namespace oxygine
+{
+
+    void ResFont::alignSize(float worldScale, int styleFontSize, float& resScale, int& resFontSize) const
+    {
+        resFontSize = styleFontSize;
+        resScale = worldScale;
+
+        /*
+        if (fontSize)
+            resScale = _font->getSize() / float(fontSize);
+        else
+        {
+            resFontSize = _font->getScale();
+            resScale = _font->getScale();
+        }*/
+    }
+
+}

+ 1 - 1
oxygine/src/res/ResFont.h

@@ -15,7 +15,7 @@ namespace oxygine
         virtual bool isSDF(int& size) const { size = 0; return false; }
         int getSize() const { return _size; }
 
-        virtual void alignSize(float scale, int fontSize, float& resScale, int& resFontSize) const = 0;
+        virtual void alignSize(float worldScale, int styleFontSize, float& resScale, int& resFontSize) const;
 
     protected:
         int _size;

+ 5 - 10
oxygine/src/res/ResFontBM.cpp

@@ -72,18 +72,13 @@ namespace oxygine
         return _sdf;
     }
 
-    void ResFontBM::alignSize(float scale, int fontSize, float& resScale, int& resFontSize) const
+    void ResFontBM::alignSize(float worldScale, int styleFontSize, float& resScale, int& resFontSize) const
     {
-        resFontSize = fontSize;
-        resScale = scale;
+        resFontSize = styleFontSize;
+        resScale = worldScale;
 
-
-
-        //_scale = _font->getScale();
-        //if (st.fontSize)
-        //    _scale = _font->getSize() / float(st.fontSize);
-        if (fontSize)
-            resScale = _font->getSize() / float(fontSize);
+        if (styleFontSize)
+            resScale = _font->getSize() / float(styleFontSize);
         else
         {
             resFontSize = _font->getScale();