# HG changeset patch # User Shinji KONO # Date 1291706202 -32400 # Node ID c95b185b4c33a35cbeaceef80980ae065b840341 # Parent 6d7a880b02ef64c69e88dd3a786ab94e7b336c39 minor fix diff -r 6d7a880b02ef -r c95b185b4c33 Makefile --- 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) diff -r 6d7a880b02ef -r c95b185b4c33 Makefile.mac --- 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) diff -r 6d7a880b02ef -r c95b185b4c33 atari.h --- 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_ diff -r 6d7a880b02ef -r c95b185b4c33 sankaku.c --- 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 -#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); -} diff -r 6d7a880b02ef -r c95b185b4c33 sankaku.h --- 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 -#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; } diff -r 6d7a880b02ef -r c95b185b4c33 syokika.c --- a/syokika.c Tue Dec 07 16:04:59 2010 +0900 +++ b/syokika.c Tue Dec 07 16:16:42 2010 +0900 @@ -85,7 +85,7 @@ //LoadSprite(); - sankakuf(); + // sankakuf(); font = read_xml_3d_file(FONT_FILE); boss = read_xml_3d_file(BOSS_FILE); chara = read_xml_3d_file(CHARACTER_FILE);