diff options
author | Simon Howard | 2014-03-23 03:30:41 -0400 |
---|---|---|
committer | Simon Howard | 2014-03-23 03:30:41 -0400 |
commit | 7a7a66e0af1be72938616b04ebebe6bd9dbd706c (patch) | |
tree | 9b864eccebbeb1690a155c9b7994833630c54377 /src/hexen | |
parent | b295df80fe09802a774f9ef05d126f5139a383fa (diff) | |
download | chocolate-doom-7a7a66e0af1be72938616b04ebebe6bd9dbd706c.tar.gz chocolate-doom-7a7a66e0af1be72938616b04ebebe6bd9dbd706c.tar.bz2 chocolate-doom-7a7a66e0af1be72938616b04ebebe6bd9dbd706c.zip |
heretic/hexen: Fix -timedemo.
The -timedemo flag is broken in Vanilla Heretic/Hexen, as not all
fields are read from the demo headers. Fix it, as there's no utility
in having it nonfunctional and plenty of utility in having it
functional. This fixes #300.
Diffstat (limited to 'src/hexen')
-rw-r--r-- | src/hexen/g_game.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/hexen/g_game.c b/src/hexen/g_game.c index 4e40f578..bc58b128 100644 --- a/src/hexen/g_game.c +++ b/src/hexen/g_game.c @@ -1881,12 +1881,19 @@ void G_DoPlayDemo(void) void G_TimeDemo(char *name) { skill_t skill; - int episode, map; + int episode, map, i; demobuffer = demo_p = W_CacheLumpName(name, PU_STATIC); skill = *demo_p++; episode = *demo_p++; map = *demo_p++; + + for (i = 0; i < MAXPLAYERS; i++) + { + playeringame[i] = *demo_p++; + PlayerClass[i] = *demo_p++; + } + G_InitNew(skill, episode, map); usergame = false; demoplayback = true; @@ -1907,13 +1914,16 @@ void G_TimeDemo(char *name) boolean G_CheckDemoStatus(void) { - int endtime; + int endtime, realtics; if (timingdemo) { + float fps; endtime = I_GetTime(); - I_Error("timed %i gametics in %i realtics", gametic, - endtime - starttime); + realtics = endtime - starttime; + fps = ((float) gametic * TICRATE) / realtics; + I_Error("timed %i gametics in %i realtics (%f fps)", + gametic, realtics, fps); } if (demoplayback) |