From 6a598148a7f42d7ef6496ed1b8f63178eb7ebaba Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Fri, 10 Feb 2012 07:52:21 +0000 Subject: [PATCH] bge font objects: fix for difference in size when object has a parent for after 2.62 I would like to try if using doubles would help to increase the precision here. Also now that the mipmap patch is reverted we may want to look at this problem from a different perspective. RES could be calculated taking the object size in relation to the camera (i.e. size and distance, ignoring rotation). That may solve both problems of wrong resolution and lack of smoothness. For the time being users still need to use object.resolution to fine tune the rendered text. --- source/gameengine/Ketsji/KX_FontObject.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/gameengine/Ketsji/KX_FontObject.cpp b/source/gameengine/Ketsji/KX_FontObject.cpp index 8cce9471587..519ff97a2a2 100644 --- a/source/gameengine/Ketsji/KX_FontObject.cpp +++ b/source/gameengine/Ketsji/KX_FontObject.cpp @@ -173,10 +173,10 @@ void KX_FontObject::DrawText() this->GetObjectColor().getValue(m_color); /* HARDCODED MULTIPLICATION FACTOR - this will affect the render resolution directly */ - float RES = BGE_FONT_RES * m_resolution; + const float RES = BGE_FONT_RES * m_resolution; - float size = m_fsize * m_object->size[0] * RES; - float aspect = 1.f / (m_object->size[0] * RES); + const float size = m_fsize * this->NodeGetWorldScaling()[0] * RES; + const float aspect = m_fsize / size; /* Get a working copy of the OpenGLMatrix to use */ double mat[16];