diff options
author | Andy <drumsetmonkey@gmail.com> | 2016-12-22 10:50:27 -0500 |
---|---|---|
committer | Andy <drumsetmonkey@gmail.com> | 2016-12-22 10:50:27 -0500 |
commit | 691411cdb214178f2d10ab589943993039fe080e (patch) | |
tree | 056acc0b536a05907b60fad86f9a3bc79254325d /src/common.cpp | |
parent | e472a62b750e57724a26d299bb682b4f39405d05 (diff) |
Sprites flip and shit are good
Diffstat (limited to 'src/common.cpp')
-rw-r--r-- | src/common.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/common.cpp b/src/common.cpp index 01a7db8..098cd84 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -22,6 +22,14 @@ unsigned int millis(void) { return std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()).count(); } + +vec2 str2coord(std::string s) +{ + auto cpos = s.find(','); + s[cpos] = '\0'; + return vec2 (std::stof(s), std::stof(s.substr(cpos + 1))); +} + std::vector<std::string> StringTokenizer(const std::string& str, char delim) { std::vector<std::string> tokens; |