14 int random(int min, int max){
15 return min + rand() % (max - min + 1);
17 color::color(const char *htmlcolor){
19 sscanf(htmlcolor, "#%2x%2x%2x", &r, &g, &b);
20 red = (float) r / 255;
21 green = (float) g / 255;
22 blue = (float) b / 255;
24 color::color(float r, float g, float b){
29 void create_dir_if_not_exists(string d){
30 const char *dir = d.c_str();
31 struct stat dir_exists_st = {0};
32 if(stat(dir, &dir_exists_st) == -1){
33 Game::log((string)dir + " doesn't exist, creating", INFO);