Forums
This is the online documentation for Colossus Entertainments Pixie Game Engine

StandardLibrary.cpp File Reference

Go to the source code of this file.

Defines

#define _CRT_SECURE_NO_DEPRECATE
#define _CRT_NON_CONFORMING_SWPRINTFS

Functions

int Round (float x)
void SRand (unsigned int seed)
unsigned int Rand ()
void Randomize ()
int ToUpper (int c)
int ToLower (int c)
int StringToInt (const char *string)
int StringToInt (const UnicodeChar *string)
long StringToLong (const char *string)
long StringToLong (const UnicodeChar *string)
double StringToDouble (const char *string)
double StringToDouble (const UnicodeChar *string)
void _CharToUnicodeChar (const char *source, UnicodeChar *dest)
void _UnicodeCharToChar (const UnicodeChar *source, char *dest)
char * StrDup_UnicodeCharToChar (const UnicodeChar *source)
UnicodeCharStrDup_CharToUnicodeChar (const char *source)
char * StrDup (const char *string)
UnicodeCharStrDup (const UnicodeChar *string)
char * IntToString (int value, char *string, int maxLength)
int SPrintF_NOT_ALLOWED (char *buffer, const char *string,...)
int SPrintF_NOT_ALLOWED (UnicodeChar *buffer, const UnicodeChar *string,...)
int SNPrintF (char *buffer, int maxLength, const char *string,...)
int SNPrintF (UnicodeChar *buffer, int maxLength, const UnicodeChar *string,...)
int StrNICmp (const char *string1, const char *string2, int count)
int StrNICmp (const UnicodeChar *string1, const UnicodeChar *string2, int count)
int StrNCmp (const char *string1, const char *string2, int count)
int StrNCmp (const UnicodeChar *string1, const UnicodeChar *string2, int count)
int StrICmp (const char *string1, const char *string2)
int StrICmp (const UnicodeChar *string1, const UnicodeChar *string2)
int StrCmp (const char *string1, const char *string2)
int StrCmp (const UnicodeChar *string1, const UnicodeChar *string2)
unsigned int StrLen (const char *string)
unsigned int StrLen (const UnicodeChar *string)
char * StrCpy (char *strDestination, const char *strSource)
UnicodeCharStrCpy (UnicodeChar *strDestination, const UnicodeChar *strSource)
char * StrNCpy (char *strDestination, const char *strSource, int count)
UnicodeCharStrNCpy (UnicodeChar *strDestination, const UnicodeChar *strSource, int count)
char * StrCat (char *strDestination, const char *strSource)
UnicodeCharStrCat (UnicodeChar *strDestination, const UnicodeChar *strSource)
char * StrNCat (char *strDestination, const char *strSource, int count)
UnicodeCharStrNCat (UnicodeChar *strDestination, const UnicodeChar *strSource, int count)
char * StrUpr (char *string)
UnicodeCharStrUpr (UnicodeChar *string)
char * StrLwr (char *string)
UnicodeCharStrLwr (UnicodeChar *string)
const char * StrChr (const char *string, int c)
const UnicodeCharStrChr (const UnicodeChar *string, int c)
const char * StrRChr (const char *string, int c)
const UnicodeCharStrRChr (const UnicodeChar *string, int c)
char * StrTok (char *strToken, const char *strDelimit)
UnicodeCharStrTok (UnicodeChar *strToken, const UnicodeChar *strDelimit)
char * StrStr (const char *str1, const char *str2)
UnicodeCharStrStr (const UnicodeChar *str1, const UnicodeChar *str2)
void * Malloc (unsigned int size)
void Free (void *memblock)
void * Realloc (void *memblock, unsigned int size)
void * MemCpy (void *dest, const void *src, unsigned int count)
void * MemSet (void *dest, int c, unsigned int count)
void QSort (void *base, size_t num, size_t width, int(__cdecl *compare)(const void *, const void *))
float ToRadians (float degrees)
float ToDegrees (float radians)
float AngleDiff (float angleA, float angleB)
float Abs (float x)
int Abs (int x)
float Sqrt (float x)
float Mod (float x, float y)
float Sin (float x)
float ASin (float x)
float Cos (float x)
float ACos (float x)
float Tan (float x)
float ATan (float x)
float Atan2 (float x, float y)
int Pow (int x, int y)
float Pow (float x, float y)
float Exp (float x)
float Log (float x)
float Max (float a, float b)
float Min (float a, float b)
int Max (int a, int b)
int Min (int a, int b)
int Clamp (int value, int min, int max)
float Clamp (float value, float min, float max)
void Swap (int &x, int &y)
void Swap (float &x, float &y)


