gba-x3dtest

diff src/fixed.h @ 7:158d23956801

started adding rendering pipeline stuff
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 18 Jun 2014 06:20:07 +0300
parents 78d1664c2443
children fb0a0d6a8b52
line diff
     1.1 --- a/src/fixed.h	Wed Jun 18 04:13:02 2014 +0300
     1.2 +++ b/src/fixed.h	Wed Jun 18 06:20:07 2014 +0300
     1.3 @@ -3,6 +3,12 @@
     1.4  
     1.5  #include <stdint.h>
     1.6  
     1.7 +#define ftox16(x)		(int32_t)((x) * 65536.0f)
     1.8 +#define itox16(x)		(int32_t)((x) << 16)
     1.9 +
    1.10 +#define x16tof(x)		(float)((x) / 65536.0f)
    1.11 +#define x16toi(x)		((x) >> 16)
    1.12 +
    1.13  #define x16mul(a, b)	(int32_t)(((int32_t)(a) >> 8) * ((int32_t)(b) >> 8))
    1.14  /*int32_t x16div(register int32_t num, register int32_t denom);*/
    1.15