#ifndef UTIL_H #define UTIL_H #include #include #include #include #include #include #include using namespace std; string get_data_path(); //splits at '\n' and ' ' vector > splitString(string s); //rounds too a beatiful number double round_beautiful(double d); void _tospace(string& s); void spaceto_(string& s); SDL_Event relativate(const SDL_Event &e, SDL_Rect p); SDL_Surface* copyImage(SDL_Surface* s); //loads a bitmap from file and converts it to screen properties SDL_Surface* loadBMP(std::string filename); bool inRect(SDL_Rect r, double x, double y); string lltostr(const long long& l); string dbltostr(const double& d, int dec); //returns true if the line intersects with the circle (or lies in it) bool intersects(double radius, double startx, double starty, double endx, double endy); #endif