annotate Magoroku.cc @ 119:f2e2460b4011

draw_title
author e085768
date Sun, 19 Jun 2011 02:16:20 +0900
parents 9e4100c5d7ec
children 5219bf3d5e71
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"
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 #include "LoadSprite.h"
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 #include <SDL_mixer.h>
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 #include "error.h"
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 #include "matrix_calc.h"
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
28 #include "Light.h"
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31
113
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
32 extern bool padCheck(SDL_Joystick *joy);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
33 extern bool keybord(void);
117
9e4100c5d7ec keybord input
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 116
diff changeset
34
9e4100c5d7ec keybord input
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 116
diff changeset
35
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 /**
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 * runmode:
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 * 0 - normal game
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 * 1 - capture mode
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 * 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
41 * dump it into a file
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 * 2 - trace mode
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 * 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
44 * by capture-mode
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 */
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 int runmode;
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 SDL_Joystick *joy;
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 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
51 -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
52 -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
53
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 Viewer *droot;
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 static int screen_w;
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 static int screen_h;
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
58
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 //ウィンドウのサイズとかを指定?
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 MainLoopPtr
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 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
62 {
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
63 screen_w = w;
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
64 screen_h = h;
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
65 droot = sgroot_;
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
66 return droot;
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 }
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
68
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
69 Application *application() {
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
70 return new Magoroku();
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 }
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
72
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
73
113
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
74 //Magoroku の初期化など
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
75 /* timer */
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
76 //static int start_time,time_count;
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
77 //static int RUNNIG=0;
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
78 //char raptime[10];
113
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
79
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
80 //static int ranking = 0;
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
81 //static LIGHT l;
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
82 //static int i=0;
113
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
83 // schedule.ccで使用してる
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
84 void linda_env_init( void );
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
85
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
86
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 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
88 extern void task_initialize();
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 static void TMend(TaskManager *manager);
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
90
113
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
91
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 //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
93 bool
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 Magoroku::app_loop(Viewer *viewer){
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 // don't use allExecute
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
96 return 0;
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
97 };
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
112
5106d8d12ded Changing Magoroku.cc
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 111
diff changeset
100 /*
5106d8d12ded Changing Magoroku.cc
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 111
diff changeset
101 ゲームの分岐。magoroku の schedule の処理と同等と考えてオッケーかな?
5106d8d12ded Changing Magoroku.cc
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 111
diff changeset
102 */
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
103 HTaskPtr
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
104 Magoroku::application_task(HTaskPtr next, Viewer* viewer){
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
105
119
f2e2460b4011 draw_title
e085768
parents: 117
diff changeset
106 // magoroku_racing
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
107 game_main();
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
108
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
109 /*
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
110 // Dandy
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
111 printf("gamef = %d\n",gamef);
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
112 switch (gamef) {
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
113 case 0: gamef= magoroku_main_init(gamef); break;
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
114 case 1: gamef= gamesyokika(gamef); break;
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
115 case 2: gamef= opening(gamef); break;
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
116 case 3: gamef= magoroku_main_loop(gamef); break;
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
117 case 4: gamef= magoroku_closing(gamef); break;
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
118 }
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
119 */
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
120 return next;
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
121 };
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
122
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
123
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
124 static void
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
125 task_init()
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 {
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
127 printf("task_init\n");
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
128 }
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
129
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
130 FILE *main_fp;
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
131
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
132 int
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
133 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
134 {
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
135 main_fp = fopen("/dev/stdout", "w");
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
136 if (!main_fp) {
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
137 perror("main");
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
138 }
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
139
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
140 printf("trace_TMmain\n");
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
141
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
142 for(int i = 1; i<argc ; i++) {
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
143 if (strcmp(argv[i],"-t")) {
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
144 if (i+1<argc && argv[i+1]) {
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
145 i++;
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
146 }
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
147 }
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
148 }
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
149 task_init();
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
150 task_initialize();
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
151 manager->set_TMend(TMend);
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
152
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
153 // magoroku_racing の main.ccから
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
154 //game_main();
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
155
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
156 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
157 }
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
158
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
159 void
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
160 TMend(TaskManager *manager)
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
161 {
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
162 printf("game end\n");
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
163 }
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
164
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
165 //static int light_sysswitch = 0;
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
166 //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
167
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 113
diff changeset
168
119
f2e2460b4011 draw_title
e085768
parents: 117
diff changeset
169
f2e2460b4011 draw_title
e085768
parents: 117
diff changeset
170 static int light_sysswitch = 0;
f2e2460b4011 draw_title
e085768
parents: 117
diff changeset
171 static int light_num = 4;
f2e2460b4011 draw_title
e085768
parents: 117
diff changeset
172
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
173 // ceriumuで同じ変数名があるから _2 って付け足しました
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
174 static void
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
175 LightSysSwitch_2(Viewer *sgroot) {
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
176 if (light_sysswitch == 1) {
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
177 sgroot->OnLightSysSwitch();
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
178 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
179 SceneGraphPtr light = sgroot->getLight(i);
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
180 sgroot->OnLightSwitch(i);
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
181 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
182 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
183 light->xyz[2] = -100;
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
184 }
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
185 } else if (light_sysswitch == 0) {
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
186 sgroot->OffLightSysSwitch();
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
187 }
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
188 }
119
f2e2460b4011 draw_title
e085768
parents: 117
diff changeset
189