UtilityClass: add a seconds() helper

This is intended to replace all those ugly magic frame numbers with
ever so slightly less ugly magic second numbers.

Basically, instead of saying:

    150 /* 5 seconds */

we can now say

    seconds(5)
This commit is contained in:
Christoph Böhmwalder 2020-01-10 23:33:53 +01:00
parent 3f3ea6eac7
commit 6befae4eef
2 changed files with 7 additions and 0 deletions

View File

@ -55,6 +55,11 @@ const char *GCChar(SDL_GameControllerButton button)
return NULL;
}
int seconds(const int s)
{
return s * 30;
}
int ss_toi( std::string _s )
{
std::istringstream i(_s);

View File

@ -5,6 +5,8 @@
#include <vector>
#include <string>
int seconds(const int s);
int ss_toi(std::string _s);
std::vector<std::string> split(const std::string &s, char delim, std::vector<std::string> &elems);