Define Documentation

#define _CRT_SECURE_NO_DEPRECATE

Definition at line 7 of file StandardLibrary.cpp.

#define _CRT_NON_CONFORMING_SWPRINTFS

Definition at line 8 of file StandardLibrary.cpp.


Function Documentation

int Round ( float  x  ) 

Definition at line 37 of file StandardLibrary.cpp.

void SRand ( unsigned int  seed  ) 

Definition at line 54 of file StandardLibrary.cpp.

unsigned int Rand (  ) 

Definition at line 59 of file StandardLibrary.cpp.

void Randomize (  ) 

Definition at line 64 of file StandardLibrary.cpp.

int ToUpper ( int  c  ) 

Definition at line 69 of file StandardLibrary.cpp.

int ToLower ( int  c  ) 

Definition at line 74 of file StandardLibrary.cpp.

int StringToInt ( const char *  string  ) 

Definition at line 79 of file StandardLibrary.cpp.

int StringToInt ( const UnicodeChar string  ) 

Definition at line 84 of file StandardLibrary.cpp.

long StringToLong ( const char *  string  ) 

Definition at line 89 of file StandardLibrary.cpp.

long StringToLong ( const UnicodeChar string  ) 

Definition at line 94 of file StandardLibrary.cpp.

double StringToDouble ( const char *  string  ) 

Definition at line 99 of file StandardLibrary.cpp.

double StringToDouble ( const UnicodeChar string  ) 

Definition at line 104 of file StandardLibrary.cpp.

void _CharToUnicodeChar ( const char *  source,
UnicodeChar dest 
)

Definition at line 109 of file StandardLibrary.cpp.

void _UnicodeCharToChar ( const UnicodeChar source,
char *  dest 
)

Definition at line 117 of file StandardLibrary.cpp.

char* StrDup_UnicodeCharToChar ( const UnicodeChar source  ) 

Definition at line 128 of file StandardLibrary.cpp.

UnicodeChar* StrDup_CharToUnicodeChar ( const char *  source  ) 

Definition at line 139 of file StandardLibrary.cpp.

char* StrDup ( const char *  string  ) 

Definition at line 151 of file StandardLibrary.cpp.

UnicodeChar* StrDup ( const UnicodeChar string  ) 

Definition at line 156 of file StandardLibrary.cpp.

char* IntToString ( int  value,
char *  string,
int  maxLength 
)

Definition at line 161 of file StandardLibrary.cpp.

int SPrintF_NOT_ALLOWED ( char *  buffer,
const char *  string,
  ... 
)

Definition at line 170 of file StandardLibrary.cpp.

int SPrintF_NOT_ALLOWED ( UnicodeChar buffer,
const UnicodeChar string,
  ... 
)

Definition at line 179 of file StandardLibrary.cpp.

int SNPrintF ( char *  buffer,
int  maxLength,
const char *  string,
  ... 
)

Definition at line 188 of file StandardLibrary.cpp.

int SNPrintF ( UnicodeChar buffer,
int  maxLength,
const UnicodeChar string,
  ... 
)

Definition at line 197 of file StandardLibrary.cpp.

int StrNICmp ( const char *  string1,
const char *  string2,
int  count 
)

Definition at line 206 of file StandardLibrary.cpp.

int StrNICmp ( const UnicodeChar string1,
const UnicodeChar string2,
int  count 
)

Definition at line 211 of file StandardLibrary.cpp.

int StrNCmp ( const char *  string1,
const char *  string2,
int  count 
)

Definition at line 216 of file StandardLibrary.cpp.

int StrNCmp ( const UnicodeChar string1,
const UnicodeChar string2,
int  count 
)

