mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 21:21:04 +00:00
- Fixed: DCanvas::DrawTextV needs to accept the entire tag list in one parameter. Otherwise, it
can't pass it to DrawTexture with a simple TAG_MORE. (Not sure why I thought the initial tag needed to be separate, though it did catch one case where it wasn't provided.) SVN r3351 (trunk)
This commit is contained in:
parent
68fbd75897
commit
e4728ba6f0
2 changed files with 13 additions and 12 deletions
|
@ -78,7 +78,7 @@ void STACK_ARGS DCanvas::DrawChar (FFont *font, int normalcolor, int x, int y, B
|
|||
//
|
||||
// Write a string using the given font
|
||||
//
|
||||
void DCanvas::DrawTextV(FFont *font, int normalcolor, int x, int y, const char *string, uint32 tag1, va_list taglist)
|
||||
void DCanvas::DrawTextV(FFont *font, int normalcolor, int x, int y, const char *string, va_list taglist)
|
||||
{
|
||||
INTBOOL boolval;
|
||||
va_list tags;
|
||||
|
@ -122,7 +122,7 @@ void DCanvas::DrawTextV(FFont *font, int normalcolor, int x, int y, const char *
|
|||
#else
|
||||
tags = taglist;
|
||||
#endif
|
||||
tag = tag1;
|
||||
tag = va_arg(tags, uint32);
|
||||
|
||||
while (tag != TAG_DONE)
|
||||
{
|
||||
|
@ -209,6 +209,7 @@ void DCanvas::DrawTextV(FFont *font, int normalcolor, int x, int y, const char *
|
|||
}
|
||||
tag = va_arg (tags, uint32);
|
||||
}
|
||||
va_end(tags);
|
||||
|
||||
height *= scaley;
|
||||
|
||||
|
@ -242,7 +243,6 @@ void DCanvas::DrawTextV(FFont *font, int normalcolor, int x, int y, const char *
|
|||
#else
|
||||
tags = taglist;
|
||||
#endif
|
||||
tag = tag1;
|
||||
if (forcedwidth)
|
||||
{
|
||||
w = forcedwidth;
|
||||
|
@ -262,21 +262,22 @@ void DCanvas::DrawTextV(FFont *font, int normalcolor, int x, int y, const char *
|
|||
}
|
||||
cx += (w + kerning) * scalex;
|
||||
}
|
||||
va_end(taglist);
|
||||
}
|
||||
|
||||
void STACK_ARGS DCanvas::DrawText (FFont *font, int normalcolor, int x, int y, const char *string, uint32 tag, ...)
|
||||
void STACK_ARGS DCanvas::DrawText (FFont *font, int normalcolor, int x, int y, const char *string, ...)
|
||||
{
|
||||
va_list tags;
|
||||
va_start(tags, tag);
|
||||
DrawTextV(font, normalcolor, x, y, string, tag, tags);
|
||||
va_start(tags, string);
|
||||
DrawTextV(font, normalcolor, x, y, string, tags);
|
||||
}
|
||||
|
||||
// A synonym so that this can still be used in files that #include Windows headers
|
||||
void STACK_ARGS DCanvas::DrawTextA (FFont *font, int normalcolor, int x, int y, const char *string, uint32 tag, ...)
|
||||
void STACK_ARGS DCanvas::DrawTextA (FFont *font, int normalcolor, int x, int y, const char *string, ...)
|
||||
{
|
||||
va_list tags;
|
||||
va_start(tags, tag);
|
||||
DrawTextV(font, normalcolor, x, y, string, tag, tags);
|
||||
va_start(tags, string);
|
||||
DrawTextV(font, normalcolor, x, y, string, tags);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -214,11 +214,11 @@ public:
|
|||
void VirtualToRealCoordsInt(int &x, int &y, int &w, int &h, int vwidth, int vheight, bool vbottom=false, bool handleaspect=true) const;
|
||||
|
||||
// 2D Text drawing
|
||||
void STACK_ARGS DrawText (FFont *font, int normalcolor, int x, int y, const char *string, uint32 tag, ...);
|
||||
void STACK_ARGS DrawText (FFont *font, int normalcolor, int x, int y, const char *string, ...);
|
||||
#ifndef DrawText // See WinUser.h for the definition of DrawText as a macro
|
||||
void STACK_ARGS DrawTextA (FFont *font, int normalcolor, int x, int y, const char *string, uint32 tag, ...);
|
||||
void STACK_ARGS DrawTextA (FFont *font, int normalcolor, int x, int y, const char *string, ...);
|
||||
#endif
|
||||
void DrawTextV (FFont *font, int normalcolor, int x, int y, const char *string, uint32 tag, va_list tags);
|
||||
void DrawTextV (FFont *font, int normalcolor, int x, int y, const char *string, va_list tags);
|
||||
void STACK_ARGS DrawChar (FFont *font, int normalcolor, int x, int y, BYTE character, ...);
|
||||
|
||||
struct DrawParms
|
||||
|
|
Loading…
Reference in a new issue