corrected font alingment when using combination of newline and tabs

This commit is contained in:
Mark Vejvoda
2011-11-28 15:59:38 +00:00
parent c16cdad134
commit 30972bcddb
2 changed files with 14 additions and 11 deletions

View File

@@ -141,7 +141,9 @@ string MenuStateAbout::loadAdditionalCredits(){
endPathWithSlash(data_path); endPathWithSlash(data_path);
} }
string result= ""; string result= "";
const string dir= data_path + "data/core/menu/credits.txt"; const string dir= getGameCustomCoreDataPath(data_path,"data/core/menu/credits.txt");
//printf("dir [%s]\n",dir.c_str());
if(fileExists(dir) == true) { if(fileExists(dir) == true) {
#if defined(WIN32) && !defined(__MINGW32__) #if defined(WIN32) && !defined(__MINGW32__)
FILE *fp = _wfopen(utf8_decode(dir).c_str(), L"r"); FILE *fp = _wfopen(utf8_decode(dir).c_str(), L"r");

View File

@@ -539,6 +539,7 @@ void TextRenderer3DGl::internalRender(const string &text, float x, float y, boo
//glTranslatef(translatePos.x + scaleWidthX, translatePos.y, translatePos.z); //glTranslatef(translatePos.x + scaleWidthX, translatePos.y, translatePos.z);
glTranslatef(translatePos.x, translatePos.y, translatePos.z); glTranslatef(translatePos.x, translatePos.y, translatePos.z);
Vec3f translatePosOriginal = translatePos;;
//assertGl(); //assertGl();
//glScalef(scaleX, scaleY, scaleZ); //glScalef(scaleX, scaleY, scaleZ);
@@ -611,7 +612,7 @@ void TextRenderer3DGl::internalRender(const string &text, float x, float y, boo
//printf("Trying to render newline [%s] i = %d yLineValue = %f font->getTextHandler()->LineHeight(parts[i].c_str()) = %f\n",renderText.c_str(),i,yLineValue,font->getTextHandler()->LineHeight(parts[i].c_str())); //printf("Trying to render newline [%s] i = %d yLineValue = %f font->getTextHandler()->LineHeight(parts[i].c_str()) = %f\n",renderText.c_str(),i,yLineValue,font->getTextHandler()->LineHeight(parts[i].c_str()));
translatePos= Vec3f(translatePos.x, translatePos.y - yLineValue, translatePos.z); translatePos= Vec3f(translatePosOriginal.x, translatePos.y - yLineValue, translatePos.z);
needsRecursiveRender = true; needsRecursiveRender = true;
} }
break; break;