summaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorReimar <Reimar@Leike.name>2015-12-08 11:31:35 +0100
committerReimar <Reimar@Leike.name>2015-12-08 11:31:35 +0100
commite3a66514d57ff4acf2f02df7d86bd2cf8be0e730 (patch)
tree686eabd8aac2f2eb9d0b3429fe0feee3f031904a /util.h
downloadRCade-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.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/util.h b/util.h
new file mode 100644
index 0000000..acabdcb
--- /dev/null
+++ b/util.h
@@ -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
12using namespace std;
13
14//splits at '\n' and ' '
15vector<vector<string> > splitString(string s);
16
17//rounds too a beatiful number
18double round_beautiful(double d);
19
20void _tospace(string& s);
21void spaceto_(string& s);
22
23SDL_Event relativate(const SDL_Event &e, SDL_Rect p);
24
25SDL_Surface* copyImage(SDL_Surface* s);
26
27
28//loads a bitmap from file and converts it to screen properties
29SDL_Surface* loadBMP(std::string filename);
30
31bool inRect(SDL_Rect r, double x, double y);
32
33string lltostr(const long long& l);
34string dbltostr(const double& d, int dec);
35
36//returns true if the line intersects with the circle (or lies in it)
37bool intersects(double radius, double startx, double starty, double endx, double endy);
38
39#endif