#include <SDL/SDL.h>
#include <string>
#include <iostream>
#include <sstream>
#include <GL/gl.h>
#include <vector>
#include "Texture.h"
#include <math.h>
Go to the source code of this file.
|
| class | Point2D |
| | 2D position or vector placed here because of general access More...
|
| |
| class | Size2D |
| | Just for more logical names for sizes of objects. More...
|
| |
|
| #define | foritr(a, b) for(auto a=b.begin(),end=b.end();a!=end;++a) |
| | This allows you to iterate over things with iterators without too much pain. More...
|
| |
| #define | foritrNoInc(a, b) for(auto a=b.begin(),end=b.end();a!=end;) |
| | This allows you to iterate over things with iterators but does not actuall increment the iterator allowing the user to iterate instead. More...
|
| |
|
| typedef void(* | Behavior )() |
| | Behaviors use functions that take nothing and return nothing. More...
|
| |
| typedef bool(* | Condition )() |
| | A function that determines state of level completion. More...
|
| |
|
| 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=RAND_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=0, float max=1) |
| | Retrieves a random floating-point number between 0 and 1. More...
|
| |
| vector< string > | splitString (string s, char delim='\n', int rep=0) |
| | Splits strings on delimiter. More...
|
| |
| template<typename NumTy > |
| string | ToString (const NumTy &Num) |
| |
| #define foritr |
( |
|
a, |
|
|
|
b |
|
) |
| for(auto a=b.begin(),end=b.end();a!=end;++a) |
This allows you to iterate over things with iterators without too much pain.
- Parameters
-
| a | The variable name to contain the iterated object |
| b | The object to iterate over |
Definition at line 47 of file fns.h.
| #define foritrNoInc |
( |
|
a, |
|
|
|
b |
|
) |
| for(auto a=b.begin(),end=b.end();a!=end;) |
This allows you to iterate over things with iterators but does not actuall increment the iterator allowing the user to iterate instead.
- Parameters
-
| a | The variable name to contain the iterated object |
| b | The object to iterate over |
Definition at line 54 of file fns.h.
| typedef void(* Behavior)() |
Behaviors use functions that take nothing and return nothing.
Definition at line 32 of file fns.h.
| typedef bool(* Condition)() |
A function that determines state of level completion.
Definition at line 34 of file fns.h.
The types that our fonts can be.
| Enumerator |
|---|
| English |
|
| Japanese |
|
| JapaneseWithRuby |
|
Definition at line 59 of file fns.h.
| Point2D getVector |
( |
double |
angle, |
|
|
double |
speed |
|
) |
| |
Gets direction and length for a vector.
- Parameters
-
| angle | the angle in radians |
| speed | the speed of the object |
Definition at line 107 of file fns.cpp.
| 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.
| unsigned int nextPow2 |
( |
unsigned int |
i | ) |
|
Rounds a number to the next power of two.
Definition at line 96 of file fns.cpp.
| float randFloat |
( |
float |
min = 0, |
|
|
float |
max = 1 |
|
) |
| |
Retrieves a random floating-point number between 0 and 1.
- Parameters
-
| min | the lower bound |
| max | the upper bound |
- Returns
- A random floating-point number between 0 and 1.
Definition at line 124 of file fns.cpp.
| 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;
- Parameters
-
| max | The value that the generated random number must be less than. |
- Returns
- A random integer in the specified range.
Definition at line 114 of file fns.cpp.
| int randInt |
( |
int |
min, |
|
|
int |
max |
|
) |
| |
Retrieves a random integer great than or equal to the minimum and less than the given maximum.
- Parameters
-
| 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. |
- Returns
- A random integer in the specified range.
Definition at line 119 of file fns.cpp.
| vector<string> splitString |
( |
string |
s, |
|
|
char |
delim = '\n', |
|
|
int |
rep = 0 |
|
) |
| |
Splits strings on delimiter.
Definition at line 130 of file fns.cpp.
template<typename NumTy >
| string ToString |
( |
const NumTy & |
Num | ) |
|
| const double DEG_IN_RAD = (PI/180.) |
deg/rad
Definition at line 40 of file fns.h.