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.
This commit is contained in:
Dalai Felinto 2012-02-10 07:52:21 +00:00
parent 17dadffd66
commit 6a598148a7

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