- 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

@ -560,11 +560,11 @@ void C_AddNotifyString (int printlevel, const char *source)
if (addtype == APPENDLINE && NotifyStrings[NUMNOTIFIES-1].PrintLevel == printlevel)
{
FString str = NotifyStrings[NUMNOTIFIES-1].Text + source;
lines = V_BreakLines (screen->Font, width, str);
lines = V_BreakLines (SmallFont, width, str);
}
else
{
lines = V_BreakLines (screen->Font, width, source);
lines = V_BreakLines (SmallFont, width, source);
addtype = (addtype == APPENDLINE) ? NEWLINE : addtype;
}
@ -852,7 +852,7 @@ int PrintString (int printlevel, const char *outline)
I_PrintStr (outline);
AddToConsole (printlevel, outline);
if (vidactive && screen && screen->Font)
if (vidactive && screen && SmallFont)
{
C_AddNotifyString (printlevel, outline);
maybedrawnow (false, false);
@ -1036,10 +1036,10 @@ static void C_DrawNotifyText ()
if (con_scaletext == 1)
{
if (!center)
screen->DrawText (color, 0, line, NotifyStrings[i].Text,
screen->DrawText (SmallFont, color, 0, line, NotifyStrings[i].Text,
DTA_CleanNoMove, true, DTA_Alpha, alpha, TAG_DONE);
else
screen->DrawText (color, (SCREENWIDTH -
screen->DrawText (SmallFont, color, (SCREENWIDTH -
SmallFont->StringWidth (NotifyStrings[i].Text)*CleanXfac)/2,
line, NotifyStrings[i].Text, DTA_CleanNoMove, true,
DTA_Alpha, alpha, TAG_DONE);
@ -1047,10 +1047,10 @@ static void C_DrawNotifyText ()
else if (con_scaletext == 0)
{
if (!center)
screen->DrawText (color, 0, line, NotifyStrings[i].Text,
screen->DrawText (SmallFont, color, 0, line, NotifyStrings[i].Text,
DTA_Alpha, alpha, TAG_DONE);
else
screen->DrawText (color, (SCREENWIDTH -
screen->DrawText (SmallFont, color, (SCREENWIDTH -
SmallFont->StringWidth (NotifyStrings[i].Text))/2,
line, NotifyStrings[i].Text,
DTA_Alpha, alpha, TAG_DONE);
@ -1058,13 +1058,13 @@ static void C_DrawNotifyText ()
else
{
if (!center)
screen->DrawText (color, 0, line, NotifyStrings[i].Text,
screen->DrawText (SmallFont, color, 0, line, NotifyStrings[i].Text,
DTA_VirtualWidth, screen->GetWidth() / 2,
DTA_VirtualHeight, screen->GetHeight() / 2,
DTA_KeepRatio, true,
DTA_Alpha, alpha, TAG_DONE);
else
screen->DrawText (color, (screen->GetWidth() / 2 -
screen->DrawText (SmallFont, color, (screen->GetWidth() / 2 -
SmallFont->StringWidth (NotifyStrings[i].Text))/2,
line, NotifyStrings[i].Text,
DTA_VirtualWidth, screen->GetWidth() / 2,
@ -1161,8 +1161,7 @@ void C_DrawConsole (bool hw2d)
if (ConBottom >= 12)
{
screen->SetFont (ConFont);
screen->DrawText (CR_ORANGE, SCREENWIDTH - 8 -
screen->DrawText (ConFont, CR_ORANGE, SCREENWIDTH - 8 -
ConFont->StringWidth ("v" DOTVERSIONSTR),
ConBottom - ConFont->GetHeight() - 4,
"v" DOTVERSIONSTR, TAG_DONE);
@ -1194,11 +1193,11 @@ void C_DrawConsole (bool hw2d)
{
tickstr[tickend+3] = 0;
}
screen->DrawText (CR_BROWN, LEFTMARGIN, tickerY, tickstr, TAG_DONE);
screen->DrawText (ConFont, CR_BROWN, LEFTMARGIN, tickerY, tickstr, TAG_DONE);
// Draw the marker
i = LEFTMARGIN+5+tickbegin*8 + Scale (TickerAt, (SDWORD)(tickend - tickbegin)*8, TickerMax);
screen->DrawChar (CR_ORANGE, (int)i, tickerY, 0x13, TAG_DONE);
screen->DrawChar (ConFont, CR_ORANGE, (int)i, tickerY, 0x13, TAG_DONE);
TickerVisible = true;
}
@ -1228,7 +1227,6 @@ void C_DrawConsole (bool hw2d)
if (menuactive != MENU_Off)
{
screen->SetFont (SmallFont);
return;
}
@ -1238,8 +1236,6 @@ void C_DrawConsole (bool hw2d)
int pos = (InsertLine - 1) & LINEMASK;
int i;
screen->SetFont (ConFont);
ConsoleDrawing = true;
for (i = RowAdjust; i; i--)
@ -1260,7 +1256,7 @@ void C_DrawConsole (bool hw2d)
pos = (pos - 1) & LINEMASK;
if (Lines[pos] != NULL)
{
screen->DrawText (CR_TAN, LEFTMARGIN, offset + lines * ConFont->GetHeight(),
screen->DrawText (ConFont, CR_TAN, LEFTMARGIN, offset + lines * ConFont->GetHeight(),
Lines[pos], TAG_DONE);
}
lines--;
@ -1279,13 +1275,13 @@ void C_DrawConsole (bool hw2d)
FString command((char *)&CmdLine[2+CmdLine[259]]);
int cursorpos = CmdLine[1] - CmdLine[259];
screen->DrawChar (CR_ORANGE, left, bottomline, '\x1c', TAG_DONE);
screen->DrawText (CR_ORANGE, left + ConFont->GetCharWidth(0x1c), bottomline,
screen->DrawChar (ConFont, CR_ORANGE, left, bottomline, '\x1c', TAG_DONE);
screen->DrawText (ConFont, CR_ORANGE, left + ConFont->GetCharWidth(0x1c), bottomline,
command, TAG_DONE);
if (cursoron)
{
screen->DrawChar (CR_YELLOW, left + ConFont->GetCharWidth(0x1c) + cursorpos * ConFont->GetCharWidth(0xb),
screen->DrawChar (ConFont, CR_YELLOW, left + ConFont->GetCharWidth(0x1c) + cursorpos * ConFont->GetCharWidth(0xb),
bottomline, '\xb', TAG_DONE);
}
}
@ -1293,11 +1289,10 @@ void C_DrawConsole (bool hw2d)
{
// Indicate that the view has been scrolled up (10)
// and if we can scroll no further (12)
screen->DrawChar (CR_GREEN, 0, bottomline, pos == TopLine ? 12 : 10, TAG_DONE);
screen->DrawChar (ConFont, CR_GREEN, 0, bottomline, pos == TopLine ? 12 : 10, TAG_DONE);
}
}
}
screen->SetFont (SmallFont);
}
void C_FullConsole ()
@ -1826,12 +1821,12 @@ static const char bar3[] = TEXTCOLOR_RED "\n\35\36\36\36\36\36\36\36\36\36\36\36
"\36\36\36\36\36\36\36\36\36\36\36\36\37" TEXTCOLOR_NORMAL "\n";
static const char logbar[] = "\n<------------------------------->\n";
void C_MidPrint (const char *msg)
void C_MidPrint (FFont *font, const char *msg)
{
if (StatusBar == NULL)
return;
if (msg)
if (msg != NULL)
{
AddToConsole (-1, bar1);
AddToConsole (-1, msg);
@ -1844,7 +1839,7 @@ void C_MidPrint (const char *msg)
fflush (Logfile);
}
StatusBar->AttachMessage (new DHUDMessage (msg, 1.5f, 0.375f, 0, 0,
StatusBar->AttachMessage (new DHUDMessage (font, msg, 1.5f, 0.375f, 0, 0,
(EColorRange)PrintColors[PRINTLEVELS], con_midtime), MAKE_ID('C','N','T','R'));
}
else
@ -1853,7 +1848,7 @@ void C_MidPrint (const char *msg)
}
}
void C_MidPrintBold (const char *msg)
void C_MidPrintBold (FFont *font, const char *msg)
{
if (msg)
{
@ -1868,7 +1863,7 @@ void C_MidPrintBold (const char *msg)
fflush (Logfile);
}
StatusBar->AttachMessage (new DHUDMessage (msg, 1.5f, 0.375f, 0, 0,
StatusBar->AttachMessage (new DHUDMessage (font, msg, 1.5f, 0.375f, 0, 0,
(EColorRange)PrintColors[PRINTLEVELS+1], con_midtime), MAKE_ID('C','N','T','R'));
}
else