diff --git a/src/g_game.c b/src/g_game.c index 5b9eb5dc7..c14b8accc 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -7845,7 +7845,6 @@ void G_DoneLevelLoad(void) // Stops metal sonic's demo. Separate from other functions because metal + replays can coexist void G_StopMetalDemo(void) { - // Metal Sonic finishing doesn't end the game, dammit. Z_Free(metalbuffer); metalbuffer = NULL; @@ -8180,32 +8179,3 @@ boolean G_GetRetryFlag(void) { return retrying; } - -// Time utility functions -INT32 G_TicsToHours(tic_t tics) -{ - return tics/(3600*TICRATE); -} - -INT32 G_TicsToMinutes(tic_t tics, boolean full) -{ - if (full) - return tics/(60*TICRATE); - else - return tics/(60*TICRATE)%60; -} - -INT32 G_TicsToSeconds(tic_t tics) -{ - return (tics/TICRATE)%60; -} - -INT32 G_TicsToCentiseconds(tic_t tics) -{ - return (INT32)((tics%TICRATE) * (100.00f/TICRATE)); -} - -INT32 G_TicsToMilliseconds(tic_t tics) -{ - return (INT32)((tics%TICRATE) * (1000.00f/TICRATE)); -} diff --git a/src/g_game.h b/src/g_game.h index 6723e9ba6..fa427b752 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -432,11 +432,32 @@ void G_ClearRecords(void); tic_t G_GetBestTime(INT16 map); -FUNCMATH INT32 G_TicsToHours(tic_t tics); -FUNCMATH INT32 G_TicsToMinutes(tic_t tics, boolean full); -FUNCMATH INT32 G_TicsToSeconds(tic_t tics); -FUNCMATH INT32 G_TicsToCentiseconds(tic_t tics); -FUNCMATH INT32 G_TicsToMilliseconds(tic_t tics); +// Time utility functions + +FUNCINLINE static ATTRINLINE FUNCMATH INT32 G_TicsToHours(tic_t tics) +{ + return tics/(3600*TICRATE); +} + +FUNCINLINE static ATTRINLINE FUNCMATH INT32 G_TicsToMinutes(tic_t tics, boolean full) +{ + return full ? (tics/(60*TICRATE)) : (tics/(60*TICRATE)%60); +} + +FUNCINLINE static ATTRINLINE FUNCMATH INT32 G_TicsToSeconds(tic_t tics) +{ + return (tics/TICRATE)%60; +} + +FUNCINLINE static ATTRINLINE FUNCMATH INT32 G_TicsToCentiseconds(tic_t tics) +{ + return (INT32)((tics%TICRATE) * (100.00f/TICRATE)); +} + +FUNCINLINE static ATTRINLINE FUNCMATH INT32 G_TicsToMilliseconds(tic_t tics) +{ + return (INT32)((tics%TICRATE) * (1000.00f/TICRATE)); +} // Don't split up TOL handling INT16 G_TOLFlag(INT32 pgametype);