annotate schedule.cc @ 134:42337585fb7c

fix merge
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 22 Jul 2011 18:32:39 +0900
parents 4f50f5a3b363
children 993d5f7e5f30
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
1 /* schedule.c */
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
2 #include <stdio.h>
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
3 #include <stdlib.h>
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
4 #include <string.h>
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
5 #include <stdbool.h>
91
cb6c6de125dc halfway
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 90
diff changeset
6 #include "libps2.h"
cb6c6de125dc halfway
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 90
diff changeset
7 #include "ps2util.h"
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
8 #include "field.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
9 #include "car.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
10 #include "gSprite.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
11 #include "gFont.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
12 #include "game.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
13 #include "controler.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
14 #include "camera.h"
91
cb6c6de125dc halfway
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 90
diff changeset
15 #include "carNode.h"
110
8a525ec378fc bool.h change stdbool.h
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 100
diff changeset
16 #include "car.h"
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
17 #include "light.h"
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
18 #include "title_scene.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
19 #include "game_time.h"
45
d7520785d8a6 *** empty log message ***
gongo
parents: 44
diff changeset
20 #include "schedule.h"
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
21 #include "game.h"
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
22
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
23 #include "mytype.h"
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
24 #include "linda.h"
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
25
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
26 #include "sjoy.h"
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
27
122
5219bf3d5e71 title_draw
e085768
parents: 119
diff changeset
28
62
d71fbefaa9a9 *** empty log message ***
gongo
parents: 60
diff changeset
29 #ifdef LINDA
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
30 bool linda_update(int p, Game *game);
62
d71fbefaa9a9 *** empty log message ***
gongo
parents: 60
diff changeset
31 #else
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
32 #define linda_update(change_state, game) true
62
d71fbefaa9a9 *** empty log message ***
gongo
parents: 60
diff changeset
33 #endif
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
34
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
35 #define MAXCAR 4 // 選択可能機体
88
ce9ef7dcf2f0 convert UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
36 #define MAXFIELD 2 // 選択可能コース
ce9ef7dcf2f0 convert UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
37 #define MAXRAP 3 // ラップ数
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
38 #define SP_SEL_CAR 50
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
39 #define SP_SEL_COURSE 80
4
d214fd22ef16 *** empty log message ***
gongo
parents: 3
diff changeset
40
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
41 // controler.cより
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
42 extern SGO_PAD pad;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
43
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
44
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
45 static void set_schedule(Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
46 static void sche_game_init(Game *game);
97
afddacdf30dd compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 96
diff changeset
47 //static void sche_game_wait(Game *game); //プロトタイプも消しといた
afddacdf30dd compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 96
diff changeset
48 //static void sche_game_wait_ready(Game *game);
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
49 static void sche_game_opening(Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
50 static void sche_game_select_car(Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
51 static void sche_game_select_course(Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
52 static void sche_game_ready(Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
53 static void sche_game_main_init(Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
54 static void sche_game_main_ready(Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
55 static void sche_game_main(Game *game);
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
56 static void sche_game_main_pause(Game *game);
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
57 static void sche_game_main_goal(Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
58 static void sche_game_main_finish(Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
59 static void sche_game_main_finish2(Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
60
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
61
20
b1ba4dad7f6e *** empty log message ***
gongo
parents: 19
diff changeset
62 /* timer */
b1ba4dad7f6e *** empty log message ***
gongo
parents: 19
diff changeset
63 static int start_time,time_count;
b1ba4dad7f6e *** empty log message ***
gongo
parents: 19
diff changeset
64 static int RUNNIG=0;
b1ba4dad7f6e *** empty log message ***
gongo
parents: 19
diff changeset
65 char raptime[10];
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
66
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
67 static int ranking = 0;
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
68 static LIGHT l;
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
69 static int i=0;
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
70
100
e5f2eb98b575 change cc
e085768
parents: 99
diff changeset
71 static void (*sche_func_assumption)(Game*);
e5f2eb98b575 change cc
e085768
parents: 99
diff changeset
72 static void (*sche_func)(Game*) = &sche_game_init;
58
1cccf6d964b7 *** empty log message ***
gongo
parents: 55
diff changeset
73 static int change_state = 0;
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
74
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
75 // test
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
76 void testCarControll( Game *game );
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
77
110
8a525ec378fc bool.h change stdbool.h
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 100
diff changeset
78 // schedule.ccで使用してる
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
79 void linda_env_init( void );
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
80
58
1cccf6d964b7 *** empty log message ***
gongo
parents: 55
diff changeset
81 static void
100
e5f2eb98b575 change cc
e085768
parents: 99
diff changeset
82 set_schedule_assumption(void (*_func)(Game*) )
11
41d3037c34c8 *** empty log message ***
gongo
parents: 8
diff changeset
83 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
84 sche_func_assumption = _func;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
85 change_state = 1;
58
1cccf6d964b7 *** empty log message ***
gongo
parents: 55
diff changeset
86 }
1cccf6d964b7 *** empty log message ***
gongo
parents: 55
diff changeset
87
1cccf6d964b7 *** empty log message ***
gongo
parents: 55
diff changeset
88 static void
62
d71fbefaa9a9 *** empty log message ***
gongo
parents: 60
diff changeset
89 unset_schedule()
d71fbefaa9a9 *** empty log message ***
gongo
parents: 60
diff changeset
90 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
91 change_state = 0;
62
d71fbefaa9a9 *** empty log message ***
gongo
parents: 60
diff changeset
92 }
d71fbefaa9a9 *** empty log message ***
gongo
parents: 60
diff changeset
93
d71fbefaa9a9 *** empty log message ***
gongo
parents: 60
diff changeset
94 static void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
95 set_schedule(Game *game)
58
1cccf6d964b7 *** empty log message ***
gongo
parents: 55
diff changeset
96 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
97 sche_func = sche_func_assumption;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
98 change_state = 0;
11
41d3037c34c8 *** empty log message ***
gongo
parents: 8
diff changeset
99 }
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
100
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
101 static void
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
102 graphic_init()
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
103 {
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
104 // flip();
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
105
119
f2e2460b4011 draw_title
e085768
parents: 118
diff changeset
106 printf("graphic_init()\n");
f2e2460b4011 draw_title
e085768
parents: 118
diff changeset
107
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
108 gSprite_Init(); // グラフィック関連の初期化
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
109 gFont_Init(); // フォント関連の初期化
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
110 }
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
111
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
112 static void
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
113 play_init( Game *game )
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
114 {
124
e085768
parents: 122
diff changeset
115 printf("play_init()\n");
122
5219bf3d5e71 title_draw
e085768
parents: 119
diff changeset
116
5219bf3d5e71 title_draw
e085768
parents: 119
diff changeset
117 // ここで、car_idには1か2か3が入らんとダメ
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
118 game->jiki = car_init(game->car_id);
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
119
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
120 // carNode.cc内のcar_listに追加
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
121 carNode_append(game->jiki);
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
122
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
123 field_init(game->course_id);
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
124 }
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
125
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
126 // 適当に自作 :miya
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
127 void linda_env_init( void )
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
128 {
98
1033fece71ce text_vector
e085768
parents: 97
diff changeset
129 printf("linda_env_init\n");
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
130 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
131
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
132 static void game_env_init ( Game *game )
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
133 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
134 game->car_id = 1;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
135 game->course_id = 1;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
136 game->camera_type = 0;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
137 game->rap = 1;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
138 game->jiki = NULL;
117
9e4100c5d7ec keybord input
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 116
diff changeset
139
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
140 ranking = 0;
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
141
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
142 wait_init();
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
143 linda_env_init();
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
144 }
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
145
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
146
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
147 void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
148 sche_game_init(Game *game)
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
149 {
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
150 printf("sche_game_init()\n");
119
f2e2460b4011 draw_title
e085768
parents: 118
diff changeset
151
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
152 game_env_init(game);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
153 graphic_init();
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
154 camera_init();
8
f60cb9a39d7a *** empty log message ***
gongo
parents: 5
diff changeset
155
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
156 FVECTOR cP = { 0, 0, 0, 0 };
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
157 FVECTOR cA = { 0, 0, 0, 0 };
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
158 // FVECTOR cA = { 0, 0, 0, 0 };
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
159
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
160 set_cameraPos( cP, cA );
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
161
46
abadcc080667 *** empty log message ***
gongo
parents: 45
diff changeset
162 #ifdef LINDA
97
afddacdf30dd compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 96
diff changeset
163 //sche_func = &sche_game_wait;
afddacdf30dd compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 96
diff changeset
164 //set_schedule_assumption(sche_game_wait);
46
abadcc080667 *** empty log message ***
gongo
parents: 45
diff changeset
165 #else
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
166 set_schedule_assumption(sche_game_opening);
46
abadcc080667 *** empty log message ***
gongo
parents: 45
diff changeset
167 #endif
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
168 }
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
169
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
170 /**
88
ce9ef7dcf2f0 convert UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
171 * 通信対戦専用
ce9ef7dcf2f0 convert UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
172 * 全ユーザが接続するまで待つ
95
b0249b856488 change_ps2util
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 91
diff changeset
173 * ・・・だったんだけど、現在 linda を切っているため worning が出る。
b0249b856488 change_ps2util
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 91
diff changeset
174 * ので cut する。
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
175 */
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
176
97
afddacdf30dd compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 96
diff changeset
177 /* linda を使用しないのでカットした
124
e085768
parents: 122
diff changeset
178 static void
e085768
parents: 122
diff changeset
179 sche_game_wait(Game *game)
e085768
parents: 122
diff changeset
180 {
e085768
parents: 122
diff changeset
181 gFont_SetString("WAITING...", 200, 100);
e085768
parents: 122
diff changeset
182 set_schedule_assumption(sche_game_wait_ready);
e085768
parents: 122
diff changeset
183 }
97
afddacdf30dd compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 96
diff changeset
184 */
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
185
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
186
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
187 /**
88
ce9ef7dcf2f0 convert UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
188 * 通信対戦専用
ce9ef7dcf2f0 convert UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
189 * 全ユーザの接続を確認したら呼び出す
95
b0249b856488 change_ps2util
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 91
diff changeset
190 * こいつも、linda がないので cut
97
afddacdf30dd compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 96
diff changeset
191 */
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
192 /*
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
193 static void
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
194 sche_game_wait_ready(Game *game)
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
195 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
196 gFont_SetString("CONNECT OK!!", 170, 300);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
197 if (game->play_id == 1) {
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
198 gFont_SetString(" PUSH START ", 170, 400);
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
199 if (pad.st != 1) { goto WAIT_READY; }
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
200 }
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
201
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
202 set_schedule_assumption(sche_game_opening);
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
203
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
204 WAIT_READY:
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
205 return;
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
206 }
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 110
diff changeset
207 */
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
208
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
209
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
210 void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
211 sche_game_opening(Game *game)
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
212 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
213 static int blink_count = 0;
117
9e4100c5d7ec keybord input
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 116
diff changeset
214
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
215 // gSprite_PutSprite( true, TITLE, 600, 100, -00 );
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
216 gSprite_PutSprite( true, TITLE, 285, -300, -600 );
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
217
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
218
117
9e4100c5d7ec keybord input
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 116
diff changeset
219 //ここを現在通らないらしい。
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
220 if (game->play_id==1){
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
221 if (blink_count < 35) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
222 gFont_SetString("PUSH START !!", 170, 380);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
223 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
224 blink_count = (blink_count > 70) ? 0 : blink_count + 1;
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
225
117
9e4100c5d7ec keybord input
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 116
diff changeset
226 printf("pad.st = %d\n",pad.st);
9e4100c5d7ec keybord input
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 116
diff changeset
227 if (pad.st != 1) { goto OPENING; }
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
228 }
117
9e4100c5d7ec keybord input
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 116
diff changeset
229
9e4100c5d7ec keybord input
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 116
diff changeset
230 /*処理をいったんifの外へ。これを見る限り、キー入力自体はokぽい
119
f2e2460b4011 draw_title
e085768
parents: 118
diff changeset
231 printf("pad.st = %d\n",pad.st);
f2e2460b4011 draw_title
e085768
parents: 118
diff changeset
232 if (pad.st != 1) { goto OPENING; }
117
9e4100c5d7ec keybord input
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 116
diff changeset
233 */
9e4100c5d7ec keybord input
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 116
diff changeset
234
119
f2e2460b4011 draw_title
e085768
parents: 118
diff changeset
235
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
236 set_schedule_assumption(sche_game_select_car);
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
237
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
238 OPENING:
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
239 return;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
240
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
241 if (game->play_id == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
242 if (title_scene() < 0){
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
243 }
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
244 } else if (game->play_id == 2) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
245 if (i==0){
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
246 title_init_call();
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
247 i=1;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
248 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
249 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
250
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
251 }
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
252
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
253 void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
254 sche_game_select_car(Game *game)
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
255 {
124
e085768
parents: 122
diff changeset
256 printf("sche_game_select_car()\n");
122
5219bf3d5e71 title_draw
e085768
parents: 119
diff changeset
257
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
258 if (i==1){
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
259 title_finish_call();
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
260 i=2;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
261 }
124
e085768
parents: 122
diff changeset
262
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
263 gSprite_PutSpriteEx(true,SP_SEL_CAR+game->car_id, 600, 200, TEST_Z_GRID,1.5, 1.5, 0.0);
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
264 gSprite_PutSprite(true,R_ARROW, 750, 200, TEST_Z_GRID);
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
265 gSprite_PutSprite(true,L_ARROW, 450, 200, TEST_Z_GRID);
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
266
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
267 gFont_SetString("SELECT CAR", 180, 50);
124
e085768
parents: 122
diff changeset
268
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
269 if (pad.right == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
270 game->car_id =
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
271 (game->car_id > MAXCAR-1) ? 1 : game->car_id + 1;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
272 }
124
e085768
parents: 122
diff changeset
273
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
274 if (pad.left == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
275 game->car_id =
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
276 (game->car_id < 2) ? MAXCAR : game->car_id - 1;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
277 }
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
278
124
e085768
parents: 122
diff changeset
279
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
280 if (game->play_id == 1)
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
281 if (pad.circle != 1) { goto SELECT_CAR; }
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
282
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
283 set_schedule_assumption(sche_game_select_course);
124
e085768
parents: 122
diff changeset
284
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
285 SELECT_CAR:
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
286 return;
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
287 }
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
288
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
289 void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
290 sche_game_select_course(Game *game)
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
291 {
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
292 printf("sche_game_select_course()\n");
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
293 gSprite_PutSpriteEx(true, SP_SEL_COURSE+game->course_id, 600, 200, TEST_Z_GRID ,1.7, 1.8, 0.0);
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
294 gSprite_PutSprite(true, R_ARROW, 750, 200, TEST_Z_GRID);
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
295 gSprite_PutSprite(true, L_ARROW, 450, 200, TEST_Z_GRID);
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
296
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
297 gFont_SetString("SELECT COURSE", 150, 50);
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
298
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
299 if (game->play_id == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
300 if (pad.right == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
301 game->course_id =
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
302 (game->course_id > MAXFIELD-1) ? 1 : game->course_id + 1;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
303 goto SELECT_COURSE;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
304 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
305 if (pad.left == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
306 game->course_id =
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
307 (game->course_id < 2) ? MAXFIELD : game->course_id - 1;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
308 goto SELECT_COURSE;
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
309 }
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
310
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
311 if (pad.circle != 1) { goto SELECT_COURSE; }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
312 }
44
3b71b39411b1 *** empty log message ***
gongo
parents: 43
diff changeset
313
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
314 set_schedule_assumption(sche_game_ready);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
315
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
316 SELECT_COURSE:
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
317 return;
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
318 }
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
319
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
320 void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
321 sche_game_ready(Game *game)
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
322 {
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
323 printf("sche_game_ready()\n");
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
324 static int blink_count = 0;//
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
325
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
326 int tesX = 500;
126
030394675d8e succes compile
e085768
parents: 125
diff changeset
327
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
328 // PLAYER_1 or PLAYER_2 今は通信対戦できないから常にPLAYER_1 ( PLAYER_1 = 28 , PLAYER_2 = 29 )
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
329 gSprite_PutSprite(true, 27+game->play_id, 265 + 50 , 200, TEST_Z_GRID + 400 );
126
030394675d8e succes compile
e085768
parents: 125
diff changeset
330
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
331 gSprite_PutSpriteEx(true, SP_SEL_CAR+game->car_id, 50 + tesX, 120, TEST_Z_GRID - 300, 1.5, 1.5 , 0.0);
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
332 gSprite_PutSpriteEx(true, SP_SEL_COURSE+game->course_id, 340 + tesX, 120, TEST_Z_GRID - 300, 1.7, 1.8 , 0.0);
122
5219bf3d5e71 title_draw
e085768
parents: 119
diff changeset
333
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
334 /* 点滅 */
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
335 if (blink_count < 35) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
336 gFont_SetString("GAME START !!", 170, 380);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
337 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
338 blink_count = (blink_count > 70) ? 0 : blink_count + 1;
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
339
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
340 if (pad.st == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
341 set_schedule_assumption(sche_game_main_init);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
342 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
343 if (pad.cross > 0) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
344 set_schedule_assumption(sche_game_select_car);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
345 }
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
346 }
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
347
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
348 void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
349 sche_game_main_init(Game *game)
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
350 {
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
351 printf("sche_game_main_init()\n");
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
352 if (!game->jiki){
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
353 play_init(game);
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
354 }
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
355
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
356 RUNNIG=0;
52
c875add6256e *** empty log message ***
gongo
parents: 46
diff changeset
357
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
358 set_schedule_assumption(sche_game_main_ready);
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
359
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
360 // とりあえず、トップビューで
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
361 // FVECTOR cPos = { 0, 877, -2000, 0 };
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
362 FVECTOR cPos = { 0, 877, 7500, 0 };
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
363 //FVECTOR cPos = { 0, 300, -7500, 0 };
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
364 FVECTOR cAngle = { 90, 0, 0, 0 };
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
365
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
366 /*
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
367 FVECTOR cPos = { 0, 0, -5000, 0 };
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
368 FVECTOR cAngle = { 0, 0, 0, 0 };
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
369 */
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
370 set_cameraPos( cPos, cAngle );
72
00430c172e5b *** empty log message ***
gongo
parents: 68
diff changeset
371 }
00430c172e5b *** empty log message ***
gongo
parents: 68
diff changeset
372
00430c172e5b *** empty log message ***
gongo
parents: 68
diff changeset
373 static void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
374 sche_game_main_ready(Game *game)
72
00430c172e5b *** empty log message ***
gongo
parents: 68
diff changeset
375 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
376 gFont_SetString("Loading....", 180, 100);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
377 set_schedule_assumption(sche_game_main);
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
378
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
379 }
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
380
72
00430c172e5b *** empty log message ***
gongo
parents: 68
diff changeset
381 static void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
382 sche_game_main(Game *game)
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
383 {
124
e085768
parents: 122
diff changeset
384 printf("sche_game_main()\n");
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
385
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
386 FVECTOR cPos = { game->jiki->location[0],game->jiki->location[1], -game->jiki->location[2] ,0 };
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
387 FVECTOR a={180,0,0,0};
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
388
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
389 /** begin: dispaly RAP TIME **/
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
390 if(RUNNIG==0){
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
391 start_time = game_time_get_msec();
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
392 RUNNIG=1;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
393 }
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
394
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
395 time_count = game_time_get_msec() - start_time;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
396 game_time_set_raptime(raptime,time_count);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
397 gFont_SetString("TIME",300,20);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
398 gFont_SetString(raptime,400,20);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
399 /** end: dispaly RAP TIME **/
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
400
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
401 // light_init と init_lightの書き間違え?
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
402 init_light(&l);
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
403 set_light(&l);
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
404
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
405 //今は何もしていない関数
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
406 car_id_update(game, game->jiki);
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
407
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
408 // 宣言では引数が二つだったから、第一引数に game を入れてみた
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
409 car_update(game, game->jiki);
20
b1ba4dad7f6e *** empty log message ***
gongo
parents: 19
diff changeset
410
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
411 field_update(game->jiki);
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
412
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
413 // 車のDraw関数
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
414 carNode_draw();
118
b6dc70f6aa7e chenge OBJECT->transfer
e085768
parents: 117
diff changeset
415
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
416
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
417 // jikiによってカメラも移動( camera_update()って関数のほう使うからイラんね )
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
418 set_cameraPos( cPos , a );
118
b6dc70f6aa7e chenge OBJECT->transfer
e085768
parents: 117
diff changeset
419
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
420 //camera_update(game, game->jiki->body->transfer);
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
421
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
422
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
423
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
424 gFont_SetStringInt(game->rap, 50, 100);
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
425
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
426 /* スピードメーター */
124
e085768
parents: 122
diff changeset
427 //gSprite_DefSprite(SP_METER, 1, 1,(int)(106.0*(game->jiki->speed/game->jiki->speed_max)), 34);
e085768
parents: 122
diff changeset
428
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
429 //とりあえずコンパイル通すためにコメント。あとで調べましょう
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
430 //gSprite_DefSprite(SP_METER, "name", (float)(106.0*(game->jiki->speed/game->jiki->speed_max)), 34.0, 100);
124
e085768
parents: 122
diff changeset
431
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
432 gSprite_PutSprite(true,SP_METER, 400, 400, TEST_Z_GRID);
124
e085768
parents: 122
diff changeset
433
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
434 /* km/h */
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
435 gSprite_PutSprite(true, KM, 470, 350, TEST_Z_GRID);
124
e085768
parents: 122
diff changeset
436
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
437 /* Rap */
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
438 gSprite_PutSprite(true,RAP, 80, 100, TEST_Z_GRID);
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
439
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
440 if (game->rap > MAXRAP) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
441 ranking = 1;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
442 set_schedule_assumption(sche_game_main_goal);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
443 }
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
444
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
445 gFont_SetStringInt((int)(100.0*game->jiki->speed), 380, 350);
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
446
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
447
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
448 // testCarControll( game );
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
449
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
450
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
451 if ((pad.right > 0) && ((game->jiki->speed != 0) || (pad.circle > 0))) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
452 car_swerve(game->jiki, 1);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
453 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
454 if ((pad.left > 0) && ((game->jiki->speed != 0) || (pad.circle > 0))) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
455 car_swerve(game->jiki, -1);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
456 }
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
457
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
458 // 丸ボタン押したら加速
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
459 if (pad.circle > 0) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
460 car_accelerate(game->jiki, 1);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
461 }
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
462 // バツボタン押したら減速
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
463 if (pad.cross > 0) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
464 car_accelerate(game->jiki, -1);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
465 }
20
b1ba4dad7f6e *** empty log message ***
gongo
parents: 19
diff changeset
466
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
467
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
468 // テスト用関数
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
469 // cameraControl( );
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
470
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
471 if (pad.r1 == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
472 game->camera_type = !game->camera_type;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
473 }
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
474
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
475 // startボタン押したらpause画面へ
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
476 if (pad.st == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
477 set_schedule_assumption(sche_game_main_pause);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
478 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
479
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
480 }
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
481
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
482
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
483 void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
484 sche_game_main_pause(Game *game)
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
485 {
124
e085768
parents: 122
diff changeset
486 printf("sche_game_main_pause\n");
e085768
parents: 122
diff changeset
487
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
488 static int select = 0;
26
4447fd650f60 *** empty log message ***
gongo
parents: 20
diff changeset
489
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
490 field_update(game->jiki);
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
491 carNode_draw();
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
492
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
493 if (game->play_id == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
494 // 選択マーク
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
495 gSprite_PutSprite(true, SELECT, 100 + 250, 190+select*100 + 10, TEST_Z_GRID + 400 );
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
496
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
497 gFont_SetString("BACK TO GAME", 200, 200);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
498 gFont_SetString("GO TO TITLE", 200, 300);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
499 } else {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
500 gFont_SetString("Pause ...", 200, 200);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
501 }
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
502
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
503
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
504 if (pad.circle == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
505 if (select == 0) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
506 set_schedule_assumption(sche_game_main);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
507 } else {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
508 set_schedule_assumption(sche_game_main_finish);
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
509 }
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
510 } else if (pad.st == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
511 set_schedule_assumption(sche_game_main);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
512 } else if (pad.up == 1 || pad.down == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
513 select = !select;
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
514 }
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
515 }
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
516
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
517
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
518 void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
519 sche_game_main_goal(Game *game)
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
520 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
521 /** dispaly TOTAL TIME **/
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
522
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
523 game_time_set_raptime(raptime,time_count);
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
524
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
525 gFont_SetString("TOTAL TIME",150,20);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
526 gFont_SetString(raptime,400,20);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
527 gFont_SetString("GOAL !!", 220, 150);
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
528
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
529 #ifdef LINDA
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
530 if (ranking == 1)
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
531 gFont_SetString("You WIN!!", 200, 250);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
532 else
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
533 gFont_SetString("You Lose...", 200, 250);
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
534 #endif
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
535
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
536
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
537 // 宣言では引数が二つだったから、第一引数に game を入れてみた
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
538 car_update(game, game->jiki);
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
539 //field_update(game->jiki);
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
540 carNode_draw();
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
541
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
542 // ちょっとコメントアウト
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
543 // camera_update( game, (FMATRIX)(game->jiki->body->matrix) );
115
31dd5c07f7c1 class OBJECT:SceanGraph
e085768
parents: 110
diff changeset
544
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
545 if (pad.st == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
546 set_schedule_assumption(sche_game_main_finish);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
547 }
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
548 }
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
549
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
550 void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
551 sche_game_main_finish(Game *game)
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
552 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
553 field_destroy();
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
554 carNode_destroy();
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
555 game_env_init(game);
30
7a348d9ce4ac *** empty log message ***
gongo
parents: 27
diff changeset
556
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
557 set_schedule_assumption(sche_game_main_finish2);
30
7a348d9ce4ac *** empty log message ***
gongo
parents: 27
diff changeset
558 }
7a348d9ce4ac *** empty log message ***
gongo
parents: 27
diff changeset
559
7a348d9ce4ac *** empty log message ***
gongo
parents: 27
diff changeset
560 void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
561 sche_game_main_finish2(Game *game)
30
7a348d9ce4ac *** empty log message ***
gongo
parents: 27
diff changeset
562 {
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
563 gFont_SetString("GAME OVER ...", 200, 200);
117
9e4100c5d7ec keybord input
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 116
diff changeset
564
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
565 if (pad.st == 1) {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
566 set_schedule_assumption(sche_game_opening);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
567 }
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
568
2
b6a1385f19be *** empty log message ***
gongo
parents: 0
diff changeset
569 }
3
38aedf763052 *** empty log message ***
gongo
parents: 2
diff changeset
570
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
571 // 適当に作りました
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
572 void wait_sync(Game *game)
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
573 {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
574 printf("wait_sync\n");
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
575 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
576
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
577 // 適当に
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
578 void swap_dbuff()
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
579 {
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
580 printf("swap_dbuff()\n");
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
581 }
3
38aedf763052 *** empty log message ***
gongo
parents: 2
diff changeset
582
38aedf763052 *** empty log message ***
gongo
parents: 2
diff changeset
583 void
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
584 schedule(Game *game)
3
38aedf763052 *** empty log message ***
gongo
parents: 2
diff changeset
585 {
124
e085768
parents: 122
diff changeset
586 flip();
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
587
116
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
588 printf("----------------------\n");
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
589 printf("schedule()\n");
ed702e49cc6c conpile
e085768
parents: 115
diff changeset
590
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
591 sche_func(game);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
592
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
593 if (linda_update(change_state, game) == true){
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
594 set_schedule(game);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
595 }
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
596 else{
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
597 unset_schedule();
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
598 }
58
1cccf6d964b7 *** empty log message ***
gongo
parents: 55
diff changeset
599
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
600 wait_sync(game);
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
601 swap_dbuff();
128
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
602
d9e3137e70a0 xml name change
e085768
parents: 126
diff changeset
603 // この関数はなんなのかな
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
604 sjoy_poll();
3
38aedf763052 *** empty log message ***
gongo
parents: 2
diff changeset
605
96
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
606 ps2util_sprite_Draw();
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
607 gSprite_Draw_Reset();
0b65ca27f113 compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 95
diff changeset
608 gFont_Draw_Reset();
119
f2e2460b4011 draw_title
e085768
parents: 118
diff changeset
609
f2e2460b4011 draw_title
e085768
parents: 118
diff changeset
610 // ここにgSprite_Init()があるのって良いのかな?
f2e2460b4011 draw_title
e085768
parents: 118
diff changeset
611 // gSprite_Init();
3
38aedf763052 *** empty log message ***
gongo
parents: 2
diff changeset
612 }
130
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
613
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
614 void testCarControll( Game *game )
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
615 {
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
616 FVECTOR xyz;
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
617 FVECTOR angle;
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
618
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
619 for( int i = 0; i < 4; i ++ ){
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
620 xyz[i] = game->jiki->direction[i];
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
621 angle[i] = game->jiki->location[i];
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
622 }
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
623
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
624 float speed = 1.0f;
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
625
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
626 bool esc = false;
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
627
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
628 if( pad.se > 0 ){
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
629 esc = true;
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
630 printf("press selectButton\n");
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
631 }
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
632
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
633 if( pad.l1 > 0 ){
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
634 speed = 10.0f;
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
635 printf("press W_key\n");
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
636 }
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
637
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
638 if( pad.left > 0 ){
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
639 if ( esc == true ) angle[0] -= speed;
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
640 else xyz[0] -= speed;
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
641 }
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
642 if( pad.right > 0 ){
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
643 if ( esc == true ) angle[0] += speed;
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
644 else xyz[0] += speed;
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
645 }
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
646
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
647 if( pad.up > 0 ){
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
648 if ( esc == true ) angle[1] -= speed;
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
649 else xyz[1] -= speed;
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
650 }
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
651 if( pad.down > 0 ){
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
652 if ( esc == true ) angle[1] += speed;
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
653 else xyz[1] += speed;
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
654 }
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
655
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
656 if( pad.circle > 0 ){
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
657 if ( esc == true ) angle[2] += speed;
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
658 else xyz[2] += speed;
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
659 }
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
660 if( pad.cross > 0 ){
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
661 if ( esc == true ) angle[2] -= speed;
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
662 else xyz[2] -= speed;
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
663 }
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
664
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
665 for( int i = 0; i < 3; i ++ ){
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
666 if (angle[i] > 360.0f || angle[i] < -360.0f ) {
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
667 angle[i] = 0.0f;
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
668 }
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
669 }
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
670
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
671
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
672 for( int i = 0; i < 4; i ++ ){
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
673 game->jiki->direction[i] = angle[i];
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
674 game->jiki->location[i] = xyz[i];
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
675 }
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
676
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
677 /*
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
678 for( int i = 0; i < 4; i ++ ){
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
679 printf("cameraPos[%d] = %f ", i, cameraMan_pos[i] );
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
680 }
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
681 printf("\n");
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
682
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
683 for( int i = 0; i < 4; i ++ ){
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
684 printf("cameraAngle[%d] = %f ", i, cameraMan_angle[i] );
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
685 }
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
686 printf("\n");
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
687 */
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
688
4f50f5a3b363 new repository
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 128
diff changeset
689 }