Defines | |
#define | oneSInt16Frac (1 << 14) |
#define | halfSInt16Frac (1 << 13) |
#define | CP_Fixed2SInt16Frac(x) ((x) + 2 >> 2) |
#define | ff(x) ((CP_Fixed)(x) << 16) |
#define | INT_TO_FIXED(i) ((i) << 16) |
#define | FIXED_TO_INT(f) ((f) >> 16) |
#define | FIXED_TO_FLOAT(f) (((double) (f)) * 1.52587890625e-5) |
#define | FLOAT_TO_FIXED(f) ((CP_Fixed) ((f) * 65536.0)) |
#define | FIXED_ABS(f) ((f) < 0 ? -(f) : (f)) |
#define | FIXED_TRUNC(f) ((f) & 0xffff0000) |
#define | FIXED_SIGN(f) ((unsigned int) (f) >> 31) |
#define | FIXED_PRODUCT_SIGN(f, g) ((unsigned int) ((f) ^ (g)) >> 31) |
#define | FIXED_HALF(f) ((f) / 2) |
#define | FIXED_DOUBLE(f) ((f) << 1) |
#define | FIXED_SCALE(f, i) ((f) * (i)) |
#define | FIXED_ZERO (INT_TO_FIXED(0)) |
#define | FIXED_ONE (INT_TO_FIXED(1)) |
#define | FIXED_ONE_HALF (FIXED_HALF(FIXED_ONE)) |
#define | FIXED_PI (FLOAT_TO_FIXED(3.1415926536)) |
#define | FIXED_2PI (FLOAT_TO_FIXED(6.2831853072)) |
#define | FIXED_HALF_PI (FLOAT_TO_FIXED(1.5707963268)) |
#define | FIXED_MIN LONG_MIN |
#define | FIXED_MAX LONG_MAX |
#define | CP_FixMul(a, b) ((CP_Fixed) ((double) (a) * ((double) (b)) * 1.52587890625e-5)) |
#define | CP_FixMul2_30(a, b) ((CP_Fixed) ((double) (a) * ((double) (b) * 9.313225746154785e-10))) |
#define | CP_FixDiv(a, b) ((CP_Fixed) (((double) (a) / (double) (b)) * 65536.0)) |
Typedefs | |
typedef SInt32 | CP_Fixed |
Functions | |
CP_Fixed | CP_FixRatio (SInt16 inNum, SInt16 inDenom) |
SInt16 | CP_FixRound (CP_Fixed inFixed) |
Variables | |
CPLAT_Begin_Namespace_CPLAT typedef SInt16 | LongFrac |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns a CP_Fixed number that is the ratio of the passed in numerator and demonator.
|
|
Returns a rounded number from passed in fixed number.
|
|
|