1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-03 03:23:33 +02:00

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; return NULL;
} }
int seconds(const int s)
{
return s * 30;
}
int ss_toi( std::string _s ) int ss_toi( std::string _s )
{ {
std::istringstream i(_s); std::istringstream i(_s);

View File

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