diff options
Diffstat (limited to 'util.h')
| -rw-r--r-- | util.h | 39 |
1 files changed, 39 insertions, 0 deletions
| @@ -0,0 +1,39 @@ | |||
| 1 | #ifndef UTIL_H | ||
| 2 | #define UTIL_H | ||
| 3 | |||
| 4 | #include <vector> | ||
| 5 | #include <iostream> | ||
| 6 | #include <math.h> | ||
| 7 | #include <sstream> | ||
| 8 | #include <SDL/SDL.h> | ||
| 9 | #include <SDL/SDL_ttf.h> | ||
| 10 | #include <SDL/SDL_image.h> | ||
| 11 | |||
| 12 | using namespace std; | ||
| 13 | |||
| 14 | //splits at '\n' and ' ' | ||
| 15 | vector<vector<string> > splitString(string s); | ||
| 16 | |||
| 17 | //rounds too a beatiful number | ||
| 18 | double round_beautiful(double d); | ||
| 19 | |||
| 20 | void _tospace(string& s); | ||
| 21 | void spaceto_(string& s); | ||
| 22 | |||
| 23 | SDL_Event relativate(const SDL_Event &e, SDL_Rect p); | ||
| 24 | |||
| 25 | SDL_Surface* copyImage(SDL_Surface* s); | ||
| 26 | |||
| 27 | |||
| 28 | //loads a bitmap from file and converts it to screen properties | ||
| 29 | SDL_Surface* loadBMP(std::string filename); | ||
| 30 | |||
| 31 | bool inRect(SDL_Rect r, double x, double y); | ||
| 32 | |||
| 33 | string lltostr(const long long& l); | ||
| 34 | string dbltostr(const double& d, int dec); | ||
| 35 | |||
| 36 | //returns true if the line intersects with the circle (or lies in it) | ||
| 37 | bool intersects(double radius, double startx, double starty, double endx, double endy); | ||
| 38 | |||
| 39 | #endif | ||
