# HG changeset patch # User ib # Date 1297340923 0 # Node ID 236a95445ebba74b2c4a245b7c09570aaa3bcac8 # Parent fb6f8ea9d38a6c46bcf07fbe34d1b65f22fdd56e Always access font characters in the same way and avoid needless type conversion. diff -r fb6f8ea9d38a -r 236a95445ebb gui/skin/font.c --- 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;