C:/quickbuild-1.2.13/working/root/Docs/TGEA_Offline_Docs/checkouts/engine/source/platform/types.h File Reference


Classes

struct  EmptyType

Defines

#define TORQUE_UNUSED(var)   (void)var
#define __EQUAL_CONST_F   F32(0.000001)
 Constant float epsilon used for F32 comparisons.
#define _Offset_Normal(x, cls)   ((dsize_t)((const char *)&(((cls *)1)->x)-(const char *)1))
#define _Offset_Variant_1(x, cls)   ((int)(&((cls *)1)->x) - 1)
#define _Offset_Variant_2(x, cls)   offsetof(cls, x)
#define TORQUE_ENABLE_ASSERTS
#define makeFourCCTag(ch0, ch1, ch2, ch3)
#define makeFourCCString(ch0, ch1, ch2, ch3)   { ch0, ch1, ch2, ch3 }
#define BIT(x)   (1 << (x))
 Returns value with bit x set (2^x).
#define STDCALL

Typedefs

typedef signed char S8
 Compiler independent Signed Char.
typedef unsigned char U8
 Compiler independent Unsigned Char.
typedef signed short S16
 Compiler independent Signed 16-bit short.
typedef unsigned short U16
 Compiler independent Unsigned 16-bit short.
typedef signed int S32
 Compiler independent Signed 32-bit integer.
typedef unsigned int U32
 Compiler independent Unsigned 32-bit integer.
typedef float F32
 Compiler independent 32-bit float.
typedef double F64
 Compiler independent 64-bit float.
typedef char UTF8
 Compiler independent 8 bit Unicode encoded character.
typedef unsigned short UTF16
 Compiler independent 16 bit Unicode encoded character.
typedef unsigned int UTF32
 Compiler independent 32 bit Unicode encoded character.
typedef const char * StringTableEntry

Functions

U32 getNextPow2 (U32 num)
 Returns power of 2 number which is as small as possible but still greater than or equal to input number.
U32 getBinLog2 (U32 num, bool knownPow2=false)
 Return integer log2 of input number (rounding down).
bool isPow2 (const U32 num)
 Determines if the given U32 is some 2^n.
U32 getNextBinLog2 (U32 number)
 Determines the binary logarithm of the next greater power of two of the input number.
U32 getMin (U32 a, U32 b)
 Returns the lesser of the two parameters: a & b.
U16 getMin (U16 a, U16 b)
 Returns the lesser of the two parameters: a & b.
U8 getMin (U8 a, U8 b)
 Returns the lesser of the two parameters: a & b.
S32 getMin (S32 a, S32 b)
 Returns the lesser of the two parameters: a & b.
S16 getMin (S16 a, S16 b)
 Returns the lesser of the two parameters: a & b.
S8 getMin (S8 a, S8 b)
 Returns the lesser of the two parameters: a & b.
float getMin (float a, float b)
 Returns the lesser of the two parameters: a & b.
double getMin (double a, double b)
 Returns the lesser of the two parameters: a & b.
U32 getMax (U32 a, U32 b)
 Returns the greater of the two parameters: a & b.
U16 getMax (U16 a, U16 b)
 Returns the greater of the two parameters: a & b.
U8 getMax (U8 a, U8 b)
 Returns the greater of the two parameters: a & b.
S32 getMax (S32 a, S32 b)
 Returns the greater of the two parameters: a & b.
S16 getMax (S16 a, S16 b)
 Returns the greater of the two parameters: a & b.
S8 getMax (S8 a, S8 b)
 Returns the greater of the two parameters: a & b.
float getMax (float a, float b)
 Returns the greater of the two parameters: a & b.
double getMax (double a, double b)
 Returns the greater of the two parameters: a & b.

Variables

static const F32 Float_One = F32(1.0)
 Constant float 1.0.
static const F32 Float_Half = F32(0.5)
 Constant float 0.5.
static const F32 Float_Zero = F32(0.0)
 Constant float 0.0.
static const F32 Float_Pi = F32(3.14159265358979323846)
 Constant float PI.
static const F32 Float_2Pi = F32(2.0 * 3.14159265358979323846)
 Constant float 2*PI.