Definition at line 221 of file StandardLibrary.cpp.

int StrICmp ( const char *  string1,
const char *  string2 
)

Definition at line 226 of file StandardLibrary.cpp.

int StrICmp ( const UnicodeChar string1,
const UnicodeChar string2 
)

Definition at line 231 of file StandardLibrary.cpp.

int StrCmp ( const char *  string1,
const char *  string2 
)

Definition at line 235 of file StandardLibrary.cpp.

int StrCmp ( const UnicodeChar string1,
const UnicodeChar string2 
)

Definition at line 239 of file StandardLibrary.cpp.

unsigned int StrLen ( const char *  string  ) 

Definition at line 244 of file StandardLibrary.cpp.

unsigned int StrLen ( const UnicodeChar string  ) 

Definition at line 249 of file StandardLibrary.cpp.

char* StrCpy ( char *  strDestination,
const char *  strSource 
)

Definition at line 254 of file StandardLibrary.cpp.

UnicodeChar* StrCpy ( UnicodeChar strDestination,
const UnicodeChar strSource 
)

Definition at line 259 of file StandardLibrary.cpp.

char* StrNCpy ( char *  strDestination,
const char *  strSource,
int  count 
)

Definition at line 264 of file StandardLibrary.cpp.

UnicodeChar* StrNCpy ( UnicodeChar strDestination,
const UnicodeChar strSource,
int  count 
)

Definition at line 269 of file StandardLibrary.cpp.

char* StrCat ( char *  strDestination,
const char *  strSource 
)

Definition at line 274 of file StandardLibrary.cpp.

UnicodeChar* StrCat ( UnicodeChar strDestination,
const UnicodeChar strSource 
)

Definition at line 279 of file StandardLibrary.cpp.

char* StrNCat ( char *  strDestination,
const char *  strSource,
int  count 
)

Definition at line 284 of file StandardLibrary.cpp.

UnicodeChar* StrNCat ( UnicodeChar strDestination,
const UnicodeChar strSource,
int  count 
)

Definition at line 289 of file StandardLibrary.cpp.

char* StrUpr ( char *  string  ) 

Definition at line 294 of file StandardLibrary.cpp.

UnicodeChar* StrUpr ( UnicodeChar string  ) 

Definition at line 299 of file StandardLibrary.cpp.

char* StrLwr ( char *  string  ) 

Definition at line 304 of file StandardLibrary.cpp.

UnicodeChar* StrLwr ( UnicodeChar string  ) 

Definition at line 309 of file StandardLibrary.cpp.

const char* StrChr ( const char *  string,
int  c 
)

Definition at line 314 of file StandardLibrary.cpp.

const UnicodeChar* StrChr ( const UnicodeChar string,
int  c 
)

Definition at line 319 of file StandardLibrary.cpp.

const char* StrRChr ( const char *  string,
int  c 
)

Definition at line 324 of file StandardLibrary.cpp.

const UnicodeChar* StrRChr ( const UnicodeChar string,
int  c 
)

Definition at line 329 of file StandardLibrary.cpp.

char* StrTok ( char *  strToken,
const char *  strDelimit 
)

Definition at line 334 of file StandardLibrary.cpp.

UnicodeChar* StrTok ( UnicodeChar strToken,
const UnicodeChar strDelimit 
)

Definition at line 339 of file StandardLibrary.cpp.

char* StrStr ( const char *  str1,
const char *  str2 
)

Definition at line 344 of file StandardLibrary.cpp.

UnicodeChar* StrStr ( const UnicodeChar str1,
const UnicodeChar str2 
)

Definition at line 349 of file StandardLibrary.cpp.

void* Malloc ( unsigned int  size  ) 

Definition at line 355 of file StandardLibrary.cpp.

void Free ( void *  memblock  ) 

Definition at line 362 of file StandardLibrary.cpp.

void* Realloc ( void *  memblock,
unsigned int  size 
)

Definition at line 367 of file StandardLibrary.cpp.

void* MemCpy ( void *  dest,
const void *  src,
unsigned int  count 
)

Definition at line 374 of file StandardLibrary.cpp.

void* MemSet ( void *  dest,
int  c,
unsigned int  count 
)

