view oldchsool/pwpdemo.h @ 71:a87eb778f225

Improvements to the MinGW crossbuild. Should now build with default tools from Debian mingw packages, though you need Win32 version of libSDL with the necessary headers and so on in addition. 64-bit builds not tested and probably won't work. Tested on Debian 7.0, earlier won't work. binutils-mingw-w64-i686 gcc-mingw-w64-i686 mingw-w64-i686-dev
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 14 Aug 2012 03:08:10 +0300
parents acb5694e93d9
children 475342949dcd
line wrap: on
line source

#include "pwplib.h"
#define USE_SINTAB

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))

#ifndef USE_SINTAB
#define SIN(a) (sin((a)*3.1415926/128)*32767)
#define COS(a) ((3.1415926/2)+(cos((a)*3.1415926/128))*32767)
#else
#ifndef HAS_SINTAB
extern signed int sintab16[];
#endif
#define SIN(a) sintab16[(a)&255]
#define COS(a) sintab16[((a)+64)&255]
#endif