Mercurial > hg > Members > kono > tree_dandy2
changeset 3:c95b185b4c33 open-gl
minor fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 07 Dec 2010 16:16:42 +0900 |
parents | 6d7a880b02ef |
children | 84082ad11ef1 |
files | Makefile Makefile.mac atari.h sankaku.c sankaku.h syokika.c |
diffstat | 6 files changed, 6 insertions(+), 63 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile Tue Dec 07 16:04:59 2010 +0900 +++ b/Makefile Tue Dec 07 16:16:42 2010 +0900 @@ -7,7 +7,7 @@ CFLAGS = -g $(ABI) -O2 -Wall `sdl-config --cflags` `xml2-config --cflags` LIBS = `sdl-config --libs`,-framework,OpenGL -lSDL_mixer -lSDL_image `xml2-config --libs` TARGET = demo -OBJS = sankaku.o sgoex.o Character.o Bom.o tokuten.o collision.o count2.o Character_state.o schedule3.o tama2.o syokika.o Ss.o sound.o main.o profile.o debug.o trace.o LoadSprite.o xml.o b64_de.o tree_controll.o object.o sys.o #back.o +OBJS = sgoex.o Character.o Bom.o tokuten.o collision.o count2.o Character_state.o schedule3.o tama2.o syokika.o Ss.o sound.o main.o profile.o debug.o trace.o LoadSprite.o xml.o b64_de.o tree_controll.o object.o sys.o all: $(TARGET)
--- a/Makefile.mac Tue Dec 07 16:04:59 2010 +0900 +++ b/Makefile.mac Tue Dec 07 16:16:42 2010 +0900 @@ -6,7 +6,7 @@ CFLAGS = -g -m32 -O2 -Wall `sdl-config --cflags` LIBS = `sdl-config --libs`,-framework,OpenGL -lSDL_mixer TARGET = my_dandy -OBJS = sankaku.o sgoex.o Enemy.o bom.o tokuten.o atari.o count2.o move.o schedule.o tama.o syokika.o Ss.o sound.o main.o profile.o debug.o trace.o LoadSprite.o #back.o +OBJS = sgoex.o Enemy.o bom.o tokuten.o atari.o count2.o move.o schedule.o tama.o syokika.o Ss.o sound.o main.o profile.o debug.o trace.o LoadSprite.o #back.o all: $(TARGET)
--- a/atari.h Tue Dec 07 16:04:59 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -#include "Enemy.h" -#ifndef _ATARI_H_ -#define _ATARI_H_ - - -extern int atari(int playerno, int enemyno); - -extern teki enemy[300]; - - - -#endif //_BOM_H_
--- a/sankaku.c Tue Dec 07 16:04:59 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -#include <math.h> -#include "sankaku.h" - -#define SANKAKU 100000 - -int mysin[181]; -int mycos[181]; - -void sankakuf() -{ - int i; - for (i = 0; i < 181; i++) { - mysin[i] = sin(i / 360.0 * pi2) * SANKAKU; - } - for (i = 0; i < 181; i++) { - mycos[i] = cos(i / 360.0 * pi2) * SANKAKU; - } -} - -int Mycos(int c) -{ - c %= 360; - if (c < 0) - c += 360; - if ((c <= 180)) - return (mycos[c]); - if (c > 180) - return (mycos[180 - (c - 180)]); - return (0); -} - -int Mysin(int c) -{ - c %= 360; - if (c < 0) - c += 360; - if (c <= 180) - return (mysin[c]); - if (c > 180) - return (mysin[180 - (c - 180)] * -1); - return (0); -}
--- a/sankaku.h Tue Dec 07 16:04:59 2010 +0900 +++ b/sankaku.h Tue Dec 07 16:16:42 2010 +0900 @@ -1,11 +1,8 @@ #include <math.h> -#define SANKAKU 100000 -int mysin[181]; -int mycos[181]; +#define SANKAKU (100000.0) static const double pi2 = M_PI * 2.0; -extern void sankakuf(); -extern int Mycos(int c); -extern int Mysin(int c); +static inline float Mycos(float c) { return cosf( c / 360.0 * pi2 ) * SANKAKU; } +static inline float Mysin(float c) { return sinf( c / 360.0 * pi2 ) * SANKAKU; }