Mercurial > hg > Members > kono > tree_dandy2
annotate Dandy.cc @ 6:6541f0bebb81
cerium redering engine main routine.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 07 Dec 2010 18:11:38 +0900 |
parents | |
children | 972a7f233b23 |
rev | line source |
---|---|
6
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 #include "Dandy.h" |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 const char *usr_help_str = "Usage: ./twice [-length data_length] [-count task_num]\n\ |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 -length Number of data (default DATA_NUM (Func.h))\n\ |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 -count Number of task (default 1)\n"; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 MainLoopPtr |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 Dandy::init(Viewer *sgroot, int w, int h) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 init_charactor(sgroot, w, h); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 init_game(sgroot, w, h); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 return sgroot; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 extern Application * |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 Dandy::application() { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 return new Dandy(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
21 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
22 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23 Viewer *sg_root; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25 static int dandy_closing(int gamef); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26 static int dandy_main_lop(int gamef); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
27 static int dandy_main_init(int gamef); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
28 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
29 extern bool |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 Dandy::app_main(Viewer *viewer){ |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
31 sg_root = viewer; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
32 // don't use allExecute |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
33 return 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
34 }; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
35 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
36 exern HTaskPtr |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
37 Dandy::application_task(HTaskPtr next, Viewer* viewer){ |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
38 int gamef = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
39 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
40 switch (gamef) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
41 case 0: gamef= danday_opening(gamef); break; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
42 case 1: gamef= danday_main_loop(gamef); break; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
43 case 2: gamef= danday_closing(gamef); break; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
44 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
45 return next; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
46 }; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
47 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
48 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
49 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
50 extern int init(TaskManager *manager, int argc, char *argv[]); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
51 extern void task_initialize(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
52 static void TMend(TaskManager *manager); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
53 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
54 static |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
55 task_init() |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
56 { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
57 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
58 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
59 int |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
60 TMmain(TaskManager *manager,int argc, char *argv[]) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
61 { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
62 task_init(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
63 task_initialize(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
64 manager->set_TMend(TMend); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
65 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
66 return init(manager,argc, argv); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
67 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
68 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
69 void |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
70 TMend(TaskManager *manager) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
71 { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
72 printf("game end\n"); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
73 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
74 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
75 extern "C" { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
76 #include <stdio.h> |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
77 #include <stdlib.h> |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
78 #include <string.h> |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
79 #include <ctype.h> |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
80 #include <math.h> |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
81 #include <time.h> |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
82 #include <SDL.h> |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
83 #include "SDL_opengl.h" |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
84 #include "object.h" |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
85 #include "tree_controll.h" |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
86 #include "xml.h" |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
87 #include "profile.h" |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
88 #include "syokika.h" |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
89 #include "sankaku.h" |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
90 #include "sgoex.h" |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
91 #include "sound.h" |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
92 #include "bool.h" |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
93 #include "Character.h" |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
94 #include "Character_state.h" |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
95 #include "bom.h" |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
96 #include "count2.h" |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
97 #include "tokuten.h" |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
98 #include "schedule.h" |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
99 #include "tama.h" |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
100 #include "debug.h" |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
101 #include "trace.h" |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
102 #include "LoadSprite.h" |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
103 #include <SDL_mixer.h> |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
104 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
105 #include "error.h" |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
106 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
107 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
108 int gamef = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
109 int use_keybord = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
110 int cdp[20] = { 16, 16, 16, 17, 18, 0 }; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
111 int d, i; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
112 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
113 int rswait = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
114 int cf = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
115 int cc = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
116 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
117 //static SDL_Surface *screen; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
118 static Uint32 background; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
119 // static char *pad_trace_file; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
120 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
121 extern void schedule(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
122 extern void tokuten(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
123 extern void Pad(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
124 extern void keybord(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
125 //extern void PutSpriteEx(int number, int x, int y, GLfloat scalex, GLfloat scaley, GLfloat angle); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
126 //GLuint texture[250] = {0}; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
127 static void gamesyokika(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
128 static void opening(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
129 static void pause(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
130 //static char *pad_trace_file; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
131 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
132 /** |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
133 * runmode: |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
134 * 0 - normal game |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
135 * 1 - capture mode |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
136 * program will capture all pad traces on a play and |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
137 * dump it into a file |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
138 * 2 - trace mode |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
139 * program will run with a trace file which is generated |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
140 * by capture-mode |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
141 */ |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
142 int runmode; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
143 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
144 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
145 static int |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
146 dandy_main_init(int gamef) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
147 { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
148 Timeprof timeprof_move; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
149 timeprof_move = timeprof_new(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
150 dbg_init("/dev/stdout"); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
151 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
152 /** |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
153 * timeprof があるんだけどね |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
154 */ |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
155 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
156 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
157 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
158 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
159 //SDL_Joystick *joy=SDL_JoystickOpen(0); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
160 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
161 sgroot->createFromXMLfile("xml/character.xml"); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
162 sgroot->createFromXMLfile("xml/font.xml"); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
163 sgroot->createFromXMLfile("xml/effect.xml"); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
164 sgroot->createFromXMLfile("xml/boss.xml"); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
165 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
166 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
167 init_sprite(0,0,0,0); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
168 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
169 __debug("syokikaが呼びだされました\n"); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
170 SDL_Joystick *joy=SDL_JoystickOpen(0); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
171 if(!joy) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
172 fprintf(stderr,"failed to open joystick 0\n"); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
173 use_keybord = 1; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
174 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
175 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
176 opening(joy); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
177 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
178 __debug("openingがよびだされました\n"); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
179 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
180 /** |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
181 * sound.c に移しました |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
182 * 代わりに InitSdlMixer(void); を使います。 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
183 * まあ中身一緒なんだけどね |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
184 */ |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
185 /** |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
186 if (Mix_OpenAudio(MIX_DEFAULT_FREQUENCY,MIX_DEFAULT_FORMAT,2,1024) < 0) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
187 fprintf(stderr,"failed to initialize SDL_mixer.\n"); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
188 SDL_Quit(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
189 exit(-1); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
190 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
191 */ |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
192 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
193 // SDL_mixer とかいろいろ初期化 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
194 // もし Init に失敗したら |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
195 // 以後の Mixer 関連の関数を呼び出しても |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
196 // 中では何も行われないとかいう小細工を入れました。 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
197 InitSdlMixer(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
198 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
199 // 音楽ファイルの読み込み |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
200 LoadSdlMixer(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
201 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
202 // ボリューム調整 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
203 InitVolume(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
204 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
205 // 音出しテスト |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
206 PlaySdlMixer(-1, BGM); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
207 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
208 if(!(init_chara_list(1024))){ |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
209 __debug("failed to init_chara_list\n"); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
210 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
211 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
212 __debug("finished init_chara_list\n"); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
213 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
214 return 1; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
215 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
216 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
217 static int |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
218 dandy_main_lop(int gamef) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
219 { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
220 if ((pad[0].l1 != 0) && (pad[0].r1 != 0) && |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
221 (pad[0].l2 != 0) && (pad[0].r2 != 0)) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
222 glFlush(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
223 SDL_GL_SwapBuffers( ); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
224 gamesyokika(joy); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
225 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
226 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
227 if (pad[0].quit != 0) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
228 gamef = 2; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
229 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
230 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
231 //SDL_FillRect(screen, NULL, background); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
232 glClear( GL_COLOR_BUFFER_BIT); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
233 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
234 schedule(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
235 enemyfaste = count; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
236 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
237 timeprof_begin(timeprof_move); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
238 //Move(); //enemy move |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
239 collision_detect(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
240 outofwindow(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
241 timeprof_end(timeprof_move); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
242 state_update(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
243 asteroidi = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
244 //charpatern(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
245 //bosguage(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
246 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
247 if (jiki.bf == TRUE) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
248 Player(0); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
249 count++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
250 PutSprite(count, jiki.x, jiki.y, jiki.ch); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
251 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
252 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
253 Putbom(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
254 tokuten(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
255 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
256 count++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
257 //PutSprite(count, 0, 960 - 96, 10); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
258 /*インフレゲージ */ |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
259 count++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
260 //PutSprite(count, 0, 0, 48); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
261 obj_draw(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
262 pause(joy); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
263 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
264 if (use_keybord) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
265 keybord(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
266 } else { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
267 Pad(joy); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
268 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
269 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
270 count = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
271 return gamef; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
272 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
273 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
274 static int |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
275 dandy_closing(int gamef) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
276 { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
277 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
278 //_______________________________________________ |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
279 // SDL_mixerの後始末 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
280 Mix_CloseAudio(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
281 Mix_HaltMusic(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
282 FreeSdlMixer() ; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
283 //_______________________________________________ |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
284 return 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
285 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
286 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
287 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
288 void gamesyokika(SDL_Joystick *joy) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
289 { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
290 laser_lv3[0].r = 62; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
291 laser_lv3[0].r = 62; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
292 for (i = 0; i < 3; i++) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
293 tlv3[i].y = -1; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
294 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
295 filpcount = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
296 stage = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
297 //for (i = 0; i < 300; i++) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
298 //enemy[i].f = FALSE; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
299 jiki.zanki = 3; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
300 jiki.x = 60; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
301 jiki.y = 200; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
302 jiki.ch = 3; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
303 jiki.point = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
304 jiki.bf = FALSE; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
305 jiki.muteki = 120; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
306 enemycount = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
307 lg.stg = 4096; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
308 pg.stg = 4096; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
309 infg.stg = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
310 infg_level = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
311 //kyeenemyno = -1; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
312 fastebos = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
313 jiki.ccount = 99; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
314 p_extend = 200000; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
315 pad[0].up=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
316 pad[0].down=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
317 pad[0].right=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
318 pad[0].left=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
319 pad[0].st=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
320 pad[0].se=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
321 opening(joy); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
322 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
323 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
324 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
325 void opening(SDL_Joystick *joy) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
326 { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
327 //for (i = 0; i < 300; i++) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
328 //}; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
329 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
330 SoundStop(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
331 SoundPlay(7); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
332 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
333 while (1) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
334 if(use_keybord == 1) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
335 keybord(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
336 } else { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
337 Pad(joy); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
338 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
339 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
340 count = 1; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
341 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
342 PutSprite(count, 700, 480, 53); // put `push start' string on screen. |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
343 count++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
344 PutSprite(count, 224, 776, 119); // put `super dandy' |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
345 count++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
346 // PutSprite(count, 200, 64, 190); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
347 // PutSpriteEx(count, 8192, 8192, 0); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
348 PutSpriteEx(190, 800, 264, 2, 2, 5); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
349 count++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
350 PutSprite(count, 396, 432, 191); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
351 //PutSpriteEx(count, 8192, 8192, 0); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
352 count++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
353 PutSprite(count, 640, 640, 192); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
354 //PutSpriteEx(count, 8192, 8192, 0); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
355 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
356 if (pad[0].st > 1) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
357 jiki.bf = TRUE; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
358 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
359 //CdPlay(1,&cdp[0],0); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
360 SoundStop(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
361 SoundPlay(0); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
362 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
363 gamef = 1; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
364 pad[0].st = 1; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
365 return; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
366 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
367 if ((pad[0].se > 0) && (pad[0].st > 0)) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
368 gamef = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
369 break; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
370 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
371 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
372 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
373 SDL_GL_SwapBuffers( ); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
374 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
375 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
376 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
377 void |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
378 pause(SDL_Joystick *joy) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
379 { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
380 if (jiki.zanki != 0 && jiki.bf != FALSE) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
381 if (pad[0].se == 1) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
382 //Mix_Pause(BGM); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
383 PauseSdlMixer(BGM); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
384 while(1){ |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
385 if(use_keybord == 1) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
386 keybord(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
387 } else { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
388 Pad(joy); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
389 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
390 if(pad[0].st == 0) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
391 continue; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
392 pad[0].up=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
393 pad[0].down=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
394 pad[0].right=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
395 pad[0].left=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
396 pad[0].se=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
397 pad[0].st=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
398 //Mix_Resume(BGM); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
399 ResumeSdlMixer(BGM); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
400 break; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
401 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
402 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
403 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
404 if (jiki.zanki == 0) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
405 // RECT *recp; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
406 if ((jiki.ccount > 0) && (cf == 0)) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
407 cf = 1; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
408 count++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
409 //cgcg(2); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
410 PutSprite(2, 480, 480, 110); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
411 count++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
412 //cgcg(1); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
413 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
414 if ((jiki.ccount > 0) && (cf == 1)) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
415 while (1) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
416 if (pad[0].st > 0) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
417 cf = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
418 jiki.ccount--; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
419 jiki.zanki = 3; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
420 enemycount++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
421 cc = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
422 for (i = 0; i < 4; i++) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
423 clear_result[i] = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
424 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
425 goto f; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
426 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
427 cc++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
428 if (29 - cc / 60 < 20) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
429 cc = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
430 cf = 3; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
431 break; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
432 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
433 SDL_Delay(100); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
434 PutSprite(1, 640, 640, 29 - cc / 60); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
435 // PutSpriteEx(1, 409 * ((cc % 60) + 1), 409 * ((cc % 60) + 1), 0); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
436 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
437 Pad(joy); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
438 SDL_GL_SwapBuffers( ); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
439 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
440 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
441 if (rswait > 60 * 6) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
442 cf = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
443 rswait = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
444 gamesyokika(joy); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
445 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
446 rswait++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
447 count++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
448 //cgcg(1); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
449 PutSprite(1, 480, 480, 19); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
450 return; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
451 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
452 if (jiki.bf == FALSE) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
453 f: |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
454 if (rswait < 80) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
455 rswait++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
456 return; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
457 } else { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
458 rswait = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
459 jiki.x = 60; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
460 jiki.y = 200; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
461 jiki.bf = TRUE; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
462 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
463 pad[0].st = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
464 lg.stg = 4096; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
465 pg.stg = 4096; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
466 laser_lv3[0].r = 62; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
467 tlv3[0].r = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
468 tlv3[0].y = -1; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
469 return; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
470 // sb_size = -1; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
471 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
472 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
473 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
474 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
475 SpriteTable sptable[DEFOBJ]; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
476 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
477 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
478 void DefSpriteEx(int number, short middlex, short middley) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
479 { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
480 sptable[number].mx = middlex; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
481 sptable[number].my = middley; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
482 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
483 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
484 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
485 void DefSprite(int number, char *name, float w, float h, int color, OBJECT *obj) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
486 { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
487 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
488 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
489 void PutSprite(int zorder, short x, short y, int number) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
490 { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
491 SpriteTable *m = &sptable[number]; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
492 SceneGraphPtr object = sgroot->createSceneGraph(m->name); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
493 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
494 title->xyz[0] = x; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
495 title->xyz[1] = y; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
496 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
497 charactor[number].x = x; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
498 charactor[number].y = y; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
499 charactor[number].flag = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
500 charactor[number].root = (void*)object; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
501 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
502 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
503 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
504 void PutSpriteEx(int number, int x, int y, float scalex, float scaley, float angle) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
505 { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
506 SpriteTable *m = &sptable[number]; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
507 x -= m->w; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
508 y -= m->h; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
509 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
510 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
511 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
512 struct SGO_PAD pad[2]; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
513 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
514 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
515 /* コントローラ状態の読み込み */ |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
516 void Pad(SDL_Joystick *joy) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
517 { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
518 Sint16 axis; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
519 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
520 SDL_JoystickUpdate(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
521 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
522 if(SDL_JoystickGetButton(joy,PS2_CROSS)==SDL_PRESSED) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
523 pad[0].k0++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
524 else |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
525 pad[0].k0=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
526 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
527 if(SDL_JoystickGetButton(joy,PS2_CIRCLE)==SDL_PRESSED) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
528 pad[0].k1++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
529 else |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
530 pad[0].k1=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
531 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
532 if(SDL_JoystickGetButton(joy,PS2_SQUARE)==SDL_PRESSED) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
533 pad[0].k3++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
534 else |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
535 pad[0].k3=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
536 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
537 if(SDL_JoystickGetButton(joy,PS2_TRIANGLE)==SDL_PRESSED) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
538 pad[0].k4++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
539 else |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
540 pad[0].k4=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
541 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
542 if(SDL_JoystickGetButton(joy,PS2_L1)==SDL_PRESSED) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
543 pad[0].l1++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
544 else |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
545 pad[0].l1=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
546 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
547 if(SDL_JoystickGetButton(joy,PS2_R1)==SDL_PRESSED) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
548 pad[0].r1++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
549 else |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
550 pad[0].r1=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
551 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
552 if(SDL_JoystickGetButton(joy,PS2_L2)==SDL_PRESSED) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
553 pad[0].l2++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
554 else |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
555 pad[0].l2=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
556 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
557 if(SDL_JoystickGetButton(joy,PS2_R2)==SDL_PRESSED) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
558 pad[0].r2++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
559 else |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
560 pad[0].r2=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
561 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
562 if(SDL_JoystickGetButton(joy,PS2_START)==SDL_PRESSED) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
563 pad[0].st++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
564 else |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
565 pad[0].st=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
566 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
567 if(SDL_JoystickGetButton(joy,PS2_SELECT)==SDL_PRESSED) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
568 pad[0].se++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
569 else |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
570 pad[0].se=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
571 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
572 if(SDL_JoystickGetButton(joy,PS2_L3)==SDL_PRESSED) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
573 pad[0].l3++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
574 else |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
575 pad[0].l3=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
576 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
577 if(SDL_JoystickGetButton(joy,PS2_R3)==SDL_PRESSED) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
578 pad[0].r3++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
579 else |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
580 pad[0].r3=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
581 //x |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
582 axis=SDL_JoystickGetAxis(joy,0); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
583 if(axis>=3200){ |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
584 pad[0].left=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
585 pad[0].right++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
586 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
587 else if(axis<=-3200){ |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
588 pad[0].right=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
589 pad[0].left++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
590 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
591 else { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
592 pad[0].right=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
593 pad[0].left=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
594 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
595 //y |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
596 axis=SDL_JoystickGetAxis(joy,1); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
597 if(axis>=3200){ |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
598 pad[0].up=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
599 pad[0].down++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
600 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
601 else if(axis<=-3200){ |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
602 pad[0].down=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
603 pad[0].up++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
604 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
605 else { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
606 pad[0].down=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
607 pad[0].up=0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
608 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
609 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
610 if ((pad[0].l1 != 0) && (pad[0].r1 != 0) && |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
611 (pad[0].l2 != 0) && (pad[0].r2 != 0) && |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
612 (pad[0].st != 0) && (pad[0].se != 0)) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
613 pad[0].quit = 1; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
614 } else { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
615 pad[0].quit = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
616 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
617 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
618 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
619 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
620 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
621 void keybord() |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
622 { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
623 SDL_PumpEvents(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
624 Uint8 *keys = SDL_GetKeyState(NULL); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
625 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
626 if (keys[SDLK_UP]) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
627 pad[0].up++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
628 } else { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
629 pad[0].up = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
630 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
631 if (keys[SDLK_DOWN]) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
632 pad[0].down++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
633 } else { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
634 pad[0].down = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
635 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
636 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
637 if (keys[SDLK_RIGHT]) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
638 pad[0].right++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
639 } else { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
640 pad[0].right = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
641 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
642 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
643 if (keys[SDLK_LEFT]) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
644 pad[0].left++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
645 } else { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
646 pad[0].left = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
647 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
648 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
649 if (keys[SDLK_a]) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
650 pad[0].k0++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
651 } else { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
652 pad[0].k0 = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
653 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
654 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
655 if (keys[SDLK_z]) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
656 pad[0].k1++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
657 } else { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
658 pad[0].k1 = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
659 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
660 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
661 if (keys[SDLK_s]) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
662 pad[0].k3++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
663 } else { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
664 pad[0].k3 = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
665 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
666 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
667 if (keys[SDLK_x]) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
668 pad[0].k4++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
669 } else { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
670 pad[0].k4 = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
671 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
672 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
673 if (keys[SDLK_r]) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
674 pad[0].r2++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
675 } else { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
676 pad[0].r2 = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
677 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
678 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
679 if (keys[SDLK_e]) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
680 pad[0].r1++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
681 } else { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
682 pad[0].r1 = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
683 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
684 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
685 if (keys[SDLK_w]) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
686 pad[0].l1++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
687 } else { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
688 pad[0].l1 = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
689 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
690 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
691 if (keys[SDLK_q]) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
692 pad[0].l2++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
693 } else { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
694 pad[0].l2 = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
695 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
696 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
697 // START ボタンは Return が似合う気がする |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
698 //if(keys[SDLK_1]) |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
699 if (keys[SDLK_RETURN]) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
700 pad[0].st++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
701 } else { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
702 pad[0].st = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
703 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
704 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
705 if (keys[SDLK_2]) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
706 pad[0].se++; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
707 } else { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
708 pad[0].se = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
709 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
710 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
711 if (keys[SDLK_ESCAPE]) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
712 SDL_Quit(); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
713 exit(1); |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
714 //pad[0].st = 1; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
715 //pad[0].se = 1; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
716 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
717 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
718 if (keys[SDLK_0]) { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
719 pad[0].quit = 1; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
720 } else { |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
721 pad[0].quit = 0; |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
722 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
723 } |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
724 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
725 |
6541f0bebb81
cerium redering engine main routine.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
726 /* end */ |