|
The Game Engine
1
|
Include dependency graph for fns.cpp:Go to the source code of this file.
Functions | |
| SDL_Surface * | LoadImage (std::string filename) |
| Loads supported images. More... | |
| unsigned int | nextPow2 (unsigned int i) |
| Rounds a number to the next power of two. More... | |
| Point2D | getVector (double angle, double speed) |
| Gets direction and length for a vector. More... | |
| int | randInt (int max) |
| Retrieves a random integer less than the given maximum. More... | |
| int | randInt (int min, int max) |
| Retrieves a random integer great than or equal to the minimum and less than the given maximum. More... | |
| float | randFloat (float min, float max) |
| Retrieves a random floating-point number between 0 and 1. More... | |
| vector< string > | splitString (string s, char delim, int rep) |
| Splits strings on delimiter. More... | |
| Point2D getVector | ( | double | angle, |
| double | speed | ||
| ) |
| SDL_Surface* LoadImage | ( | std::string | filename | ) |
Loads supported images.
< check to see if a filename was provided.
< if not exit the function
Load the image using our new IMG_Load function from sdl-Image1.2
< check to see if it loaded properly
the image loaded fine so we can now convert it to the current display depth
Destroy the old copy
return a pointer to the newly created display compatible image
Definition at line 11 of file fns.cpp.
Here is the caller graph for this function:| unsigned int nextPow2 | ( | unsigned int | i | ) |
| float randFloat | ( | float | min = 0, |
| float | max = 1 |
||
| ) |
| int randInt | ( | int | max = RAND_MAX | ) |
Retrieves a random integer less than the given maximum.
The integer returned will be greater than or equal to 0 and less than the maximum.
int diceroll = This.Game.RandInt(6)+1;
| max | The value that the generated random number must be less than. |
Definition at line 114 of file fns.cpp.
Here is the caller graph for this function:| int randInt | ( | int | min, |
| int | max | ||
| ) |
Retrieves a random integer great than or equal to the minimum and less than the given maximum.
| min | The value that the generated random number must be greater than or equal to. |
| max | The value that the generated random number must be less than. |