From 16c48d40c45c4561a0621a19e553dcc5474dde7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Sun, 12 Mar 2017 00:03:38 -0300 Subject: [PATCH] Fixed text shadow rendering. --HG-- branch : dev-font --- src/eepp/graphics/textcache.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/eepp/graphics/textcache.cpp b/src/eepp/graphics/textcache.cpp index 858741b17..a43ca062c 100644 --- a/src/eepp/graphics/textcache.cpp +++ b/src/eepp/graphics/textcache.cpp @@ -183,8 +183,6 @@ void TextCache::internalDraw( const Float& X, const Float& Y, const Vector2f & S ColorA Col = getColor(); - setText( getText() ); - if ( Col.a() != 255 ) { ColorA ShadowColor = getShadowColor(); @@ -197,7 +195,11 @@ void TextCache::internalDraw( const Float& X, const Float& Y, const Vector2f & S Float pd = PixelDensity::getPixelDensity(); - internalDraw( X + 1 * pd, Y + 1 * pd, Scale, Angle, Effect ); + GLi->translatef( 1 * pd , 1 * pd, 0.f ); + + internalDraw( X, Y, Scale, Angle, Effect ); + + GLi->translatef( -1 * pd , -1 * pd, 0.f ); mFlags = f; @@ -218,9 +220,6 @@ void TextCache::internalDraw( const Float& X, const Float& Y, const Vector2f & S GLi->translatef( -Center.x + X, -Center.y + Y, 0.f ); } - std::vector& RenderCoords = getVertextCoords(); - std::vector& Colors = getColors(); - if ( !cachedCoords() ) { cacheVerts( X, Y ); } @@ -230,9 +229,9 @@ void TextCache::internalDraw( const Float& X, const Float& Y, const Vector2f & S Uint32 alloc = numvert * sizeof(eeVertexCoords); Uint32 allocC = numvert * GLi->quadVertexs(); - GLi->colorPointer ( 4, GL_UNSIGNED_BYTE , 0 , reinterpret_cast( &Colors[0] ) , allocC ); - GLi->texCoordPointer( 2, GL_FP , sizeof(eeVertexCoords), reinterpret_cast( &RenderCoords[0] ) , alloc ); - GLi->vertexPointer ( 2, GL_FP , sizeof(eeVertexCoords), reinterpret_cast( &RenderCoords[0] ) + sizeof(Float) * 2 , alloc ); + GLi->colorPointer ( 4, GL_UNSIGNED_BYTE , 0 , reinterpret_cast( &mColors[0] ) , allocC ); + GLi->texCoordPointer( 2, GL_FP , sizeof(eeVertexCoords), reinterpret_cast( &mRenderCoords[0] ) , alloc ); + GLi->vertexPointer ( 2, GL_FP , sizeof(eeVertexCoords), reinterpret_cast( &mRenderCoords[0] ) + sizeof(Float) * 2 , alloc ); if ( GLi->quadsSupported() ) { GLi->drawArrays( GL_QUADS, 0, numvert );