Definition at line 379 of file StandardLibrary.cpp.

void QSort ( void *  base,
size_t  num,
size_t  width,
int(__cdecl *compare)(const void *, const void *)   
)

Definition at line 384 of file StandardLibrary.cpp.

float ToRadians ( float  degrees  ) 

Converts an angle from degrees to radians

Returns:
The angle in radians

Definition at line 392 of file StandardLibrary.cpp.

float ToDegrees ( float  radians  ) 

Converts an angle from radians to degrees

Returns:
The angle in degrees

Definition at line 400 of file StandardLibrary.cpp.

float AngleDiff ( float  angleA,
float  angleB 
)

Calculates the difference between two angles. The result is quaranteed to be between -PI and PI, regardless of what angleA and angleB might be

Definition at line 408 of file StandardLibrary.cpp.

float Abs ( float  x  ) 

Calculates the absolute value of the argument.

Returns:
The absolute value of the argument.

Definition at line 447 of file StandardLibrary.cpp.

int Abs ( int  x  ) 

Calculates the absolute value of the argument.

Returns:
The absolute value of the argument.

Definition at line 455 of file StandardLibrary.cpp.

float Sqrt ( float  x  ) 

Calculates the square root of x. If x is negative, it returns an indefinite.

Returns:
The square-root of x.

Definition at line 463 of file StandardLibrary.cpp.

float Mod ( float  x,
float  y 
)

Calculates the floating-point remainder of x / y. If the value of y is 0.0, it returns a quiet NaN.

Returns:
The floating-point remainder.

Definition at line 471 of file StandardLibrary.cpp.

float Sin ( float  x  ) 

Calculate sine of x. If x is greater than or equal to 263, or less than or equal to -263, a loss of significance in the result occurs.

Returns:
The sine of x.

Definition at line 479 of file StandardLibrary.cpp.

float ASin ( float  x  ) 

Definition at line 487 of file StandardLibrary.cpp.

float Cos ( float  x  ) 

Calculate cosine of x. If x is greater than or equal to 263, or less than or equal to –263, a loss of significance in the result occurs.

Returns:
The cosine of x.

Definition at line 495 of file StandardLibrary.cpp.

float ACos ( float  x  ) 

Definition at line 503 of file StandardLibrary.cpp.

float Tan ( float  x  ) 

Definition at line 511 of file StandardLibrary.cpp.

float ATan ( float  x  ) 

Definition at line 519 of file StandardLibrary.cpp.

float Atan2 ( float  x,
float  y 
)

Calculates the arctangent of y/x in the range –PI to PI radians. If x is 0, Atan2 returns 0. If both parameters of Atan2 are 0, the function returns 0. Atan2 uses the signs of both parameters to determine the quadrant of the return value. Atan2 is well defined for every point other than the origin, even if x equals 0 and y does not equal 0.

Returns:
the arctangent of y/x

Definition at line 527 of file StandardLibrary.cpp.

int Pow ( int  x,
int  y 
)

Definition at line 535 of file StandardLibrary.cpp.

float Pow ( float  x,
float  y 
)

Definition at line 543 of file StandardLibrary.cpp.

float Exp ( float  x  ) 

Definition at line 551 of file StandardLibrary.cpp.

float Log ( float  x  ) 

Definition at line 559 of file StandardLibrary.cpp.

float Max ( float  a,
float  b 
)

Definition at line 567 of file StandardLibrary.cpp.

float Min ( float  a,
float  b 
)

Definition at line 580 of file StandardLibrary.cpp.

int Max ( int  a,
int  b 
)

Definition at line 593 of file StandardLibrary.cpp.

int Min ( int  a,
int  b 
)

Definition at line 606 of file StandardLibrary.cpp.

int Clamp ( int  value,
int  min,
int  max 
)

Definition at line 619 of file StandardLibrary.cpp.

float Clamp ( float  value,
float  min,
float  max 
)

Definition at line 635 of file StandardLibrary.cpp.

void Swap ( int &  x,
int &  y 
)

Definition at line 651 of file StandardLibrary.cpp.

void Swap ( float &  x,
float &  y 
)

Definition at line 661 of file StandardLibrary.cpp.