- resotred proper time calculations for status screen.

This commit is contained in:
Christoph Oelckers 2017-03-20 19:04:17 +01:00
parent 11e5759913
commit fb48a1b776
3 changed files with 16 additions and 8 deletions

View file

@ -378,6 +378,13 @@ class Thinker : Object native play
virtual native void Tick();
virtual native void PostBeginPlay();
virtual native void ChangeStatNum(int stat);
static int Tics2Seconds(int tics)
{
// This compensates for one tic being slightly less than 1/35 of a second.
return int(tics * (0.98 * TICRATE));
}
}
class ThinkerIterator : Object native

View file

@ -229,7 +229,7 @@ class DeathmatchStatusScreen : StatusScreen
// Draw game time
y += height + CleanYfac;
int seconds = Plrs[me].stime * Thinker.TICRATE;
int seconds = Thinker.Tics2Seconds(Plrs[me].stime);
int hours = seconds / 3600;
int minutes = (seconds % 3600) / 60;
seconds = seconds % 60;

View file

@ -27,9 +27,9 @@ class DoomStatusScreen : StatusScreen
cnt_kills[0] = Plrs[me].skills;
cnt_items[0] = Plrs[me].sitems;
cnt_secret[0] = Plrs[me].ssecret;
cnt_time = Plrs[me].stime / Thinker.TICRATE;
cnt_par = wbs.partime / Thinker.TICRATE;
cnt_total_time = wbs.totaltime / Thinker.TICRATE;
cnt_time = Thinker.Tics2Seconds(Plrs[me].stime);
cnt_par = Thinker.Tics2Seconds(wbs.partime);
cnt_total_time = Thinker.Tics2Seconds(wbs.totaltime);
}
if (sp_state == 2)
@ -92,17 +92,18 @@ class DoomStatusScreen : StatusScreen
cnt_total_time += 3;
}
int sec = Plrs[me].stime / Thinker.TICRATE;
int sec = Thinker.Tics2Seconds(Plrs[me].stime);
if (!intermissioncounter || cnt_time >= sec)
cnt_time = sec;
int tsec = wbs.totaltime / Thinker.TICRATE;
int tsec = Thinker.Tics2Seconds(wbs.totaltime);
if (!intermissioncounter || cnt_total_time >= tsec)
cnt_total_time = tsec;
if (!intermissioncounter || cnt_par >= wbs.partime / Thinker.TICRATE)
int psec = Thinker.Tics2Seconds(wbs.partime);
if (!intermissioncounter || cnt_par >= psec)
{
cnt_par = wbs.partime / Thinker.TICRATE;
cnt_par = psec;
if (cnt_time >= sec)
{