From 58d8064ce2beb470ed36ea6bf4b0ac5bed8d0079 Mon Sep 17 00:00:00 2001 From: pixel Date: Thu, 2 Feb 2006 17:29:04 +0000 Subject: Having a better texture tainting solution, which will hopefully avoid texture mess when going fullscreen. --- lib/font.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/font.cc') diff --git a/lib/font.cc b/lib/font.cc index 8527d15..fab51e4 100644 --- a/lib/font.cc +++ b/lib/font.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: font.cc,v 1.17 2005-12-01 13:48:12 pixel Exp $ */ +/* $Id: font.cc,v 1.18 2006-02-02 17:29:05 pixel Exp $ */ #include #include @@ -150,6 +150,7 @@ mogltk::font::font(Handle * ffont) : textcolor(255, 255, 255, 255), shadow(0), w for (i = 0; i < nbT; i++) { fonttex[i] = alloctexture(); + fonttex[i]->name = "Main font texture number " + String(i); for (j = 0; j < 15; j++) { fontcache[j][i] = 0; } @@ -605,6 +606,7 @@ mogltk::texture * mogltk::font::printtex(rect * _r, const ugly_string & m, va_li ph = nextpower(r.h); t = new texture(pw, ph); + t->name = String("Text-on-texture: '") + m.p + "'"; for (p = buffer; *p; p++) { if (*p == '\n') { @@ -672,7 +674,7 @@ mogltk::font * mogltk::SystemFont; mogltk::font * mogltk::FixedFont; mogltk::texture * mogltk::font::alloctexture() { - return new mogltk::texture(256, 256); + return new texture(256, 256); } void mogltk::font::Bind(int f) { @@ -691,6 +693,7 @@ void mogltk::font::checknbind(int index, ColorP c) { if (!fontcache[i][index]) { fontcache[i][index] = alloctexture(); + fontcache[i][index]->name = "Color font texture number " + String(index); for (y = 0; y < 256; y++) { for (x = 0; x < 256; x++) { t.fromSDL(fontcache[15][index]->GetPixels()[(y << 8) + x], f); -- cgit v1.2.3