From b9b02a8e1cf5cf1925edd350ea82cb20044371fe Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Tue, 4 Feb 2020 21:37:21 +0100 Subject: [PATCH] print time in demo widget timer in centiseconds instead of tics Thanks Looper and ZeroMaster010 for the suggestion. --- quickcheck | 2 +- src/doom/st_stuff.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/quickcheck b/quickcheck index 6cc4dd26ad..f093238324 160000 --- a/quickcheck +++ b/quickcheck @@ -1 +1 @@ -Subproject commit 6cc4dd26add5bc1e7a849d207751c5b7d9d209b1 +Subproject commit f093238324ab2c9003864c779b722a7afb72f139 diff --git a/src/doom/st_stuff.c b/src/doom/st_stuff.c index 5e27b6451c..232db9b29e 100644 --- a/src/doom/st_stuff.c +++ b/src/doom/st_stuff.c @@ -2376,12 +2376,12 @@ void ST_Init (void) void ST_DrawDemoTimer (const int time) { char buffer[16]; - const int secs = time / TICRATE; + const int mins = time / (60 * TICRATE); + const float secs = (float)(time % (60 * TICRATE)) / TICRATE; const int w = shortnum[0]->width; int n, x; - n = M_snprintf(buffer, sizeof(buffer), "%02i %02i %02i", - secs / 60, secs % 60, time % TICRATE); + n = M_snprintf(buffer, sizeof(buffer), "%02i %05.02f", mins, secs); x = (viewwindowx >> crispy->hires) + (scaledviewwidth >> crispy->hires);