annotate schedule.cc @ 133:e7caa277d7e8

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