Skip to content

Commit ec7344f

Browse files
draw time right-aligned if no par time and total time right-aligned (#2116)
Fixes #2114
1 parent 5e04f87 commit ec7344f

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

src/wi_stuff.c

+17-14
Original file line numberDiff line numberDiff line change
@@ -2186,29 +2186,32 @@ static void WI_drawStats(void)
21862186
V_DrawPatch(SP_STATSX, SP_STATSY+2*lh, sp_secret);
21872187
WI_drawPercent(SCREENWIDTH - SP_STATSX, SP_STATSY+2*lh, cnt_secret[0]);
21882188

2189+
const boolean draw_partime = (W_IsIWADLump(maplump) || deh_pars || um_pars) &&
2190+
(wbs->epsd < 3 || um_pars);
2191+
// [FG] choose x-position depending on width of time string
2192+
const boolean wide_total = (wbs->totaltimes / TICRATE > 61*59) ||
2193+
(SP_TIMEX + SHORT(total->width) >= SCREENWIDTH/4);
2194+
const boolean wide_time = (wide_total && !draw_partime);
2195+
21892196
V_DrawPatch(SP_TIMEX, SP_TIMEY, witime);
2190-
WI_drawTime(SCREENWIDTH/2 - SP_TIMEX, SP_TIMEY, cnt_time, true);
2197+
WI_drawTime((wide_time ? SCREENWIDTH : SCREENWIDTH/2) - SP_TIMEX,
2198+
SP_TIMEY, cnt_time, true);
21912199

21922200
// Ty 04/11/98: redid logic: should skip only if with pwad but
21932201
// without deh patch
21942202
// killough 2/22/98: skip drawing par times on pwads
21952203
// Ty 03/17/98: unless pars changed with deh patch
21962204

2197-
if (W_IsIWADLump(maplump) || deh_pars || um_pars)
2198-
if (wbs->epsd < 3 || um_pars)
2199-
{
2200-
V_DrawPatch(SCREENWIDTH/2 + SP_TIMEX, SP_TIMEY, par);
2201-
WI_drawTime(SCREENWIDTH - SP_TIMEX, SP_TIMEY, cnt_par, true);
2202-
}
2203-
2204-
// [FG] draw total time alongside level time and par time
2205+
if (draw_partime)
22052206
{
2206-
const boolean wide = (wbs->totaltimes / TICRATE > 61*59) || (SP_TIMEX + SHORT(total->width) >= SCREENWIDTH/4);
2207-
2208-
V_DrawPatch(SP_TIMEX, SP_TIMEY + 16, total);
2209-
// [FG] choose x-position depending on width of time string
2210-
WI_drawTime((wide ? SCREENWIDTH : SCREENWIDTH/2) - SP_TIMEX, SP_TIMEY + 16, cnt_total_time, false);
2207+
V_DrawPatch(SCREENWIDTH/2 + SP_TIMEX, SP_TIMEY, par);
2208+
WI_drawTime(SCREENWIDTH - SP_TIMEX, SP_TIMEY, cnt_par, true);
22112209
}
2210+
2211+
// [FG] draw total time alongside level time and par time
2212+
V_DrawPatch(SP_TIMEX, SP_TIMEY + 16, total);
2213+
WI_drawTime((wide_total ? SCREENWIDTH : SCREENWIDTH/2) - SP_TIMEX,
2214+
SP_TIMEY + 16, cnt_total_time, false);
22122215
}
22132216

22142217
// ====================================================================

0 commit comments

Comments
 (0)