mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-24 13:01:48 +00:00
- Fixed: DrawHudText() needs to verify that the character glyph is valid before accessing
its fields. SVN r2182 (trunk)
This commit is contained in:
parent
54b792a97f
commit
4e2ca33ea9
1 changed files with 11 additions and 8 deletions
|
@ -168,12 +168,15 @@ static void DrawHudText(FFont *font, int color, char * text, int x, int y, int t
|
||||||
{
|
{
|
||||||
int width;
|
int width;
|
||||||
FTexture *texc = font->GetChar(text[i], &width);
|
FTexture *texc = font->GetChar(text[i], &width);
|
||||||
|
if (texc != NULL)
|
||||||
|
{
|
||||||
int offset = texc->TopOffset - tex_zero->TopOffset + tex_zero->GetHeight();
|
int offset = texc->TopOffset - tex_zero->TopOffset + tex_zero->GetHeight();
|
||||||
screen->DrawChar(font, color, x, y, text[i],
|
screen->DrawChar(font, color, x, y, text[i],
|
||||||
DTA_KeepRatio, true,
|
DTA_KeepRatio, true,
|
||||||
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, trans,
|
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, trans,
|
||||||
DTA_LeftOffset, width/2, DTA_TopOffset, offset,
|
DTA_LeftOffset, width/2, DTA_TopOffset, offset,
|
||||||
/*DTA_CenterBottomOffset, 1,*/ TAG_DONE);
|
/*DTA_CenterBottomOffset, 1,*/ TAG_DONE);
|
||||||
|
}
|
||||||
x += zerowidth;
|
x += zerowidth;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -181,7 +184,7 @@ static void DrawHudText(FFont *font, int color, char * text, int x, int y, int t
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Draws a numberses a fixed widh for all characters
|
// Draws a number with a fixed width for all digits
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue