From c9437871835f2472e40a9051704b4e20f48ed067 Mon Sep 17 00:00:00 2001 From: pixel Date: Thu, 13 Mar 2003 01:54:04 +0000 Subject: Font Bug --- lib/glfont.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/glfont.cc') diff --git a/lib/glfont.cc b/lib/glfont.cc index 0956b36..383601c 100644 --- a/lib/glfont.cc +++ b/lib/glfont.cc @@ -98,10 +98,8 @@ mogltk::font::font(Handle * ffont) : textcolor(255, 255, 255, 255) { nbT++; } -#ifdef DEBUG printm(M_INFO, "Creating font texture: %i entries, flags = 0x%02x, maxX = %i, maxY = %i\n", nbentries, flags, maxX, maxY); printm(M_INFO, "Which makes %i texture(s), with %i char by texture, %i on X, and %i on Y\n", nbT, nbcT, nbcU, nbcV); -#endif fonttex = (texture **) malloc(nbT * sizeof(texture *)); @@ -137,16 +135,16 @@ mogltk::font::font(Handle * ffont) : textcolor(255, 255, 255, 255) { } } } - if (((curU += maxX) + maxX) >= 256) { + if (((curU += maxX) + maxX) > 256) { curU = 0; - if (((curV += maxY) + maxY) >= 256) { + if (((curV += maxY) + maxY) > 256) { curV = 0; if ((curT + 1) != nbT) curtex = (Uint8 *) fonttex[++curT]->GetSurface()->pixels; } } } - + corresp = (Uint16 *) malloc(nbentries * 2 * sizeof(Uint16)); ffont->read(corresp, 2 * sizeof(Uint16) * nbentries); -- cgit v1.2.3