From 54fe6b0ec1acbad4c95e99b836a85df46cc158e7 Mon Sep 17 00:00:00 2001 From: Julia Nechaevskaya Date: Thu, 8 Jun 2023 13:42:55 +0300 Subject: [PATCH] Heretic: draw demo bar in `-timedemo` runs --- src/heretic/g_game.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/heretic/g_game.c b/src/heretic/g_game.c index 97faacd9..743590fa 100644 --- a/src/heretic/g_game.c +++ b/src/heretic/g_game.c @@ -2271,10 +2271,22 @@ void G_TimeDemo(char *name) { skill_t skill; int episode, map, i; + int lumpnum, lumplength; // [crispy] nodrawers = M_CheckParm ("-nodraw"); demobuffer = demo_p = W_CacheLumpName(name, PU_STATIC); + + // [crispy] ignore empty demo lumps + lumpnum = W_GetNumForName(name); + lumplength = W_LumpLength(lumpnum); + if (lumplength < 0xd) + { + demoplayback = true; + G_CheckDemoStatus(); + return; + } + skill = *demo_p++; episode = *demo_p++; map = *demo_p++; @@ -2309,6 +2321,9 @@ void G_TimeDemo(char *name) { netdemo = true; } + + // [crispy] demo progress bar + G_DemoProgressBar(lumplength); }