From bf3d01ae74e46c612e08aeae4511d2c118106271 Mon Sep 17 00:00:00 2001 From: linshier Date: Sat, 20 Nov 2010 15:40:53 +0000 Subject: [PATCH] Added linebreak support for JTTFont in JGE. --- JGE/src/JTTFont.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/JGE/src/JTTFont.cpp b/JGE/src/JTTFont.cpp index c0ad42244..fdbdd4b58 100644 --- a/JGE/src/JTTFont.cpp +++ b/JGE/src/JTTFont.cpp @@ -552,9 +552,16 @@ int JTTFont::RenderString(const u8 *text, float x, float y, bool render) u8 ch; int index; + float xo = x; while ((ch=*text)!=0) { + if (ch == 0x0a) { + text++; + x = xo; + y += mSize; + continue; + } if (ch < 0x80) { index = PreCacheChar(ch, ch);