mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-31 10:14:40 +03:00
Add centiseconds to timer overlays
This adds centiseconds to the in-game timer, as well as the time trial timer. This is to aid speedrun moderators in determining when exactly a run was completed, which they can't easily do if the timer only has a precision up to a second.
This commit is contained in:
@@ -5822,6 +5822,21 @@ std::string Game::timetstring( int t )
|
||||
return tempstring;
|
||||
}
|
||||
|
||||
void Game::timestringcenti(char* buffer, const size_t buffer_size)
|
||||
{
|
||||
/* 16 chars should be plenty for int32s */
|
||||
char hours_str[16] = {'\0'};
|
||||
if (hours > 0)
|
||||
{
|
||||
SDL_snprintf(hours_str, sizeof(hours_str), "%i:", hours);
|
||||
}
|
||||
SDL_snprintf(
|
||||
buffer, buffer_size,
|
||||
"%s%02i:%02i.%02i",
|
||||
hours_str, minutes, seconds, frames * 100 / 30
|
||||
);
|
||||
}
|
||||
|
||||
void Game::returnmenu(void)
|
||||
{
|
||||
if (menustack.empty())
|
||||
|
||||
Reference in New Issue
Block a user