2 #include <SDL/SDL_image.h>
13 SDL_Surface* loaded_image = NULL;
14 SDL_Surface* compatible_image = NULL;
16 filename=
"ArtAssets/"+filename;
17 if(filename.c_str() == NULL)
19 printf(
"No Filename %s\n\n",filename.c_str());
25 loaded_image = IMG_Load( filename.c_str() );
29 printf(
"Error opening %s\n\n",filename.c_str());
35 compatible_image = SDL_DisplayFormat( loaded_image );
38 SDL_FreeSurface( loaded_image );
41 return compatible_image;
50 return sqrt(
x*
x +
y*
y);
93 return p1.
x * p2.
x + p1.
y * p2.
y;
109 double y = sin(angle);
110 double x = cos(angle);
121 return rand() % max + min;
126 float f = (float)rand()/RAND_MAX;
127 return min + f * ( max - min );
132 vector<string> lines = vector<string>();
142 n = temp.find(delim, p + 1 );
145 substr = temp.substr( p, n );
149 lines.push_back( substr );
150 temp = temp.substr( p+1, string::npos );
154 lines.push_back(temp);