annotate Magoroku.cc @ 138:993d5f7e5f30

collision malloc error after face reading
author e085768
date Fri, 22 Jul 2011 23:51:14 +0900
parents 89231546bae6
children c920a164d68a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
113
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
1 //magoroku 関係ココから
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 #include "Magoroku.h"
113
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
3
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 #include <stdio.h>
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
5 #include "game.h"
113
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
6 #include "libps2.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
7 #include "ps2util.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
8
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
9 #include "sjoy.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
10 //magoroku 関係ココまで
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
11
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 #include <ctype.h>
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 #include <math.h>
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 #include <time.h>
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 #include <SDL.h>
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 #include "SDL_opengl.h"
112
5106d8d12ded Changing Magoroku.cc
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 111
diff changeset
17
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 #include "xml.h"
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 #include "profile.h"
113
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
20 //#include "syokika.h"
112
5106d8d12ded Changing Magoroku.cc
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 111
diff changeset
21
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 #include "sound.h"
128
d9e3137e70a0 xml name change
e085768
parents: 122
diff changeset
23
d9e3137e70a0 xml name change
e085768
parents: 122
diff changeset
24 // LoadSprite.hってなんだろ??
d9e3137e70a0 xml name change
e085768
parents: 122
diff changeset
25 //#include "LoadSprite.h"
d9e3137e70a0 xml name change
e085768
parents: 122
diff changeset
26
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 #include <SDL_mixer.h>
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 #include "error.h"
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 #include "matrix_calc.h"
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
31 #include "Light.h"
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33
113
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
34 extern bool padCheck(SDL_Joystick *joy);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
35 extern bool keybord(void);
117
9e4100c5d7ec keybord input
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 116
diff changeset
36
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 /**
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 * runmode:
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 * 0 - normal game
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 * 1 - capture mode
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 * program will capture all pad traces on a play and
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 * dump it into a file
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 * 2 - trace mode
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 * program will run with a trace file which is generated
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 * by capture-mode
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 */
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 int runmode;
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
49
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 SDL_Joystick *joy;
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 const char *usr_help_str = "Usage: ./twice [-length data_length] [-count task_num]\n\
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 -length Number of data (default DATA_NUM (Func.h))\n\
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 -count Number of task (default 1)\n";
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
55
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 Viewer *droot;
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 static int screen_w;
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 static int screen_h;
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
60
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 //ウィンドウのサイズとかを指定?
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 MainLoopPtr
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 Magoroku::init(Viewer *sgroot_, int w, int h)
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 {
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
65 screen_w = w;
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
66 screen_h = h;
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
67 droot = sgroot_;
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
68 return droot;
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 }
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
70
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
71 Application *application() {
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
72 return new Magoroku();
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 }
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
74
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
75
113
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
76 //Magoroku の初期化など
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
77 /* timer */
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
78 //static int start_time,time_count;
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
79 //static int RUNNIG=0;
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
80 //char raptime[10];
113
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
81
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
82 //static int ranking = 0;
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
83 //static LIGHT l;
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
84 //static int i=0;
113
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
85 // schedule.ccで使用してる
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
86 void linda_env_init( void );
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
87
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 extern int init(TaskManager *manager, int argc, char *argv[]);
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 extern void task_initialize();
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 static void TMend(TaskManager *manager);
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
91
113
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
92
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 //class Application の中の virtual bool app_loop( return 1 だけの関数?) を継承
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 bool
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 Magoroku::app_loop(Viewer *viewer){
128
d9e3137e70a0 xml name change
e085768
parents: 122
diff changeset
96 // don't use allExecute
d9e3137e70a0 xml name change
e085768
parents: 122
diff changeset
97 return 0;
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 };
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
99
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
100
112
5106d8d12ded Changing Magoroku.cc
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 111
diff changeset
101 /*
5106d8d12ded Changing Magoroku.cc
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 111
diff changeset
102 ゲームの分岐。magoroku の schedule の処理と同等と考えてオッケーかな?
5106d8d12ded Changing Magoroku.cc
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 111
diff changeset
103 */
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
104 HTaskPtr
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
105 Magoroku::application_task(HTaskPtr next, Viewer* viewer){
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
106
119
f2e2460b4011 draw_title
e085768
parents: 117
diff changeset
107 // magoroku_racing
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
108 game_main();
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
109
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
110 return next;
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 };
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
112
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
113
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 static void
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 task_init()
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
116 {
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
117 printf("task_init\n");
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 }
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
119
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
120 FILE *main_fp;
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
121
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
122 int
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 TMmain(TaskManager *manager,int argc, char *argv[])
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
124 {
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
125 main_fp = fopen("/dev/stdout", "w");
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
126 if (!main_fp) {
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
127 perror("main");
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
128 }
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
129
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
130 printf("trace_TMmain\n");
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
131
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
132 for(int i = 1; i<argc ; i++) {
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
133 if (strcmp(argv[i],"-t")) {
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
134 if (i+1<argc && argv[i+1]) {
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
135 i++;
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
136 }
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
137 }
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
138 }
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
139 task_init();
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
140 task_initialize();
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
141 manager->set_TMend(TMend);
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
142
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
143 // magoroku_racing の main.ccから
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
144 //game_main();
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
145
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
146 return init(manager,argc, argv);
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
147 }
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
148
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
149 void
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
150 TMend(TaskManager *manager)
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
151 {
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
152 printf("game end\n");
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
153 }
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
154
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
155 //static int light_sysswitch = 0;
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
156 //static int light_num = 4;
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
157
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 129
diff changeset
158
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 129
diff changeset
159
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
160 static int light_sysswitch = 0;
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
161 static int light_num = 4;
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
162
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
163 // ceriumuで同じ変数名があるから _2 って付け足しました
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
164 static void
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
165 LightSysSwitch_2(Viewer *sgroot) {
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
166 if (light_sysswitch == 1) {
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
167 sgroot->OnLightSysSwitch();
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
168 for (int i = 0; i < light_num; i++) {
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
169 SceneGraphPtr light = sgroot->getLight(i);
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
170 sgroot->OnLightSwitch(i);
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
171 light->xyz[0] = screen_w / 2;
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
172 light->xyz[1] = screen_h / 2;
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
173 light->xyz[2] = -100;
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
174 }
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
175 } else if (light_sysswitch == 0) {
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
176 sgroot->OffLightSysSwitch();
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
177 }
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
178 }