changeset 32789:236a95445ebb

Always access font characters in the same way and avoid needless type conversion.
author ib
date Thu, 10 Feb 2011 12:28:43 +0000
parents fb6f8ea9d38a
children 5c23e57bb0a4
files gui/skin/font.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/gui/skin/font.c	Thu Feb 10 11:55:03 2011 +0000
+++ b/gui/skin/font.c	Thu Feb 10 12:28:43 2011 +0000
@@ -94,7 +94,7 @@
     {
      int i;
      cutItem( command,command,'"',1 );
-     if ( !command[0] ) i=(int)'"';
+     if ( !command[0] ) i='"';
      else if ( command[0] & 0x80 )
       {
        for ( i = 0; i < EXTRA_CHRS; i++ )
@@ -108,7 +108,7 @@
        if ( i == EXTRA_CHRS ) continue;
        i += ASCII_CHRS;
       }
-     else i=(int)command[0];
+     else i=command[0];
      cutItem( param,tmp,',',0 ); Fonts[id]->Fnt[i].x=atoi( tmp );
      cutItem( param,tmp,',',1 ); Fonts[id]->Fnt[i].y=atoi( tmp );
      cutItem( param,tmp,',',2 ); Fonts[id]->Fnt[i].sx=atoi( tmp );
@@ -283,7 +283,7 @@
 
    if ( c != -1 ) fw=Fonts[id]->Fnt[c].sx;
 
-   if ( c == -1 || fw == -1 ) { c=32; fw=Fonts[id]->Fnt[c].sx; }
+   if ( c == -1 || fw == -1 ) { c=' '; fw=Fonts[id]->Fnt[c].sx; }
 
    fh=Fonts[id]->Fnt[c].sy;
    fyc=Fonts[id]->Fnt[c].y * fbw + Fonts[id]->Fnt[c].x;
@@ -311,7 +311,7 @@
 
      if ( c != -1) fw=Fonts[id]->Fnt[c].sx;
 
-     if ( c == -1 || fw == -1 ) { c=32; fw=Fonts[id]->Fnt[c].sx; }
+     if ( c == -1 || fw == -1 ) { c=' '; fw=Fonts[id]->Fnt[c].sx; }
 
      fh=Fonts[id]->Fnt[c].sy;
      fyc=Fonts[id]->Fnt[c].y * fbw + Fonts[id]->Fnt[c].x;