41 #ifndef __ARTKPFIXEDBASE_GPP_HEADERFILE__ 42 #define __ARTKPFIXEDBASE_GPP_HEADERFILE__ 47 #pragma comment( lib, "gpp_WMMX40_d.lib" ) 49 #pragma comment( lib, "gpp_WMMX40_r.lib" ) 64 return nFixed/(float)(1 <<
PBITS);
69 return nFixed/(double)(1 <<
PBITS);
79 return (
int)(nV * (float)(1 <<
PBITS) + 0.5f);
84 return (
int)(nV * (double)(1 <<
PBITS) + 0.5f);
90 gppInvHP_n_32s(nFixed, &ret,
PBITS);
94 static int multiply(
int nLeftFixed,
int nRightFixed)
97 gppMul_n_32s(nLeftFixed, nRightFixed, &ret,
PBITS);
101 static int divide(
int nLeftFixed,
int nRightFixed)
104 gppDiv_n_32s(nLeftFixed, nRightFixed, &ret,
PBITS);
108 static int cos(
int nFixed)
111 gppCosHP_n_32s(nFixed, &ret,
PBITS);
115 static int sin(
int nFixed)
118 gppSinHP_n_32s(nFixed, &ret,
PBITS);
124 return nFixed<0 ? -nFixed : nFixed;
130 gppSqrtHP_n_32s(nFixed, &ret,
PBITS);
137 gppInvSqrtHP_n_32s(nFixed, &ret,
PBITS);
145 if(nFixed>=0 && ret<nFixed)
153 #endif //__ARTKPFIXEDBASE_GPP_HEADERFILE__ static int fabs(int nFixed)
static double doubleFromFixed(int nFixed)
static int inverseSqrt(int nFixed)
static int fixedFromInt(int nV)
static int fixedFromDouble(double nV)
static float floatFromFixed(int nFixed)
static int multiply(int nLeftFixed, int nRightFixed)
static int sin(int nFixed)
static int ceil(int nFixed)
static int fixedFromFloat(float nV)
static int inverse(int nFixed)
static int cos(int nFixed)
static int sqrt(int nFixed)
static int divide(int nLeftFixed, int nRightFixed)