Added linebreak support for JTTFont in JGE.

This commit is contained in:
linshier
2010-11-20 15:40:53 +00:00
parent deea874591
commit bf3d01ae74
+7
View File
@@ -552,9 +552,16 @@ int JTTFont::RenderString(const u8 *text, float x, float y, bool render)
u8 ch; u8 ch;
int index; int index;
float xo = x;
while ((ch=*text)!=0) while ((ch=*text)!=0)
{ {
if (ch == 0x0a) {
text++;
x = xo;
y += mSize;
continue;
}
if (ch < 0x80) if (ch < 0x80)
{ {
index = PreCacheChar(ch, ch); index = PreCacheChar(ch, ch);