- Changed DTA_Translation parameter for DrawTexture to an integer to avoid

passing renderer specific data to the function. Also added DTA_Font so
  that the renderer can fetch font translations from the proper font.
  DIM_MAP/ConShade had to be made a regular translation table to make it
  work.
- Added Karate Chris's fix for scoreboard displaying team play related data
  in non teamplay games.
- Fixed: The team selection menu didn't work.
- Fixed: UpdateTeam passed an FString to Printf.


SVN r623 (trunk)
This commit is contained in:
Christoph Oelckers 2007-12-23 14:13:29 +00:00
commit eb2e40cde0
19 changed files with 155 additions and 102 deletions

View file

@ -70,10 +70,9 @@ 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);
DrawTexture (pic, x, y, DTA_Translation, range, TAG_MORE, &taglist);
DrawTexture (pic, x, y, DTA_Font, Font, DTA_Translation, normalcolor, TAG_MORE, &taglist);
va_end (taglist);
}
}
@ -96,11 +95,13 @@ void STACK_ARGS DCanvas::DrawText (int normalcolor, int x, int y, const char *st
int cx;
int cy;
int boldcolor;
const BYTE *range;
int range;
int height;
int forcedwidth = 0;
int scalex, scaley;
int kerning;
FFont *Font = this->Font;
FTexture *pic;
if (Font == NULL || string == NULL)
@ -110,7 +111,7 @@ void STACK_ARGS DCanvas::DrawText (int normalcolor, int x, int y, const char *st
normalcolor = CR_UNTRANSLATED;
boldcolor = normalcolor ? normalcolor - 1 : NumTextColors - 1;
range = Font->GetColorTranslation ((EColorRange)normalcolor);
range = normalcolor;
height = Font->GetHeight () + 1;
kerning = Font->GetDefaultKerning ();
@ -129,7 +130,6 @@ void STACK_ARGS DCanvas::DrawText (int normalcolor, int x, int y, const char *st
{
va_list *more_p;
DWORD data;
void *ptrval;
switch (tag)
{
@ -158,7 +158,12 @@ void STACK_ARGS DCanvas::DrawText (int normalcolor, int x, int y, const char *st
// Translation is specified explicitly by the text.
case DTA_Translation:
*(DWORD *)tags = TAG_IGNORE;
ptrval = va_arg (tags, void*);
data = va_arg (tags, int);
break;
case DTA_Font:
*(DWORD *)tags = TAG_IGNORE;
Font = va_arg (tags, FFont*);
break;
case DTA_CleanNoMove:
@ -214,7 +219,7 @@ void STACK_ARGS DCanvas::DrawText (int normalcolor, int x, int y, const char *st
EColorRange newcolor = V_ParseFontColor (ch, normalcolor, boldcolor);
if (newcolor != CR_UNDEFINED)
{
range = Font->GetColorTranslation (newcolor);
range = newcolor;
}
continue;
}
@ -234,6 +239,7 @@ void STACK_ARGS DCanvas::DrawText (int normalcolor, int x, int y, const char *st
{
w = forcedwidth;
DrawTexture (pic, cx, cy,
DTA_Font, Font,
DTA_Translation, range,
DTA_DestWidth, forcedwidth,
DTA_DestHeight, height,
@ -242,6 +248,7 @@ void STACK_ARGS DCanvas::DrawText (int normalcolor, int x, int y, const char *st
else
{
DrawTexture (pic, cx, cy,
DTA_Font, Font,
DTA_Translation, range,
TAG_MORE, &taglist);
}