Fixed bug: drawing not existing character, dumps core.

This commit is contained in:
johns 2001-04-21 23:19:38 +00:00
parent b75517d9a7
commit 21e3bd06aa

View file

@ -455,8 +455,13 @@ global int DrawText(int x,int y,unsigned font,const unsigned char* text)
}
}
w=fp->CharWidth[*text-32];
VideoDrawChar(fp->Graphic,0,height*(*text-32),w,height,x+widths,y);
if( height*(*text-32)<fp->Graphic->Height ) {
w=fp->CharWidth[*text-32];
VideoDrawChar(fp->Graphic,0,height*(*text-32),w,height,x+widths,y);
} else {
w=fp->CharWidth[0];
VideoDrawChar(fp->Graphic,0,height*0,w,height,x+widths,y);
}
widths+=w+1;
if( rev ) {
TextColor=rev;