static const F32 Float_InversePi = F32(1.0 / 3.14159265358979323846)
 Constant float 1 / PI.
static const F32 Float_HalfPi = F32(0.5 * 3.14159265358979323846)
 Constant float 1/2 * PI.
static const F32 Float_2InversePi = F32(2.0 / 3.14159265358979323846)
 Constant float 2 / PI.
static const F32 Float_Inverse2Pi = F32(0.5 / 3.14159265358979323846)
 Constant float 0.5 / PI.
static const F32 Float_Sqrt2 = F32(1.41421356237309504880f)
 Constant float sqrt(2).
static const F32 Float_SqrtHalf = F32(0.7071067811865475244008443f)
 Constant float sqrt(0.5).
static const S8 S8_MIN = S8(-128)
 Constant Min Limit S8.
static const S8 S8_MAX = S8(127)
 Constant Max Limit S8.
static const U8 U8_MAX = U8(255)
 Constant Max Limit U8.
static const S16 S16_MIN = S16(-32768)
 Constant Min Limit S16.
static const S16 S16_MAX = S16(32767)
 Constant Max Limit S16.
static const U16 U16_MAX = U16(65535)
 Constant Max Limit U16.
static const S32 S32_MIN = S32(-2147483647 - 1)
 Constant Min Limit S32.
static const S32 S32_MAX = S32(2147483647)
 Constant Max Limit S32.
static const U32 U32_MAX = U32(0xffffffff)
 Constant Max Limit U32.
static const F32 F32_MIN = F32(1.175494351e-38F)
 Constant Min Limit F32.
static const F32 F32_MAX = F32(3.402823466e+38F)
 Constant Max Limit F32.


Define Documentation

#define TORQUE_UNUSED ( var   )     (void)var

#define __EQUAL_CONST_F   F32(0.000001)

Constant float epsilon used for F32 comparisons.

#define _Offset_Normal ( x,
cls   )     ((dsize_t)((const char *)&(((cls *)1)->x)-(const char *)1))

#define _Offset_Variant_1 ( x,
cls   )     ((int)(&((cls *)1)->x) - 1)

#define _Offset_Variant_2 ( x,
cls   )     offsetof(cls, x)

#define TORQUE_ENABLE_ASSERTS

#define makeFourCCTag ( ch0,
ch1,
ch2,
ch3   ) 

Value:

(((U32(ch0) & 0xFF) << 0)  |             \
    ((U32(ch1) & 0xFF) << 8)  |             \
    ((U32(ch2) & 0xFF) << 16) |             \
    ((U32(ch3) & 0xFF) << 24) )

#define makeFourCCString ( ch0,
ch1,
ch2,
ch3   )     { ch0, ch1, ch2, ch3 }

#define BIT ( x   )     (1 << (x))

Returns value with bit x set (2^x).

#define STDCALL


Typedef Documentation

typedef signed char S8

Compiler independent Signed Char.

typedef unsigned char U8

Compiler independent Unsigned Char.

typedef signed short S16

Compiler independent Signed 16-bit short.

typedef unsigned short U16

Compiler independent Unsigned 16-bit short.

typedef signed int S32

Compiler independent Signed 32-bit integer.

typedef unsigned int U32

Compiler independent Unsigned 32-bit integer.

typedef float F32

Compiler independent 32-bit float.

typedef double F64

Compiler independent 64-bit float.

typedef char UTF8

Compiler independent 8 bit Unicode encoded character.

typedef unsigned short UTF16

Compiler independent 16 bit Unicode encoded character.

typedef unsigned int UTF32

Compiler independent 32 bit Unicode encoded character.

typedef const char* StringTableEntry


Function Documentation

U32 getNextPow2 ( U32  num  )  [inline]

Returns power of 2 number which is as small as possible but still greater than or equal to input number.

Note: returns 0 for an input of 0 even though that is not a power of 2.

Parameters:
num Any U32

U32 getBinLog2 ( U32  num,
bool  knownPow2 = false 
) [inline]

Return integer log2 of input number (rounding down).

So, e.g., getBinLog2(7) == 2 whereas getBinLog2(8) == 3. If known

Parameters:
num Any U32
knownPow2 Is num a known power of 2?

bool isPow2 ( const U32  num  )  [inline]

