Skip to content

Commit

Permalink
- the timing compensation which was necessary for millisecond-precise…
Browse files Browse the repository at this point in the history
… timing is not needed anymore with nanoseconds.
  • Loading branch information
coelckers committed Nov 12, 2017
1 parent efa7c3c commit 0289d9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
16 changes: 1 addition & 15 deletions src/cmdlib.h
Expand Up @@ -65,23 +65,9 @@ struct FFileList
void ScanDirectory(TArray<FFileList> &list, const char *dirpath);


//==========================================================================
//
// Functions to compensate for a tic being a bit short.
// Since ZDoom uses a milliseconds timer for game timing
// 35 tics are actually only 0.98 seconds.
// For real time display this needs to be adjusted
//
//==========================================================================

inline int AdjustTics(int tics)
{
return Scale(tics, 98, 100);
}

inline int Tics2Seconds(int tics)
{
return Scale(tics, 98, (100 * TICRATE));
return tics * TICRATE;
}


Expand Down
4 changes: 2 additions & 2 deletions src/statistics.cpp
Expand Up @@ -420,7 +420,7 @@ static void StoreLevelStats()
LevelData[i].killcount = level.killed_monsters;
LevelData[i].totalsecrets = level.total_secrets;
LevelData[i].secretcount = level.found_secrets;
LevelData[i].leveltime = AdjustTics(level.maptime);
LevelData[i].leveltime = level.maptime;

// Check for living monsters. On some maps it can happen
// that the counter misses some.
Expand Down Expand Up @@ -490,7 +490,7 @@ void STAT_ChangeLevel(const char *newl)
}

infostring.Format("%4d/%4d, %3d/%3d, %2d", statvals[0], statvals[1], statvals[2], statvals[3], validlevels);
FSessionStatistics *es = StatisticsEntry(sl, infostring, AdjustTics(level.totaltime));
FSessionStatistics *es = StatisticsEntry(sl, infostring, level.totaltime);

for(unsigned i = 0; i < LevelData.Size(); i++)
{
Expand Down

0 comments on commit 0289d9a

Please sign in to comment.