mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +00:00
Changed TAG_MORE parameter to a struct containing a va_list to ensure that no matter how va_list is defined the address can be taken.
SVN r119 (trunk)
This commit is contained in:
parent
bb25008804
commit
4a8ca6d134
3 changed files with 17 additions and 12 deletions
|
@ -103,7 +103,7 @@ void STACK_ARGS DCanvas::DrawTexture (FTexture *img, int x0, int y0, DWORD tags_
|
|||
|
||||
while (tag != TAG_DONE)
|
||||
{
|
||||
va_list *more_p;
|
||||
TagMoreData *more_p;
|
||||
DWORD data;
|
||||
|
||||
switch (tag)
|
||||
|
@ -114,9 +114,9 @@ void STACK_ARGS DCanvas::DrawTexture (FTexture *img, int x0, int y0, DWORD tags_
|
|||
break;
|
||||
|
||||
case TAG_MORE:
|
||||
more_p = va_arg (tags, va_list*);
|
||||
more_p = va_arg (tags, TagMoreData*);
|
||||
va_end (tags);
|
||||
tags = *more_p;
|
||||
tags = more_p->tagdata;
|
||||
break;
|
||||
|
||||
case DTA_DestWidth:
|
||||
|
|
|
@ -71,10 +71,10 @@ void STACK_ARGS DCanvas::DrawChar (int normalcolor, int x, int y, byte character
|
|||
if (NULL != (pic = Font->GetChar (character, &dummy)))
|
||||
{
|
||||
const BYTE *range = Font->GetColorTranslation ((EColorRange)normalcolor);
|
||||
va_list taglist;
|
||||
va_start (taglist, character);
|
||||
TagMoreData taglist;
|
||||
va_start (taglist.tagdata, character);
|
||||
DrawTexture (pic, x, y, DTA_Translation, range, TAG_MORE, &taglist);
|
||||
va_end (taglist);
|
||||
va_end (taglist.tagdata);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,7 @@ void STACK_ARGS DCanvas::DrawText (int normalcolor, int x, int y, const char *st
|
|||
|
||||
while (tag != TAG_DONE)
|
||||
{
|
||||
va_list *more_p;
|
||||
TagMoreData * more_p;
|
||||
DWORD data;
|
||||
void *ptrval;
|
||||
|
||||
|
@ -137,9 +137,9 @@ void STACK_ARGS DCanvas::DrawText (int normalcolor, int x, int y, const char *st
|
|||
break;
|
||||
|
||||
case TAG_MORE:
|
||||
more_p = va_arg (tags, va_list*);
|
||||
more_p = va_arg (tags, TagMoreData*);
|
||||
va_end (tags);
|
||||
tags = *more_p;
|
||||
tags = more_p->tagdata;
|
||||
break;
|
||||
|
||||
case DTA_DestWidth:
|
||||
|
@ -226,10 +226,10 @@ void STACK_ARGS DCanvas::DrawText (int normalcolor, int x, int y, const char *st
|
|||
|
||||
if (NULL != (pic = Font->GetChar (c, &w)))
|
||||
{
|
||||
va_list taglist;
|
||||
va_start (taglist, string);
|
||||
TagMoreData taglist;
|
||||
va_start (taglist.tagdata, string);
|
||||
DrawTexture (pic, cx, cy, DTA_Translation, range, TAG_MORE, &taglist);
|
||||
va_end (taglist);
|
||||
va_end (taglist.tagdata);
|
||||
}
|
||||
cx += (w + kerning) * scalex;
|
||||
}
|
||||
|
|
|
@ -66,6 +66,11 @@ class FTexture;
|
|||
#define TAG_IGNORE (1L) /* Ignore this Tag */
|
||||
#define TAG_MORE (2L) /* Ends this list and continues with the */
|
||||
/* list pointed to in ti_Data */
|
||||
struct TagMoreData
|
||||
{
|
||||
va_list tagdata;
|
||||
};
|
||||
|
||||
//#define TAG_SKIP (3L) /* Skip this and the next ti_Data Tags */
|
||||
|
||||
#define TAG_USER ((DWORD)(1L<<31))
|
||||
|
|
Loading…
Reference in a new issue