- The co-op summary screen now has a totals row at the bottom (if it fits).

- Changed WI_drawPercent() when wi_percents is false so that the total
  display is optional, and it formats it like Heretic's intermission, with
  a slash and a fixed-width right column.
- Font is no longer a property of the screen object. Pass the font to
  DrawText and DrawChar directly instead.
- Doom's intermission characters are now collected together as a font
  so they can be colorized.


SVN r1294 (trunk)
This commit is contained in:
Randy Heit 2008-11-27 17:43:36 +00:00
commit 6e83d231fe
39 changed files with 471 additions and 556 deletions

View file

@ -48,18 +48,13 @@
#include "templates.h"
//
// SetFont
// DrawChar
//
// Set the canvas's font
// Write a single character using the given font
//
void DCanvas::SetFont (FFont *font)
void STACK_ARGS DCanvas::DrawChar (FFont *font, int normalcolor, int x, int y, BYTE character, ...)
{
Font = font;
}
void STACK_ARGS DCanvas::DrawChar (int normalcolor, int x, int y, BYTE character, ...)
{
if (Font == NULL)
if (font == NULL)
return;
if (normalcolor >= NumTextColors)
@ -68,9 +63,9 @@ void STACK_ARGS DCanvas::DrawChar (int normalcolor, int x, int y, BYTE character
FTexture *pic;
int dummy;
if (NULL != (pic = Font->GetChar (character, &dummy)))
if (NULL != (pic = font->GetChar (character, &dummy)))
{
const FRemapTable *range = Font->GetColorTranslation ((EColorRange)normalcolor);
const FRemapTable *range = font->GetColorTranslation ((EColorRange)normalcolor);
va_list taglist;
va_start (taglist, character);
DrawTexture (pic, x, y, DTA_Translation, range, TAG_MORE, &taglist);
@ -81,9 +76,9 @@ void STACK_ARGS DCanvas::DrawChar (int normalcolor, int x, int y, BYTE character
//
// DrawText
//
// Write a string using the current font
// Write a string using the given font
//
void STACK_ARGS DCanvas::DrawText (int normalcolor, int x, int y, const char *string, ...)
void STACK_ARGS DCanvas::DrawText (FFont *font, int normalcolor, int x, int y, const char *string, ...)
{
va_list tags;
DWORD tag;
@ -103,16 +98,16 @@ void STACK_ARGS DCanvas::DrawText (int normalcolor, int x, int y, const char *st
int kerning;
FTexture *pic;
if (Font == NULL || string == NULL)
if (font == NULL || string == NULL)
return;
if (normalcolor >= NumTextColors)
normalcolor = CR_UNTRANSLATED;
boldcolor = normalcolor ? normalcolor - 1 : NumTextColors - 1;
range = Font->GetColorTranslation ((EColorRange)normalcolor);
height = Font->GetHeight () + 1;
kerning = Font->GetDefaultKerning ();
range = font->GetColorTranslation ((EColorRange)normalcolor);
height = font->GetHeight () + 1;
kerning = font->GetDefaultKerning ();
ch = (const BYTE *)string;
cx = x;
@ -214,7 +209,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 = font->GetColorTranslation (newcolor);
}
continue;
}
@ -226,7 +221,7 @@ void STACK_ARGS DCanvas::DrawText (int normalcolor, int x, int y, const char *st
continue;
}
if (NULL != (pic = Font->GetChar (c, &w)))
if (NULL != (pic = font->GetChar (c, &w)))
{
va_list taglist;
va_start (taglist, string);