diff options
author | Reimar <Reimar@Leike.name> | 2015-12-08 11:31:35 +0100 |
---|---|---|
committer | Reimar <Reimar@Leike.name> | 2015-12-08 11:31:35 +0100 |
commit | e3a66514d57ff4acf2f02df7d86bd2cf8be0e730 (patch) | |
tree | 686eabd8aac2f2eb9d0b3429fe0feee3f031904a /util.h | |
download | RCade-e3a66514d57ff4acf2f02df7d86bd2cf8be0e730.tar RCade-e3a66514d57ff4acf2f02df7d86bd2cf8be0e730.tar.gz RCade-e3a66514d57ff4acf2f02df7d86bd2cf8be0e730.tar.bz2 RCade-e3a66514d57ff4acf2f02df7d86bd2cf8be0e730.tar.xz RCade-e3a66514d57ff4acf2f02df7d86bd2cf8be0e730.zip |
initial commit
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 | ||