Update of /cvsroot/super-tux/supertux/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30477/src
Modified Files:
text.cpp
Log Message:
Support for Benjamin's fonts.
Index: text.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/text.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- text.cpp 29 Apr 2004 00:15:11 -0000 1.19
+++ text.cpp 7 May 2004 00:20:29 -0000 1.20
@@ -101,14 +101,18 @@
{
for( i = 0, j = 0; i < len; ++i,++j)
{
- if( text[i] >= 'A' && text[i] <= 'Z')
- pchars->draw_part((int)(text[i] - 'A')*w, 0, x+(j*w), y, w, h, 255, update);
- else if( text[i] >= 'a' && text[i] <= 'z')
- pchars->draw_part((int)(text[i] - 'a')*w, h, x+(j*w), y, w, h, 255, update);
- else if ( text[i] >= '!' && text[i] <= '9')
- pchars->draw_part((int)(text[i] - '!')*w, h*2, x+(j*w), y, w, h, 255, update);
- else if ( text[i] == '?')
- pchars->draw_part(25*w, h*2, x+(j*w), y, w, h, 255, update);
+ if( text[i] >= ' ' && text[i] <= '/')
+ pchars->draw_part((int)(text[i] - ' ')*w, 0 , x+(j*w), y, w, h, 255, update);
+ else if( text[i] >= '0' && text[i] <= '?')
+ pchars->draw_part((int)(text[i] - '0')*w, h*1, x+(j*w), y, w, h, 255, update);
+ else if ( text[i] >= '@' && text[i] <= 'O')
+ pchars->draw_part((int)(text[i] - '@')*w, h*2, x+(j*w), y, w, h, 255, update);
+ else if ( text[i] >= 'P' && text[i] <= '_')
+ pchars->draw_part((int)(text[i] - 'P')*w, h*3, x+(j*w), y, w, h, 255, update);
+ else if ( text[i] >= '`' && text[i] <= 'o')
+ pchars->draw_part((int)(text[i] - '`')*w, h*4, x+(j*w), y, w, h, 255, update);
+ else if ( text[i] >= 'p' && text[i] <= '~')
+ pchars->draw_part((int)(text[i] - 'p')*w, h*5, x+(j*w), y, w, h, 255, update);
else if ( text[i] == '\n')
{
y += h + 2;
|