diff --git a/clown3d-DS.elf b/clown3d-DS.elf index 86c92db..9597786 100644 Binary files a/clown3d-DS.elf and b/clown3d-DS.elf differ diff --git a/clown3d-DS.nds b/clown3d-DS.nds index cd3e9c7..878f3ff 100644 Binary files a/clown3d-DS.nds and b/clown3d-DS.nds differ diff --git a/ds-trig.c b/ds-trig.c new file mode 100644 index 0000000..c9a8c3f --- /dev/null +++ b/ds-trig.c @@ -0,0 +1,24 @@ +#ifndef PC_TARGET + +#include + +/* + NDS trigonometry routines. + Copied from sin() and cos() in nehe11.cpp, written by Dovoto. +*/ + +float my_sin(float angle) +{ + int32 s = sinLerp((int)((angle * DEGREES_IN_CIRCLE) / 360.0)); + + return f32tofloat(s); +} + +float my_cos(float angle) +{ + int32 c = cosLerp((int)((angle * DEGREES_IN_CIRCLE) / 360.0)); + + return f32tofloat(c); +} + +#endif \ No newline at end of file diff --git a/main.c b/main.c index 366c975..f361abd 100644 --- a/main.c +++ b/main.c @@ -489,26 +489,3 @@ void runGameFrame(void) gc_collect(); } - -#ifndef PC_TARGET - -/* The following routines were copied from - nehe11.cpp, written by Dovoto, and renamed - from sin, cos to my_sin, my_cos because - it didn't seem to build otherwise */ - -float my_sin(float angle) -{ - int32 s = sinLerp((int)((angle * DEGREES_IN_CIRCLE) / 360.0)); - - return f32tofloat(s); -} - -float my_cos(float angle) -{ - int32 c = cosLerp((int)((angle * DEGREES_IN_CIRCLE) / 360.0)); - - return f32tofloat(c); -} - -#endif