common.h File Reference

#include "ActionMenu.h"
#include "ResourceHandler.h"
#include "GLText.h"
#include <cmath>
#include <string>
#include <list>
#include <vector>

Include dependency graph for common.h:

Go to the source code of this file.

Classes

struct  Global
 Structure to accomondate gloabl variables accessable throughout the application. More...
class  ElemDeleter< T, zero >
 Used to delete an object of type T and possibly set the pointer to NULL. More...
class  AtScopeExit< T, X >
 Invoke a function at scope exit. More...

Typedefs

typedef std::list< Sprite * > SpriteList
 List of sprite-pointers.
typedef SpriteList::iterator SpriteIterator
 Iterator over list of sprite-pointers.

Functions

template<typename T>
float FAST_SQRT_UNSAFE (const T &f)
template<typename T>
float FAST_SQRT (const T &f)
template<typename T>
SQR (const T &a)
 Take a^2, same as POW2.
template<typename T>
POW2 (const T &a)
 Take a^2, same as SQR.
template<typename T>
double Deg2Rad (const T &deg)
 Convert value in degrees to radians.
template<typename T>
double Rad2Deg (const T &rad)
 Convert value in radians to degrees.
template<typename T>
void NormalizeDeg (T &deg)
 Make deg between -180 - 180 degrees.
template<typename T>
void NormalizeRad (T &rad)
 Make rad between -PI - PI radians.
template<typename T>
Abs (const T &a)
 Absolute value of a.
template<typename T>
AbsMin (const T &a, const T &b)
 Return value that has the smallest absolute value.
void Quit (int exitval=0)
 Quit the application.
template<typename T>
ElemDeleter< T, false > DelElem ()
template<typename T>
void DelNZero (T *&o)
 Delete and zero a pointer.
void DownCase (char &c)
 Convert a character to its lower-case equivalent.
void UpCase (char &c)
 Convert a character to its upper-case equivalent.
template<typename PtrType, typename Collection>
void ClearCollection (Collection &col)

Variables

float * g_sqrtTable
static const char FAST_SQRT_MAX = 5
static const float FAST_SQRT_STEP = 0.01f
Global g
 Common global variable.


Typedef Documentation

typedef SpriteList::iterator SpriteIterator

Iterator over list of sprite-pointers.

typedef std::list<Sprite*> SpriteList

List of sprite-pointers.


Function Documentation

template<typename T>
T Abs ( const T &  a  )  [inline]

Absolute value of a.

template<typename T>
T AbsMin ( const T &  a,
const T &  b 
) [inline]

Return value that has the smallest absolute value.

Note that the return value is signed (i.e. AbsMin(-4, -7) = -4)

template<typename PtrType, typename Collection>
void ClearCollection ( Collection &  col  ) 

template<typename T>
double Deg2Rad ( const T &  deg  )  [inline]

Convert value in degrees to radians.

template<typename T>
ElemDeleter<T, false> DelElem (  )  [inline]

template<typename T>
void DelNZero ( T *&  o  )  [inline]

Delete and zero a pointer.

void DownCase ( char &  c  )  [inline]

Convert a character to its lower-case equivalent.

template<typename T>
float FAST_SQRT ( const T &  f  )  [inline]

template<typename T>
float FAST_SQRT_UNSAFE ( const T &  f  )  [inline]

template<typename T>
void NormalizeDeg ( T &  deg  )  [inline]

Make deg between -180 - 180 degrees.

template<typename T>
void NormalizeRad ( T &  rad  )  [inline]

Make rad between -PI - PI radians.

template<typename T>
T POW2 ( const T &  a  )  [inline]

Take a^2, same as SQR.

void Quit ( int  exitval = 0  ) 

Quit the application.

template<typename T>
double Rad2Deg ( const T &  rad  )  [inline]

Convert value in radians to degrees.

template<typename T>
T SQR ( const T &  a  )  [inline]

Take a^2, same as POW2.

void UpCase ( char &  c  )  [inline]

Convert a character to its upper-case equivalent.


Variable Documentation

const char FAST_SQRT_MAX = 5 [static]

const float FAST_SQRT_STEP = 0.01f [static]

Global g

Common global variable.

float* g_sqrtTable


Generated on Sun Mar 11 15:33:25 2007 for MetalWarriors by  doxygen 1.4.7