Determines if the given U32 is some 2^n.

Parameters:
num Any U32
Returns:
true if in_num is a power of two, otherwise false

U32 getNextBinLog2 ( U32  number  )  [inline]

Determines the binary logarithm of the next greater power of two of the input number.

U32 getMin ( U32  a,
U32  b 
) [inline]

Returns the lesser of the two parameters: a & b.

U16 getMin ( U16  a,
U16  b 
) [inline]

Returns the lesser of the two parameters: a & b.

U8 getMin ( U8  a,
U8  b 
) [inline]

Returns the lesser of the two parameters: a & b.

S32 getMin ( S32  a,
S32  b 
) [inline]

Returns the lesser of the two parameters: a & b.

S16 getMin ( S16  a,
S16  b 
) [inline]

Returns the lesser of the two parameters: a & b.

S8 getMin ( S8  a,
S8  b 
) [inline]

Returns the lesser of the two parameters: a & b.

float getMin ( float  a,
float  b 
) [inline]

Returns the lesser of the two parameters: a & b.

double getMin ( double  a,
double  b 
) [inline]

Returns the lesser of the two parameters: a & b.

U32 getMax ( U32  a,
U32  b 
) [inline]

Returns the greater of the two parameters: a & b.

U16 getMax ( U16  a,
U16  b 
) [inline]

Returns the greater of the two parameters: a & b.

U8 getMax ( U8  a,
U8  b 
) [inline]

Returns the greater of the two parameters: a & b.

S32 getMax ( S32  a,
S32  b 
) [inline]

Returns the greater of the two parameters: a & b.

S16 getMax ( S16  a,
S16  b 
) [inline]

Returns the greater of the two parameters: a & b.

S8 getMax ( S8  a,
S8  b 
) [inline]

Returns the greater of the two parameters: a & b.

float getMax ( float  a,
float  b 
) [inline]

Returns the greater of the two parameters: a & b.

double getMax ( double  a,
double  b 
) [inline]

Returns the greater of the two parameters: a & b.


Variable Documentation

const F32 Float_One = F32(1.0) [static]

Constant float 1.0.

const F32 Float_Half = F32(0.5) [static]

Constant float 0.5.

const F32 Float_Zero = F32(0.0) [static]

Constant float 0.0.

const F32 Float_Pi = F32(3.14159265358979323846) [static]

Constant float PI.

const F32 Float_2Pi = F32(2.0 * 3.14159265358979323846) [static]

Constant float 2*PI.

const F32 Float_InversePi = F32(1.0 / 3.14159265358979323846) [static]

Constant float 1 / PI.

const F32 Float_HalfPi = F32(0.5 * 3.14159265358979323846) [static]

Constant float 1/2 * PI.

const F32 Float_2InversePi = F32(2.0 / 3.14159265358979323846) [static]

Constant float 2 / PI.

const F32 Float_Inverse2Pi = F32(0.5 / 3.14159265358979323846) [static]

Constant float 0.5 / PI.

const F32 Float_Sqrt2 = F32(1.41421356237309504880f) [static]

Constant float sqrt(2).

const F32 Float_SqrtHalf = F32(0.7071067811865475244008443f) [static]

Constant float sqrt(0.5).

const S8 S8_MIN = S8(-128) [static]

Constant Min Limit S8.

const S8 S8_MAX = S8(127) [static]

Constant Max Limit S8.

const U8 U8_MAX = U8(255) [static]

Constant Max Limit U8.

const S16 S16_MIN = S16(-32768) [static]

Constant Min Limit S16.

const S16 S16_MAX = S16(32767) [static]

Constant Max Limit S16.

const U16 U16_MAX = U16(65535) [static]

Constant Max Limit U16.

const S32 S32_MIN = S32(-2147483647 - 1) [static]

Constant Min Limit S32.

const S32 S32_MAX = S32(2147483647) [static]

Constant Max Limit S32.

const U32 U32_MAX = U32(0xffffffff) [static]

Constant Max Limit U32.

const F32 F32_MIN = F32(1.175494351e-38F) [static]

Constant Min Limit F32.

const F32 F32_MAX = F32(3.402823466e+38F) [static]

Constant Max Limit F32.