Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 189335 | Differences between
and this patch

Collapse All | Expand All

(-)a2k/a2k_src/import/opengl.d (-2 / +2 lines)
Lines 1116-1122 Link Here
1116
/*************************************************************/
1116
/*************************************************************/
1117
1117
1118
void /*APIENTRY*/glAccum (GLenum op, GLfloat value);
1118
void /*APIENTRY*/glAccum (GLenum op, GLfloat value);
1119
void /*APIENTRY*/glAlphaFunc (GLenum func, GLclampf ref);
1119
void /*APIENTRY*/glAlphaFunc (GLenum func, GLclampf);
1120
GLboolean /*APIENTRY*/glAreTexturesResident (GLsizei n, GLuint *textures, GLboolean *residences);
1120
GLboolean /*APIENTRY*/glAreTexturesResident (GLsizei n, GLuint *textures, GLboolean *residences);
1121
void /*APIENTRY*/glArrayElement (GLint i);
1121
void /*APIENTRY*/glArrayElement (GLint i);
1122
void /*APIENTRY*/glBegin (GLenum mode);
1122
void /*APIENTRY*/glBegin (GLenum mode);
Lines 1369-1375 Link Here
1369
void /*APIENTRY*/glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
1369
void /*APIENTRY*/glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
1370
void /*APIENTRY*/glSelectBuffer (GLsizei size, GLuint *buffer);
1370
void /*APIENTRY*/glSelectBuffer (GLsizei size, GLuint *buffer);
1371
void /*APIENTRY*/glShadeModel (GLenum mode);
1371
void /*APIENTRY*/glShadeModel (GLenum mode);
1372
void /*APIENTRY*/glStencilFunc (GLenum func, GLint ref, GLuint mask);
1372
void /*APIENTRY*/glStencilFunc (GLenum func, GLint, GLuint mask);
1373
void /*APIENTRY*/glStencilMask (GLuint mask);
1373
void /*APIENTRY*/glStencilMask (GLuint mask);
1374
void /*APIENTRY*/glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
1374
void /*APIENTRY*/glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
1375
void /*APIENTRY*/glTexCoord1d (GLdouble s);
1375
void /*APIENTRY*/glTexCoord1d (GLdouble s);
(-)a2k/a2k_src/import/SDL.d (-70 / +70 lines)
Lines 20-92 Link Here
20
    slouken@devolution.com
20
    slouken@devolution.com
21
*/
21
*/
22
22
23
import SDL_types;
23
public import SDL_types;
24
import SDL_getenv;
24
public import SDL_getenv;
25
import SDL_error;
25
public import SDL_error;
26
import SDL_rwops;
26
public import SDL_rwops;
27
import SDL_timer;
27
public import SDL_timer;
28
import SDL_audio;
28
public import SDL_audio;
29
import SDL_cdrom;
29
public import SDL_cdrom;
30
import SDL_joystick;
30
public import SDL_joystick;
31
import SDL_events;
31
public import SDL_events;
32
import SDL_video;
32
public import SDL_video;
33
import SDL_byteorder;
33
public import SDL_byteorder;
34
import SDL_Version;
34
public import SDL_Version;
35
35
36
extern(C):
36
extern(C):
37
37
38
/* As of version 0.5, SDL is loaded dynamically into the application */
38
/* As of version 0.5, SDL is loaded dynamically into the application */
39
39
40
/* These are the flags which may be passed to SDL_Init() -- you should
40
/* These are the flags which may be passed to SDL_Init() -- you should
41
   specify the subsystems which you will be using in your application.
41
   specify the subsystems which you will be using in your application.
42
*/
42
*/
43
const uint SDL_INIT_TIMER		= 0x00000001;
43
const uint SDL_INIT_TIMER		= 0x00000001;
44
const uint SDL_INIT_AUDIO		= 0x00000010;
44
const uint SDL_INIT_AUDIO		= 0x00000010;
45
const uint SDL_INIT_VIDEO		= 0x00000020;
45
const uint SDL_INIT_VIDEO		= 0x00000020;
46
const uint SDL_INIT_CDROM		= 0x00000100;
46
const uint SDL_INIT_CDROM		= 0x00000100;
47
const uint SDL_INIT_JOYSTICK	= 0x00000200;
47
const uint SDL_INIT_JOYSTICK	= 0x00000200;
48
const uint SDL_INIT_NOPARACHUTE	= 0x00100000;	/* Don't catch fatal signals */
48
const uint SDL_INIT_NOPARACHUTE	= 0x00100000;	/* Don't catch fatal signals */
49
const uint SDL_INIT_EVENTTHREAD	= 0x01000000;	/* Not supported on all OS's */
49
const uint SDL_INIT_EVENTTHREAD	= 0x01000000;	/* Not supported on all OS's */
50
const uint SDL_INIT_EVERYTHING	= 0x0000FFFF;
50
const uint SDL_INIT_EVERYTHING	= 0x0000FFFF;
51
51
52
/* This function loads the SDL dynamically linked library and initializes 
52
/* This function loads the SDL dynamically linked library and initializes 
53
 * the subsystems specified by 'flags' (and those satisfying dependencies)
53
 * the subsystems specified by 'flags' (and those satisfying dependencies)
54
 * Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
54
 * Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
55
 * signal handlers for some commonly ignored fatal signals (like SIGSEGV)
55
 * signal handlers for some commonly ignored fatal signals (like SIGSEGV)
56
 */
56
 */
57
int SDL_Init(Uint32 flags);
57
int SDL_Init(Uint32 flags);
58
58
59
/* This function initializes specific SDL subsystems */
59
/* This function initializes specific SDL subsystems */
60
int SDL_InitSubSystem(Uint32 flags);
60
int SDL_InitSubSystem(Uint32 flags);
61
61
62
/* This function cleans up specific SDL subsystems */
62
/* This function cleans up specific SDL subsystems */
63
void SDL_QuitSubSystem(Uint32 flags);
63
void SDL_QuitSubSystem(Uint32 flags);
64
64
65
/* This function returns mask of the specified subsystems which have
65
/* This function returns mask of the specified subsystems which have
66
   been initialized.
66
   been initialized.
67
   If 'flags' is 0, it returns a mask of all initialized subsystems.
67
   If 'flags' is 0, it returns a mask of all initialized subsystems.
68
*/
68
*/
69
Uint32 SDL_WasInit(Uint32 flags);
69
Uint32 SDL_WasInit(Uint32 flags);
70
70
71
/* This function cleans up all initialized subsystems and unloads the
71
/* This function cleans up all initialized subsystems and unloads the
72
 * dynamically linked library.  You should call it upon all exit conditions.
72
 * dynamically linked library.  You should call it upon all exit conditions.
73
 */
73
 */
74
void SDL_Quit();
74
void SDL_Quit();
75
75
76
void SDL_SetModuleHandle(void *hInst);
76
/+
77
//extern(Windows) void* GetModuleHandle(char*);
77
void SDL_SetModuleHandle(void *hInst);
78
extern(Windows) void* GetModuleHandleA(char*);
78
extern(Windows) void* GetModuleHandle(char*);
79
79
80
static this()
80
static this()
81
{
81
{
82
	/* Load SDL dynamic link library */
82
	/* Load SDL dynamic link library */
83
	if (SDL_Init(SDL_INIT_NOPARACHUTE) < 0)
83
	if (SDL_Init(SDL_INIT_NOPARACHUTE) < 0)
84
		throw new Error("Error loading SDL");
84
		throw new Error("Error loading SDL");
85
//	SDL_SetModuleHandle(GetModuleHandle(null));
85
	SDL_SetModuleHandle(GetModuleHandle(null));
86
	SDL_SetModuleHandle(GetModuleHandleA(null));
86
}
87
}
87
88
88
static ~this()
89
static ~this()
89
{
90
{
90
	SDL_Quit();
91
	SDL_Quit();
91
}
92
}
92
+/
(-)a2k/a2k_src/import/SDL_events.d (-1 / +1 lines)
Lines 304-310 Link Here
304
  If 'state' is set to SDL_QUERY, SDL_EventState() will return the 
304
  If 'state' is set to SDL_QUERY, SDL_EventState() will return the 
305
  current processing state of the specified event.
305
  current processing state of the specified event.
306
*/
306
*/
307
const int SDL_QUERY	= -1;
307
const uint SDL_QUERY	= -1;
308
const uint SDL_IGNORE	= 0;
308
const uint SDL_IGNORE	= 0;
309
const uint SDL_DISABLE	= 0;
309
const uint SDL_DISABLE	= 0;
310
const uint SDL_ENABLE	= 1;
310
const uint SDL_ENABLE	= 1;
(-)a2k/a2k_src/import/SDL_keysym.d (-308 lines)
Lines 1-308 Link Here
1
/*
2
    SDL - Simple DirectMedia Layer
3
    Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
4
5
    This library is free software; you can redistribute it and/or
6
    modify it under the terms of the GNU Library General Public
7
    License as published by the Free Software Foundation; either
8
    version 2 of the License, or (at your option) any later version.
9
10
    This library is distributed in the hope that it will be useful,
11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
    Library General Public License for more details.
14
15
    You should have received a copy of the GNU Library General Public
16
    License along with this library; if not, write to the Free
17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
19
    Sam Lantinga
20
    slouken@devolution.com
21
*/
22
23
/* What we really want is a mapping of every raw key on the keyboard.
24
   To support international keyboards, we use the range 0xA1 - 0xFF
25
   as international virtual keycodes.  We'll follow in the footsteps of X11...
26
   The names of the keys
27
 */
28
 
29
alias int SDLKey;
30
enum {
31
	/* The keyboard syms have been cleverly chosen to map to ASCII */
32
	SDLK_UNKNOWN		= 0,
33
	SDLK_FIRST		= 0,
34
	SDLK_BACKSPACE		= 8,
35
	SDLK_TAB		= 9,
36
	SDLK_CLEAR		= 12,
37
	SDLK_RETURN		= 13,
38
	SDLK_PAUSE		= 19,
39
	SDLK_ESCAPE		= 27,
40
	SDLK_SPACE		= 32,
41
	SDLK_EXCLAIM		= 33,
42
	SDLK_QUOTEDBL		= 34,
43
	SDLK_HASH		= 35,
44
	SDLK_DOLLAR		= 36,
45
	SDLK_AMPERSAND		= 38,
46
	SDLK_QUOTE		= 39,
47
	SDLK_LEFTPAREN		= 40,
48
	SDLK_RIGHTPAREN		= 41,
49
	SDLK_ASTERISK		= 42,
50
	SDLK_PLUS		= 43,
51
	SDLK_COMMA		= 44,
52
	SDLK_MINUS		= 45,
53
	SDLK_PERIOD		= 46,
54
	SDLK_SLASH		= 47,
55
	SDLK_0			= 48,
56
	SDLK_1			= 49,
57
	SDLK_2			= 50,
58
	SDLK_3			= 51,
59
	SDLK_4			= 52,
60
	SDLK_5			= 53,
61
	SDLK_6			= 54,
62
	SDLK_7			= 55,
63
	SDLK_8			= 56,
64
	SDLK_9			= 57,
65
	SDLK_COLON		= 58,
66
	SDLK_SEMICOLON		= 59,
67
	SDLK_LESS		= 60,
68
	SDLK_EQUALS		= 61,
69
	SDLK_GREATER		= 62,
70
	SDLK_QUESTION		= 63,
71
	SDLK_AT			= 64,
72
	/* 
73
	   Skip uppercase letters
74
	 */
75
	SDLK_LEFTBRACKET	= 91,
76
	SDLK_BACKSLASH		= 92,
77
	SDLK_RIGHTBRACKET	= 93,
78
	SDLK_CARET		= 94,
79
	SDLK_UNDERSCORE		= 95,
80
	SDLK_BACKQUOTE		= 96,
81
	SDLK_a			= 97,
82
	SDLK_b			= 98,
83
	SDLK_c			= 99,
84
	SDLK_d			= 100,
85
	SDLK_e			= 101,
86
	SDLK_f			= 102,
87
	SDLK_g			= 103,
88
	SDLK_h			= 104,
89
	SDLK_i			= 105,
90
	SDLK_j			= 106,
91
	SDLK_k			= 107,
92
	SDLK_l			= 108,
93
	SDLK_m			= 109,
94
	SDLK_n			= 110,
95
	SDLK_o			= 111,
96
	SDLK_p			= 112,
97
	SDLK_q			= 113,
98
	SDLK_r			= 114,
99
	SDLK_s			= 115,
100
	SDLK_t			= 116,
101
	SDLK_u			= 117,
102
	SDLK_v			= 118,
103
	SDLK_w			= 119,
104
	SDLK_x			= 120,
105
	SDLK_y			= 121,
106
	SDLK_z			= 122,
107
	SDLK_DELETE		= 127,
108
	/* End of ASCII mapped keysyms */
109
110
	/* International keyboard syms */
111
	SDLK_WORLD_0		= 160,		/* 0xA0 */
112
	SDLK_WORLD_1		= 161,
113
	SDLK_WORLD_2		= 162,
114
	SDLK_WORLD_3		= 163,
115
	SDLK_WORLD_4		= 164,
116
	SDLK_WORLD_5		= 165,
117
	SDLK_WORLD_6		= 166,
118
	SDLK_WORLD_7		= 167,
119
	SDLK_WORLD_8		= 168,
120
	SDLK_WORLD_9		= 169,
121
	SDLK_WORLD_10		= 170,
122
	SDLK_WORLD_11		= 171,
123
	SDLK_WORLD_12		= 172,
124
	SDLK_WORLD_13		= 173,
125
	SDLK_WORLD_14		= 174,
126
	SDLK_WORLD_15		= 175,
127
	SDLK_WORLD_16		= 176,
128
	SDLK_WORLD_17		= 177,
129
	SDLK_WORLD_18		= 178,
130
	SDLK_WORLD_19		= 179,
131
	SDLK_WORLD_20		= 180,
132
	SDLK_WORLD_21		= 181,
133
	SDLK_WORLD_22		= 182,
134
	SDLK_WORLD_23		= 183,
135
	SDLK_WORLD_24		= 184,
136
	SDLK_WORLD_25		= 185,
137
	SDLK_WORLD_26		= 186,
138
	SDLK_WORLD_27		= 187,
139
	SDLK_WORLD_28		= 188,
140
	SDLK_WORLD_29		= 189,
141
	SDLK_WORLD_30		= 190,
142
	SDLK_WORLD_31		= 191,
143
	SDLK_WORLD_32		= 192,
144
	SDLK_WORLD_33		= 193,
145
	SDLK_WORLD_34		= 194,
146
	SDLK_WORLD_35		= 195,
147
	SDLK_WORLD_36		= 196,
148
	SDLK_WORLD_37		= 197,
149
	SDLK_WORLD_38		= 198,
150
	SDLK_WORLD_39		= 199,
151
	SDLK_WORLD_40		= 200,
152
	SDLK_WORLD_41		= 201,
153
	SDLK_WORLD_42		= 202,
154
	SDLK_WORLD_43		= 203,
155
	SDLK_WORLD_44		= 204,
156
	SDLK_WORLD_45		= 205,
157
	SDLK_WORLD_46		= 206,
158
	SDLK_WORLD_47		= 207,
159
	SDLK_WORLD_48		= 208,
160
	SDLK_WORLD_49		= 209,
161
	SDLK_WORLD_50		= 210,
162
	SDLK_WORLD_51		= 211,
163
	SDLK_WORLD_52		= 212,
164
	SDLK_WORLD_53		= 213,
165
	SDLK_WORLD_54		= 214,
166
	SDLK_WORLD_55		= 215,
167
	SDLK_WORLD_56		= 216,
168
	SDLK_WORLD_57		= 217,
169
	SDLK_WORLD_58		= 218,
170
	SDLK_WORLD_59		= 219,
171
	SDLK_WORLD_60		= 220,
172
	SDLK_WORLD_61		= 221,
173
	SDLK_WORLD_62		= 222,
174
	SDLK_WORLD_63		= 223,
175
	SDLK_WORLD_64		= 224,
176
	SDLK_WORLD_65		= 225,
177
	SDLK_WORLD_66		= 226,
178
	SDLK_WORLD_67		= 227,
179
	SDLK_WORLD_68		= 228,
180
	SDLK_WORLD_69		= 229,
181
	SDLK_WORLD_70		= 230,
182
	SDLK_WORLD_71		= 231,
183
	SDLK_WORLD_72		= 232,
184
	SDLK_WORLD_73		= 233,
185
	SDLK_WORLD_74		= 234,
186
	SDLK_WORLD_75		= 235,
187
	SDLK_WORLD_76		= 236,
188
	SDLK_WORLD_77		= 237,
189
	SDLK_WORLD_78		= 238,
190
	SDLK_WORLD_79		= 239,
191
	SDLK_WORLD_80		= 240,
192
	SDLK_WORLD_81		= 241,
193
	SDLK_WORLD_82		= 242,
194
	SDLK_WORLD_83		= 243,
195
	SDLK_WORLD_84		= 244,
196
	SDLK_WORLD_85		= 245,
197
	SDLK_WORLD_86		= 246,
198
	SDLK_WORLD_87		= 247,
199
	SDLK_WORLD_88		= 248,
200
	SDLK_WORLD_89		= 249,
201
	SDLK_WORLD_90		= 250,
202
	SDLK_WORLD_91		= 251,
203
	SDLK_WORLD_92		= 252,
204
	SDLK_WORLD_93		= 253,
205
	SDLK_WORLD_94		= 254,
206
	SDLK_WORLD_95		= 255,		/* 0xFF */
207
208
	/* Numeric keypad */
209
	SDLK_KP0		= 256,
210
	SDLK_KP1		= 257,
211
	SDLK_KP2		= 258,
212
	SDLK_KP3		= 259,
213
	SDLK_KP4		= 260,
214
	SDLK_KP5		= 261,
215
	SDLK_KP6		= 262,
216
	SDLK_KP7		= 263,
217
	SDLK_KP8		= 264,
218
	SDLK_KP9		= 265,
219
	SDLK_KP_PERIOD		= 266,
220
	SDLK_KP_DIVIDE		= 267,
221
	SDLK_KP_MULTIPLY	= 268,
222
	SDLK_KP_MINUS		= 269,
223
	SDLK_KP_PLUS		= 270,
224
	SDLK_KP_ENTER		= 271,
225
	SDLK_KP_EQUALS		= 272,
226
227
	/* Arrows + Home/End pad */
228
	SDLK_UP			= 273,
229
	SDLK_DOWN		= 274,
230
	SDLK_RIGHT		= 275,
231
	SDLK_LEFT		= 276,
232
	SDLK_INSERT		= 277,
233
	SDLK_HOME		= 278,
234
	SDLK_END		= 279,
235
	SDLK_PAGEUP		= 280,
236
	SDLK_PAGEDOWN		= 281,
237
238
	/* Function keys */
239
	SDLK_F1			= 282,
240
	SDLK_F2			= 283,
241
	SDLK_F3			= 284,
242
	SDLK_F4			= 285,
243
	SDLK_F5			= 286,
244
	SDLK_F6			= 287,
245
	SDLK_F7			= 288,
246
	SDLK_F8			= 289,
247
	SDLK_F9			= 290,
248
	SDLK_F10		= 291,
249
	SDLK_F11		= 292,
250
	SDLK_F12		= 293,
251
	SDLK_F13		= 294,
252
	SDLK_F14		= 295,
253
	SDLK_F15		= 296,
254
255
	/* Key state modifier keys */
256
	SDLK_NUMLOCK		= 300,
257
	SDLK_CAPSLOCK		= 301,
258
	SDLK_SCROLLOCK		= 302,
259
	SDLK_RSHIFT		= 303,
260
	SDLK_LSHIFT		= 304,
261
	SDLK_RCTRL		= 305,
262
	SDLK_LCTRL		= 306,
263
	SDLK_RALT		= 307,
264
	SDLK_LALT		= 308,
265
	SDLK_RMETA		= 309,
266
	SDLK_LMETA		= 310,
267
	SDLK_LSUPER		= 311,		/* Left "Windows" key */
268
	SDLK_RSUPER		= 312,		/* Right "Windows" key */
269
	SDLK_MODE		= 313,		/* "Alt Gr" key */
270
	SDLK_COMPOSE		= 314,		/* Multi-key compose key */
271
272
	/* Miscellaneous function keys */
273
	SDLK_HELP		= 315,
274
	SDLK_PRINT		= 316,
275
	SDLK_SYSREQ		= 317,
276
	SDLK_BREAK		= 318,
277
	SDLK_MENU		= 319,
278
	SDLK_POWER		= 320,		/* Power Macintosh power key */
279
	SDLK_EURO		= 321,		/* Some european keyboards */
280
	SDLK_UNDO		= 322,		/* Atari keyboard has Undo */
281
282
	/* Add any other keys here */
283
284
	SDLK_LAST
285
}
286
287
/* Enumeration of valid key mods (possibly OR'd together) */
288
alias int SDLMod;
289
enum {
290
	KMOD_NONE  = 0x0000,
291
	KMOD_LSHIFT= 0x0001,
292
	KMOD_RSHIFT= 0x0002,
293
	KMOD_LCTRL = 0x0040,
294
	KMOD_RCTRL = 0x0080,
295
	KMOD_LALT  = 0x0100,
296
	KMOD_RALT  = 0x0200,
297
	KMOD_LMETA = 0x0400,
298
	KMOD_RMETA = 0x0800,
299
	KMOD_NUM   = 0x1000,
300
	KMOD_CAPS  = 0x2000,
301
	KMOD_MODE  = 0x4000,
302
	KMOD_RESERVED = 0x8000
303
}
304
305
const uint KMOD_CTRL	= (KMOD_LCTRL|KMOD_RCTRL);
306
const uint KMOD_SHIFT	= (KMOD_LSHIFT|KMOD_RSHIFT);
307
const uint KMOD_ALT		= (KMOD_LALT|KMOD_RALT);
308
const uint KMOD_META	= (KMOD_LMETA|KMOD_RMETA);
(-)a2k/a2k_src/import/SDL_Keysym.d (+308 lines)
Line 0 Link Here
1
/*
2
    SDL - Simple DirectMedia Layer
3
    Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
4
5
    This library is free software; you can redistribute it and/or
6
    modify it under the terms of the GNU Library General Public
7
    License as published by the Free Software Foundation; either
8
    version 2 of the License, or (at your option) any later version.
9
10
    This library is distributed in the hope that it will be useful,
11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
    Library General Public License for more details.
14
15
    You should have received a copy of the GNU Library General Public
16
    License along with this library; if not, write to the Free
17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
19
    Sam Lantinga
20
    slouken@devolution.com
21
*/
22
23
/* What we really want is a mapping of every raw key on the keyboard.
24
   To support international keyboards, we use the range 0xA1 - 0xFF
25
   as international virtual keycodes.  We'll follow in the footsteps of X11...
26
   The names of the keys
27
 */
28
 
29
alias int SDLKey;
30
enum {
31
	/* The keyboard syms have been cleverly chosen to map to ASCII */
32
	SDLK_UNKNOWN		= 0,
33
	SDLK_FIRST		= 0,
34
	SDLK_BACKSPACE		= 8,
35
	SDLK_TAB		= 9,
36
	SDLK_CLEAR		= 12,
37
	SDLK_RETURN		= 13,
38
	SDLK_PAUSE		= 19,
39
	SDLK_ESCAPE		= 27,
40
	SDLK_SPACE		= 32,
41
	SDLK_EXCLAIM		= 33,
42
	SDLK_QUOTEDBL		= 34,
43
	SDLK_HASH		= 35,
44
	SDLK_DOLLAR		= 36,
45
	SDLK_AMPERSAND		= 38,
46
	SDLK_QUOTE		= 39,
47
	SDLK_LEFTPAREN		= 40,
48
	SDLK_RIGHTPAREN		= 41,
49
	SDLK_ASTERISK		= 42,
50
	SDLK_PLUS		= 43,
51
	SDLK_COMMA		= 44,
52
	SDLK_MINUS		= 45,
53
	SDLK_PERIOD		= 46,
54
	SDLK_SLASH		= 47,
55
	SDLK_0			= 48,
56
	SDLK_1			= 49,
57
	SDLK_2			= 50,
58
	SDLK_3			= 51,
59
	SDLK_4			= 52,
60
	SDLK_5			= 53,
61
	SDLK_6			= 54,
62
	SDLK_7			= 55,
63
	SDLK_8			= 56,
64
	SDLK_9			= 57,
65
	SDLK_COLON		= 58,
66
	SDLK_SEMICOLON		= 59,
67
	SDLK_LESS		= 60,
68
	SDLK_EQUALS		= 61,
69
	SDLK_GREATER		= 62,
70
	SDLK_QUESTION		= 63,
71
	SDLK_AT			= 64,
72
	/* 
73
	   Skip uppercase letters
74
	 */
75
	SDLK_LEFTBRACKET	= 91,
76
	SDLK_BACKSLASH		= 92,
77
	SDLK_RIGHTBRACKET	= 93,
78
	SDLK_CARET		= 94,
79
	SDLK_UNDERSCORE		= 95,
80
	SDLK_BACKQUOTE		= 96,
81
	SDLK_a			= 97,
82
	SDLK_b			= 98,
83
	SDLK_c			= 99,
84
	SDLK_d			= 100,
85
	SDLK_e			= 101,
86
	SDLK_f			= 102,
87
	SDLK_g			= 103,
88
	SDLK_h			= 104,
89
	SDLK_i			= 105,
90
	SDLK_j			= 106,
91
	SDLK_k			= 107,
92
	SDLK_l			= 108,
93
	SDLK_m			= 109,
94
	SDLK_n			= 110,
95
	SDLK_o			= 111,
96
	SDLK_p			= 112,
97
	SDLK_q			= 113,
98
	SDLK_r			= 114,
99
	SDLK_s			= 115,
100
	SDLK_t			= 116,
101
	SDLK_u			= 117,
102
	SDLK_v			= 118,
103
	SDLK_w			= 119,
104
	SDLK_x			= 120,
105
	SDLK_y			= 121,
106
	SDLK_z			= 122,
107
	SDLK_DELETE		= 127,
108
	/* End of ASCII mapped keysyms */
109
110
	/* International keyboard syms */
111
	SDLK_WORLD_0		= 160,		/* 0xA0 */
112
	SDLK_WORLD_1		= 161,
113
	SDLK_WORLD_2		= 162,
114
	SDLK_WORLD_3		= 163,
115
	SDLK_WORLD_4		= 164,
116
	SDLK_WORLD_5		= 165,
117
	SDLK_WORLD_6		= 166,
118
	SDLK_WORLD_7		= 167,
119
	SDLK_WORLD_8		= 168,
120
	SDLK_WORLD_9		= 169,
121
	SDLK_WORLD_10		= 170,
122
	SDLK_WORLD_11		= 171,
123
	SDLK_WORLD_12		= 172,
124
	SDLK_WORLD_13		= 173,
125
	SDLK_WORLD_14		= 174,
126
	SDLK_WORLD_15		= 175,
127
	SDLK_WORLD_16		= 176,
128
	SDLK_WORLD_17		= 177,
129
	SDLK_WORLD_18		= 178,
130
	SDLK_WORLD_19		= 179,
131
	SDLK_WORLD_20		= 180,
132
	SDLK_WORLD_21		= 181,
133
	SDLK_WORLD_22		= 182,
134
	SDLK_WORLD_23		= 183,
135
	SDLK_WORLD_24		= 184,
136
	SDLK_WORLD_25		= 185,
137
	SDLK_WORLD_26		= 186,
138
	SDLK_WORLD_27		= 187,
139
	SDLK_WORLD_28		= 188,
140
	SDLK_WORLD_29		= 189,
141
	SDLK_WORLD_30		= 190,
142
	SDLK_WORLD_31		= 191,
143
	SDLK_WORLD_32		= 192,
144
	SDLK_WORLD_33		= 193,
145
	SDLK_WORLD_34		= 194,
146
	SDLK_WORLD_35		= 195,
147
	SDLK_WORLD_36		= 196,
148
	SDLK_WORLD_37		= 197,
149
	SDLK_WORLD_38		= 198,
150
	SDLK_WORLD_39		= 199,
151
	SDLK_WORLD_40		= 200,
152
	SDLK_WORLD_41		= 201,
153
	SDLK_WORLD_42		= 202,
154
	SDLK_WORLD_43		= 203,
155
	SDLK_WORLD_44		= 204,
156
	SDLK_WORLD_45		= 205,
157
	SDLK_WORLD_46		= 206,
158
	SDLK_WORLD_47		= 207,
159
	SDLK_WORLD_48		= 208,
160
	SDLK_WORLD_49		= 209,
161
	SDLK_WORLD_50		= 210,
162
	SDLK_WORLD_51		= 211,
163
	SDLK_WORLD_52		= 212,
164
	SDLK_WORLD_53		= 213,
165
	SDLK_WORLD_54		= 214,
166
	SDLK_WORLD_55		= 215,
167
	SDLK_WORLD_56		= 216,
168
	SDLK_WORLD_57		= 217,
169
	SDLK_WORLD_58		= 218,
170
	SDLK_WORLD_59		= 219,
171
	SDLK_WORLD_60		= 220,
172
	SDLK_WORLD_61		= 221,
173
	SDLK_WORLD_62		= 222,
174
	SDLK_WORLD_63		= 223,
175
	SDLK_WORLD_64		= 224,
176
	SDLK_WORLD_65		= 225,
177
	SDLK_WORLD_66		= 226,
178
	SDLK_WORLD_67		= 227,
179
	SDLK_WORLD_68		= 228,
180
	SDLK_WORLD_69		= 229,
181
	SDLK_WORLD_70		= 230,
182
	SDLK_WORLD_71		= 231,
183
	SDLK_WORLD_72		= 232,
184
	SDLK_WORLD_73		= 233,
185
	SDLK_WORLD_74		= 234,
186
	SDLK_WORLD_75		= 235,
187
	SDLK_WORLD_76		= 236,
188
	SDLK_WORLD_77		= 237,
189
	SDLK_WORLD_78		= 238,
190
	SDLK_WORLD_79		= 239,
191
	SDLK_WORLD_80		= 240,
192
	SDLK_WORLD_81		= 241,
193
	SDLK_WORLD_82		= 242,
194
	SDLK_WORLD_83		= 243,
195
	SDLK_WORLD_84		= 244,
196
	SDLK_WORLD_85		= 245,
197
	SDLK_WORLD_86		= 246,
198
	SDLK_WORLD_87		= 247,
199
	SDLK_WORLD_88		= 248,
200
	SDLK_WORLD_89		= 249,
201
	SDLK_WORLD_90		= 250,
202
	SDLK_WORLD_91		= 251,
203
	SDLK_WORLD_92		= 252,
204
	SDLK_WORLD_93		= 253,
205
	SDLK_WORLD_94		= 254,
206
	SDLK_WORLD_95		= 255,		/* 0xFF */
207
208
	/* Numeric keypad */
209
	SDLK_KP0		= 256,
210
	SDLK_KP1		= 257,
211
	SDLK_KP2		= 258,
212
	SDLK_KP3		= 259,
213
	SDLK_KP4		= 260,
214
	SDLK_KP5		= 261,
215
	SDLK_KP6		= 262,
216
	SDLK_KP7		= 263,
217
	SDLK_KP8		= 264,
218
	SDLK_KP9		= 265,
219
	SDLK_KP_PERIOD		= 266,
220
	SDLK_KP_DIVIDE		= 267,
221
	SDLK_KP_MULTIPLY	= 268,
222
	SDLK_KP_MINUS		= 269,
223
	SDLK_KP_PLUS		= 270,
224
	SDLK_KP_ENTER		= 271,
225
	SDLK_KP_EQUALS		= 272,
226
227
	/* Arrows + Home/End pad */
228
	SDLK_UP			= 273,
229
	SDLK_DOWN		= 274,
230
	SDLK_RIGHT		= 275,
231
	SDLK_LEFT		= 276,
232
	SDLK_INSERT		= 277,
233
	SDLK_HOME		= 278,
234
	SDLK_END		= 279,
235
	SDLK_PAGEUP		= 280,
236
	SDLK_PAGEDOWN		= 281,
237
238
	/* Function keys */
239
	SDLK_F1			= 282,
240
	SDLK_F2			= 283,
241
	SDLK_F3			= 284,
242
	SDLK_F4			= 285,
243
	SDLK_F5			= 286,
244
	SDLK_F6			= 287,
245
	SDLK_F7			= 288,
246
	SDLK_F8			= 289,
247
	SDLK_F9			= 290,
248
	SDLK_F10		= 291,
249
	SDLK_F11		= 292,
250
	SDLK_F12		= 293,
251
	SDLK_F13		= 294,
252
	SDLK_F14		= 295,
253
	SDLK_F15		= 296,
254
255
	/* Key state modifier keys */
256
	SDLK_NUMLOCK		= 300,
257
	SDLK_CAPSLOCK		= 301,
258
	SDLK_SCROLLOCK		= 302,
259
	SDLK_RSHIFT		= 303,
260
	SDLK_LSHIFT		= 304,
261
	SDLK_RCTRL		= 305,
262
	SDLK_LCTRL		= 306,
263
	SDLK_RALT		= 307,
264
	SDLK_LALT		= 308,
265
	SDLK_RMETA		= 309,
266
	SDLK_LMETA		= 310,
267
	SDLK_LSUPER		= 311,		/* Left "Windows" key */
268
	SDLK_RSUPER		= 312,		/* Right "Windows" key */
269
	SDLK_MODE		= 313,		/* "Alt Gr" key */
270
	SDLK_COMPOSE		= 314,		/* Multi-key compose key */
271
272
	/* Miscellaneous function keys */
273
	SDLK_HELP		= 315,
274
	SDLK_PRINT		= 316,
275
	SDLK_SYSREQ		= 317,
276
	SDLK_BREAK		= 318,
277
	SDLK_MENU		= 319,
278
	SDLK_POWER		= 320,		/* Power Macintosh power key */
279
	SDLK_EURO		= 321,		/* Some european keyboards */
280
	SDLK_UNDO		= 322,		/* Atari keyboard has Undo */
281
282
	/* Add any other keys here */
283
284
	SDLK_LAST
285
}
286
287
/* Enumeration of valid key mods (possibly OR'd together) */
288
alias int SDLMod;
289
enum {
290
	KMOD_NONE  = 0x0000,
291
	KMOD_LSHIFT= 0x0001,
292
	KMOD_RSHIFT= 0x0002,
293
	KMOD_LCTRL = 0x0040,
294
	KMOD_RCTRL = 0x0080,
295
	KMOD_LALT  = 0x0100,
296
	KMOD_RALT  = 0x0200,
297
	KMOD_LMETA = 0x0400,
298
	KMOD_RMETA = 0x0800,
299
	KMOD_NUM   = 0x1000,
300
	KMOD_CAPS  = 0x2000,
301
	KMOD_MODE  = 0x4000,
302
	KMOD_RESERVED = 0x8000
303
}
304
305
const uint KMOD_CTRL	= (KMOD_LCTRL|KMOD_RCTRL);
306
const uint KMOD_SHIFT	= (KMOD_LSHIFT|KMOD_RSHIFT);
307
const uint KMOD_ALT		= (KMOD_LALT|KMOD_RALT);
308
const uint KMOD_META	= (KMOD_LMETA|KMOD_RMETA);
(-)a2k/a2k_src/import/SDL_version.d (-75 lines)
Lines 1-75 Link Here
1
/*
2
    SDL - Simple DirectMedia Layer
3
    Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
4
5
    This library is free software; you can redistribute it and/or
6
    modify it under the terms of the GNU Library General Public
7
    License as published by the Free Software Foundation; either
8
    version 2 of the License, or (at your option) any later version.
9
10
    This library is distributed in the hope that it will be useful,
11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
    Library General Public License for more details.
14
15
    You should have received a copy of the GNU Library General Public
16
    License along with this library; if not, write to the Free
17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
19
    Sam Lantinga
20
    slouken@devolution.com
21
*/
22
23
/* This header defines the current SDL version */
24
25
import SDL_types;
26
27
extern(C):
28
29
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
30
*/
31
const uint SDL_MAJOR_VERSION	= 1;
32
const uint SDL_MINOR_VERSION	= 2;
33
const uint SDL_PATCHLEVEL		= 6;
34
35
struct SDL_version {
36
	Uint8 major;
37
	Uint8 minor;
38
	Uint8 patch;
39
}
40
41
/* This macro can be used to fill a version structure with the compile-time
42
 * version of the SDL library.
43
 */
44
void SDL_VERSION(SDL_version* X)
45
{
46
	X.major = SDL_MAJOR_VERSION;
47
	X.minor = SDL_MINOR_VERSION;
48
	X.patch = SDL_PATCHLEVEL;
49
}
50
51
/* This macro turns the version numbers into a numeric value:
52
   (1,2,3) -> (1203)
53
   This assumes that there will never be more than 100 patchlevels
54
*/
55
uint SDL_VERSIONNUM(Uint8 X, Uint8 Y, Uint8 Z)
56
{
57
	return X * 1000 + Y * 100 + Z;
58
}
59
60
/* This is the version number macro for the current SDL version */
61
const uint SDL_COMPILEDVERSION = SDL_MAJOR_VERSION * 1000 +
62
									SDL_MINOR_VERSION * 100 +
63
									SDL_PATCHLEVEL;
64
65
/* This macro will evaluate to true if compiled with SDL at least X.Y.Z */
66
bit SDL_VERSION_ATLEAST(Uint8 X, Uint8 Y, Uint8 Z)
67
{
68
	return (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z));
69
}
70
71
/* This function gets the version of the dynamically linked SDL library.
72
   it should NOT be used to fill a version structure, instead you should
73
   use the SDL_Version() macro.
74
 */
75
SDL_version * SDL_Linked_Version();
(-)a2k/a2k_src/import/SDL_Version.d (+75 lines)
Line 0 Link Here
1
/*
2
    SDL - Simple DirectMedia Layer
3
    Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
4
5
    This library is free software; you can redistribute it and/or
6
    modify it under the terms of the GNU Library General Public
7
    License as published by the Free Software Foundation; either
8
    version 2 of the License, or (at your option) any later version.
9
10
    This library is distributed in the hope that it will be useful,
11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
    Library General Public License for more details.
14
15
    You should have received a copy of the GNU Library General Public
16
    License along with this library; if not, write to the Free
17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
19
    Sam Lantinga
20
    slouken@devolution.com
21
*/
22
23
/* This header defines the current SDL version */
24
25
import SDL_types;
26
27
extern(C):
28
29
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
30
*/
31
const uint SDL_MAJOR_VERSION	= 1;
32
const uint SDL_MINOR_VERSION	= 2;
33
const uint SDL_PATCHLEVEL		= 6;
34
35
struct SDL_version {
36
	Uint8 major;
37
	Uint8 minor;
38
	Uint8 patch;
39
}
40
41
/* This macro can be used to fill a version structure with the compile-time
42
 * version of the SDL library.
43
 */
44
void SDL_VERSION(SDL_version* X)
45
{
46
	X.major = SDL_MAJOR_VERSION;
47
	X.minor = SDL_MINOR_VERSION;
48
	X.patch = SDL_PATCHLEVEL;
49
}
50
51
/* This macro turns the version numbers into a numeric value:
52
   (1,2,3) -> (1203)
53
   This assumes that there will never be more than 100 patchlevels
54
*/
55
uint SDL_VERSIONNUM(Uint8 X, Uint8 Y, Uint8 Z)
56
{
57
	return X * 1000 + Y * 100 + Z;
58
}
59
60
/* This is the version number macro for the current SDL version */
61
const uint SDL_COMPILEDVERSION = SDL_MAJOR_VERSION * 1000 +
62
									SDL_MINOR_VERSION * 100 +
63
									SDL_PATCHLEVEL;
64
65
/* This macro will evaluate to true if compiled with SDL at least X.Y.Z */
66
bit SDL_VERSION_ATLEAST(Uint8 X, Uint8 Y, Uint8 Z)
67
{
68
	return (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z));
69
}
70
71
/* This function gets the version of the dynamically linked SDL library.
72
   it should NOT be used to fill a version structure, instead you should
73
   use the SDL_Version() macro.
74
 */
75
SDL_version * SDL_Linked_Version();
(-)a2k/a2k_src/src/bg.d (-14 / +31 lines)
Lines 14-20 Link Here
14
private	import	util_snd;
14
private	import	util_snd;
15
private	import	define;
15
private	import	define;
16
private	import	task;
16
private	import	task;
17
private	import	stg;
17
private	import	stg;
18
private	import	stg01;
19
private	import	stg02;
20
private	import	stg03;
21
private	import	stg04;
22
private	import	stg05;
18
private	import	effect;
23
private	import	effect;
19
private	import	ship;
24
private	import	ship;
20
25
Lines 79-98 Link Here
79
			TskBuf[fade_id].tx = 1.0f;
84
			TskBuf[fade_id].tx = 1.0f;
80
			TskBuf[fade_id].wait = 60;
85
			TskBuf[fade_id].wait = 60;
81
			TskBuf[fade_id].step = 2;
86
			TskBuf[fade_id].step = 2;
82
			TskBuf[id].px = cast(float)(rand() % 1536 - 768.0f);
87
                        TskBuf[id].px = cast(float)(rand() % 1536 - 768.0f);
83
			TskBuf[id].py = cast(float)(rand() % 1536 - 768.0f);
88
			TskBuf[id].py = cast(float)(rand() % 1536 - 768.0f);
84
			if((rand() % 100) & 0x01){
89
			if((rand() % 100) & 0x01){
85
				if(TskBuf[id].px < 0.0f){
90
				if(TskBuf[id].px < 0.0f){
86
					TskBuf[id].tx = +(cast(float)(rand() % 768));
91
					TskBuf[id].tx = +(cast(float)(rand() % 768));
87
				}else{
92
				}else{
88
					TskBuf[id].tx = -(cast(float)(rand() % 768));
93
					TskBuf[id].tx = +(cast(float)(rand() % 768));
89
				}
94
				}
90
				TskBuf[id].ty = TskBuf[id].py;
95
				TskBuf[id].ty = TskBuf[id].py;
91
			}else{
96
			}else{
92
				if(TskBuf[id].py < 0.0f){
97
				if(TskBuf[id].py < 0.0f){
93
					TskBuf[id].ty = +(cast(float)(rand() % 768));
98
					TskBuf[id].ty = +(cast(float)(rand() % 768));
94
				}else{
99
				}else{
95
					TskBuf[id].ty = -(cast(float)(rand() % 768));
100
					TskBuf[id].ty = +(cast(float)(rand() % 768));
96
				}
101
				}
97
				TskBuf[id].tx = TskBuf[id].px;
102
				TskBuf[id].tx = TskBuf[id].px;
98
			}
103
			}
Lines 104-110 Link Here
104
			cam_pos = BASE_Z + cam_scr;
109
			cam_pos = BASE_Z + cam_scr;
105
			eid = setTSK(GROUP_08,&TSKbgZoom);
110
			eid = setTSK(GROUP_08,&TSKbgZoom);
106
			TskBuf[eid].wait = 600;
111
			TskBuf[eid].wait = 600;
107
			TskBuf[eid].tx = BASE_Z - (cast(float)((rand() % 5000) - 2500 + 10000) / 10000.0f);
112
			TskBuf[eid].tx = BASE_Z - ((cast(float)(rand() % 5000) - 2500 + 10000) / 10000.0f);
108
			TskBuf[id].step++;
113
			TskBuf[id].step++;
109
			break;
114
			break;
110
		case	2:
115
		case	2:
Lines 202-223 Link Here
202
			scr_base[Y] = START_Y;
207
			scr_base[Y] = START_Y;
203
			scr_ofs[X] = 0.0f;
208
			scr_ofs[X] = 0.0f;
204
			scr_ofs[Y] = 0.0f;
209
			scr_ofs[Y] = 0.0f;
205
			cam_pos = BASE_Z + cam_scr;
210
			cam_pos = BASE_Z + cam_scr;
211
					bg_mode = 0;
212
					stg_ctrl = STG_MAIN;
206
			switch(area_num){
213
			switch(area_num){
207
				case	AREA_01:
214
				case	AREA_01:
208
					bg_mode = 0;
215
					bg_mode = 0;
216
					stg_ctrl = STG_MAIN;
217
					setTSK(GROUP_01,&TSKstg01);
209
					break;
218
					break;
210
				case	AREA_02:
219
				case	AREA_02:
211
					bg_mode = 1;
220
					bg_mode = 1;
221
					stg_ctrl = STG_MAIN;
222
					setTSK(GROUP_01,&TSKstg02);
212
					break;
223
					break;
213
				case	AREA_03:
224
				case	AREA_03:
214
					bg_mode = 2;
225
					bg_mode = 2;
226
					stg_ctrl = STG_MAIN;
227
					setTSK(GROUP_01,&TSKstg03);
215
					break;
228
					break;
216
				case	AREA_04:
229
				case	AREA_04:
217
					bg_mode = 3;
230
					bg_mode = 3;
231
					stg_ctrl = STG_MAIN;
232
					setTSK(GROUP_01,&TSKstg04);
218
					break;
233
					break;
219
				case	AREA_05:
234
				case	AREA_05:
220
					bg_mode = 4;
235
					bg_mode = 4;
236
					stg_ctrl = STG_MAIN;
237
					setTSK(GROUP_01,&TSKstg05);
221
					break;
238
					break;
222
				default:
239
				default:
223
					break;
240
					break;
Lines 296-302 Link Here
296
						bg_obj[i].line_list.length = 1;
313
						bg_obj[i].line_list.length = 1;
297
						bg_obj[i].line_list[0][X] = +0.0f;
314
						bg_obj[i].line_list[0][X] = +0.0f;
298
						bg_obj[i].line_list[0][Y] = +0.0f;
315
						bg_obj[i].line_list[0][Y] = +0.0f;
299
						bg_obj[i].line_list[0][Z] = -(cast(float)(rand() % 75)) / 100.0f + 0.25f;
316
						bg_obj[i].line_list[0][Z] = -cast(float)(rand() % 75) / 100.0f + 0.25f;
300
					}
317
					}
301
					break;
318
					break;
302
				case	4:
319
				case	4:
Lines 600-607 Link Here
600
			break;
617
			break;
601
		case	1:
618
		case	1:
602
			if(TskBuf[id].wait){
619
			if(TskBuf[id].wait){
603
				TskBuf[id].px  = ((rand() % (256.0f * TskBuf[id].vx)) - ((256.0f * TskBuf[id].vx) / 2)) / 256.0f;
620
				TskBuf[id].px  = (cast(float)(rand() % (256.0f * TskBuf[id].vx)) - ((256.0f * TskBuf[id].vx) / 2)) / 256.0f;
604
				TskBuf[id].py  = ((rand() % (256.0f * TskBuf[id].vy)) - ((256.0f * TskBuf[id].vy) / 2)) / 256.0f;
621
				TskBuf[id].py  = (cast(float)(rand() % (256.0f * TskBuf[id].vy)) - ((256.0f * TskBuf[id].vy) / 2)) / 256.0f;
605
				TskBuf[id].vx += (0.0f - TskBuf[id].vx) / TskBuf[id].cnt;
622
				TskBuf[id].vx += (0.0f - TskBuf[id].vx) / TskBuf[id].cnt;
606
				TskBuf[id].vy += (0.0f - TskBuf[id].vy) / TskBuf[id].cnt;
623
				TskBuf[id].vy += (0.0f - TskBuf[id].vy) / TskBuf[id].cnt;
607
				scr_ofs[X] = TskBuf[id].px;
624
				scr_ofs[X] = TskBuf[id].px;
(-)a2k/a2k_src/src/boss01.d (-1 / +1 lines)
Lines 7-13 Link Here
7
*/
7
*/
8
8
9
private	import	std.stdio;
9
private	import	std.stdio;
10
private	import	std.math;
10
//private	import	std.math;
11
private	import	std.c.math;
11
private	import	std.c.math;
12
private	import	std.random;
12
private	import	std.random;
13
private	import	std.string;
13
private	import	std.string;
(-)a2k/a2k_src/src/boss02.d (-1 / +1 lines)
Lines 6-12 Link Here
6
	2004/04/16 jumpei isshiki
6
	2004/04/16 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.math;
9
//private	import	std.math;
10
private	import	std.c.math;
10
private	import	std.c.math;
11
private	import	std.random;
11
private	import	std.random;
12
private	import	std.string;
12
private	import	std.string;
(-)a2k/a2k_src/src/boss03.d (-2 / +2 lines)
Lines 6-12 Link Here
6
	2004/06/08 jumpei isshiki
6
	2004/06/08 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.math;
9
//private	import	std.math;
10
private	import	std.c.math;
10
private	import	std.c.math;
11
private	import	std.random;
11
private	import	std.random;
12
private	import	std.string;
12
private	import	std.string;
Lines 359-365 Link Here
359
			}
359
			}
360
			if(!cmd.isEnd()) cmd.run();
360
			if(!cmd.isEnd()) cmd.run();
361
			break;
361
			break;
362
			TskBuf[id].ang_x  = rand() % 65536;
362
			TskBuf[id].ang_x  = cast(float)rand() % 65536;
363
			TskBuf[id].ang_x *= PI / 65536.0f;
363
			TskBuf[id].ang_x *= PI / 65536.0f;
364
			TskBuf[id].ax = 
364
			TskBuf[id].ax = 
365
			TskBuf[id].ay = sin(TskBuf[id].ang_x) * 5.0f / PI;
365
			TskBuf[id].ay = sin(TskBuf[id].ang_x) * 5.0f / PI;
(-)a2k/a2k_src/src/boss04.d (-1 / +1 lines)
Lines 6-12 Link Here
6
	2004/06/06 jumpei isshiki
6
	2004/06/06 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.math;
9
//private	import	std.math;
10
private	import	std.c.math;
10
private	import	std.c.math;
11
private	import	std.random;
11
private	import	std.random;
12
private	import	std.string;
12
private	import	std.string;
(-)a2k/a2k_src/src/boss05.d (-1 / +1 lines)
Lines 6-12 Link Here
6
	2004/06/09 jumpei isshiki
6
	2004/06/09 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.math;
9
//private	import	std.math;
10
private	import	std.c.math;
10
private	import	std.c.math;
11
private	import	std.random;
11
private	import	std.random;
12
private	import	std.string;
12
private	import	std.string;
(-)a2k/a2k_src/src/bulletcommand.d (-2 / +2 lines)
Lines 36-42 Link Here
36
36
37
	buf.length = 256;
37
	buf.length = 256;
38
	buf = fname ~ "\0";
38
	buf = fname ~ "\0";
39
	parser[bank] = BulletMLParserTinyXML_new(buf);
39
	parser[bank] = BulletMLParserTinyXML_new(buf.ptr);
40
	if(parser[bank]) BulletMLParserTinyXML_parse(parser[bank]);
40
	if(parser[bank]) BulletMLParserTinyXML_parse(parser[bank]);
41
	buf.length = 0;
41
	buf.length = 0;
42
}
42
}
Lines 247-253 Link Here
247
double	getRand_(BulletMLRunner* runner){
247
double	getRand_(BulletMLRunner* runner){
248
	double	rand_val;
248
	double	rand_val;
249
	//printf("getRand_(%d)\n",BulletCommand.now.id);
249
	//printf("getRand_(%d)\n",BulletCommand.now.id);
250
	rand_val = rand() % 10000;
250
	rand_val = cast(float)rand() % 10000;
251
	rand_val /= 10000;
251
	rand_val /= 10000;
252
	return	rand_val;
252
	return	rand_val;
253
}
253
}
(-)a2k/a2k_src/src/define.d (-10 / +10 lines)
Lines 9-18 Link Here
9
const char[]	PROJECT_NAME = "AREA2048";
9
const char[]	PROJECT_NAME = "AREA2048";
10
10
11
enum{
11
enum{
12
	/* ƒOƒ‰ƒtƒBƒbƒNŠÖŒW */
12
	/**/
13
	GRP_TITLE = 0,
13
	GRP_TITLE = 0,
14
14
15
	/* BGMŠÖŒW */
15
	/* */
16
	SND_BGM01 = 0,
16
	SND_BGM01 = 0,
17
	SND_BGM02,
17
	SND_BGM02,
18
	SND_BGM03,
18
	SND_BGM03,
Lines 21-27 Link Here
21
	SND_BOSS01,
21
	SND_BOSS01,
22
	SND_BOSS02,
22
	SND_BOSS02,
23
23
24
	/* SEŠÖŒW */
24
	/*  */
25
	SND_SE_SDEST = 0,
25
	SND_SE_SDEST = 0,
26
	SND_SE_EDMG,
26
	SND_SE_EDMG,
27
	SND_SE_EDEST,
27
	SND_SE_EDEST,
Lines 33-39 Link Here
33
	SND_SE_LOCK_ON,
33
	SND_SE_LOCK_ON,
34
	SND_SE_LOCK_OFF,
34
	SND_SE_LOCK_OFF,
35
35
36
	/* VOICEŠÖŒW */
36
	/*  */
37
	SND_VOICE_GETREADY = 16,
37
	SND_VOICE_GETREADY = 16,
38
	SND_VOICE_EXTEND,
38
	SND_VOICE_EXTEND,
39
	SND_VOICE_CHARGE,
39
	SND_VOICE_CHARGE,
Lines 42-48 Link Here
42
	SND_VOICE_EMERGENCY,
42
	SND_VOICE_EMERGENCY,
43
	SND_VOICE_AREA,
43
	SND_VOICE_AREA,
44
44
45
	/* ’eŠÖŒW */
45
	/*  */
46
	BULLET_SHIP01 = 0,
46
	BULLET_SHIP01 = 0,
47
	BULLET_SHIP02,
47
	BULLET_SHIP02,
48
48
Lines 82-88 Link Here
82
	BULLET_BOSS0505,
82
	BULLET_BOSS0505,
83
	BULLET_BOSS0506,
83
	BULLET_BOSS0506,
84
84
85
	/* ƒGƒŠƒA/ƒV[ƒ“ŠÖŒW */
85
	/* */
86
	AREA_01 = 0,
86
	AREA_01 = 0,
87
	AREA_02,
87
	AREA_02,
88
	AREA_03,
88
	AREA_03,
Lines 101-113 Link Here
101
	SCENE_10,
101
	SCENE_10,
102
	SCENE_11,
102
	SCENE_11,
103
103
104
	/* ƒXƒe[ƒWƒRƒ“ƒgƒ[ƒ‹ */
104
	/* */
105
	STG_INIT = 0,
105
	STG_INIT = 0,
106
	STG_MAIN,
106
	STG_MAIN,
107
	STG_CLEAR,
107
	STG_CLEAR,
108
	STG_GAMEOVER,
108
	STG_GAMEOVER,
109
109
110
	/* “GŠÖŒW */
110
	/**/
111
	ENMEY_01 = 0,
111
	ENMEY_01 = 0,
112
	ENMEY_02,
112
	ENMEY_02,
113
	ENMEY_03,
113
	ENMEY_03,
Lines 127-133 Link Here
127
	BOSS_04,
127
	BOSS_04,
128
	BOSS_05,
128
	BOSS_05,
129
129
130
	/* ƒV[ƒPƒ“ƒXƒRƒ“ƒgƒ[ƒ‹ */
130
	/* */
131
	SEQ_WAIT = 0,
131
	SEQ_WAIT = 0,
132
	SEQ_SETENEMY,
132
	SEQ_SETENEMY,
133
	SEQ_SETENEMYID,
133
	SEQ_SETENEMYID,
Lines 166-172 Link Here
166
	SEQ_FADE,
166
	SEQ_FADE,
167
	SEQ_END,
167
	SEQ_END,
168
168
169
	/* ‚»‚Ì‘¼ */
169
	/**/
170
	ONE_SEC = 60,
170
	ONE_SEC = 60,
171
	ONE_MIN = ONE_SEC * 60,
171
	ONE_MIN = ONE_SEC * 60,
172
}
172
}
(-)a2k/a2k_src/src/effect.d (-26 / +27 lines)
Lines 6-12 Link Here
6
	2004/03/31 jumpei isshiki
6
	2004/03/31 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.math;
9
//private	import	std.math;
10
private	import	std.c.math;
10
private	import	std.c.math;
11
private	import	std.random;
11
private	import	std.random;
12
private	import	std.string;
12
private	import	std.string;
Lines 14-20 Link Here
14
private	import	opengl;
14
private	import	opengl;
15
private	import	util_sdl;
15
private	import	util_sdl;
16
private	import	task;
16
private	import	task;
17
private	import	bg;
17
private	import	bg;
18
private	import	system;
18
19
19
float	fade_r = 0.0f;
20
float	fade_r = 0.0f;
20
float	fade_g = 0.0f;
21
float	fade_g = 0.0f;
Lines 54-69 Link Here
54
			for(int i = 0; i < 3; i++){
55
			for(int i = 0; i < 3; i++){
55
				switch(i){
56
				switch(i){
56
					case	0:
57
					case	0:
57
							tpos[X] = -((rand() % 4096) / 1024.0f + 1.0f);
58
							tpos[X] = -cast(float)((rand() % 4096) / 1024.0f + 1.0f);
58
							tpos[Y] = +((rand() % 4096) / 1024.0f + 1.0f);
59
							tpos[Y] = +cast(float)((rand() % 4096) / 1024.0f + 1.0f);
59
							break;
60
							break;
60
					case	1:
61
					case	1:
61
							tpos[X] =  ((rand() % 2048) / 1024.0f - 1.0f);
62
							tpos[X] =  cast(float)((rand() % 2048) / 1024.0f - 1.0f);
62
							tpos[Y] = -((rand() % 4096) / 1024.0f + 1.0f);
63
							tpos[Y] = -cast(float)((rand() % 4096) / 1024.0f + 1.0f);
63
							break;
64
							break;
64
					case	2:
65
					case	2:
65
							tpos[X] = +((rand() % 4096) / 1024.0f + 1.0f);
66
							tpos[X] = +cast(float)((rand() % 4096) / 1024.0f + 1.0f);
66
							tpos[Y] = +((rand() % 4096) / 1024.0f + 1.0f);
67
							tpos[Y] = +cast(float)((rand() % 4096) / 1024.0f + 1.0f);
67
							break;
68
							break;
68
					default:
69
					default:
69
							break;
70
							break;
Lines 75-82 Link Here
75
				tpos[Y] = fabs(tpos[Y]);
76
				tpos[Y] = fabs(tpos[Y]);
76
				TskBuf[id].body_ang[i][W] = sqrt(pow(tpos[X],2.0) + pow(tpos[Y],2.0));
77
				TskBuf[id].body_ang[i][W] = sqrt(pow(tpos[X],2.0) + pow(tpos[Y],2.0));
77
			}
78
			}
78
			TskBuf[id].tx = (rand() % 256000) / 1000.0f - 128.0f;
79
			TskBuf[id].tx = cast(float)(rand() % 256000) / 1000.0f - 128.0f;
79
			TskBuf[id].ty = (rand() % 256000) / 1000.0f - 128.0f;
80
			TskBuf[id].ty = cast(float)(rand() % 256000) / 1000.0f - 128.0f;
80
			TskBuf[id].tx += TskBuf[id].px;
81
			TskBuf[id].tx += TskBuf[id].px;
81
			TskBuf[id].ty += TskBuf[id].py;
82
			TskBuf[id].ty += TskBuf[id].py;
82
			TskBuf[id].wait = 60;
83
			TskBuf[id].wait = 60;
Lines 166-181 Link Here
166
			for(int i = 0; i < 3; i++){
167
			for(int i = 0; i < 3; i++){
167
				switch(i){
168
				switch(i){
168
					case	0:
169
					case	0:
169
							tpos[X] = -((rand() % 12288) / 1024.0f + 3.0f);
170
							tpos[X] = -(cast(float)(rand() % 12288) / 1024.0f + 3.0f);
170
							tpos[Y] = +((rand() % 12288) / 1024.0f + 3.0f);
171
							tpos[Y] = +(cast(float)(rand() % 12288) / 1024.0f + 3.0f);
171
							break;
172
							break;
172
					case	1:
173
					case	1:
173
							tpos[X] =  ((rand() %  6144) / 1024.0f - 3.0f);
174
							tpos[X] =  (cast(float)(rand() %  6144) / 1024.0f - 3.0f);
174
							tpos[Y] = -((rand() % 12288) / 1024.0f + 3.0f);
175
							tpos[Y] = -(cast(float)(rand() % 12288) / 1024.0f + 3.0f);
175
							break;
176
							break;
176
					case	2:
177
					case	2:
177
							tpos[X] = +((rand() % 12288) / 1024.0f + 3.0f);
178
							tpos[X] = +(cast(float)(rand() % 12288) / 1024.0f + 3.0f);
178
							tpos[Y] = +((rand() % 12288) / 1024.0f + 3.0f);
179
							tpos[Y] = +(cast(float)(rand() % 12288) / 1024.0f + 3.0f);
179
							break;
180
							break;
180
					default:
181
					default:
181
							break;
182
							break;
Lines 187-194 Link Here
187
				tpos[Y] = fabs(tpos[Y]);
188
				tpos[Y] = fabs(tpos[Y]);
188
				TskBuf[id].body_ang[i][W] = sqrt(pow(tpos[X],2.0) + pow(tpos[Y],2.0));
189
				TskBuf[id].body_ang[i][W] = sqrt(pow(tpos[X],2.0) + pow(tpos[Y],2.0));
189
			}
190
			}
190
			TskBuf[id].tx = (rand() % 512000) / 1000.0f - 256.0f;
191
			TskBuf[id].tx = cast(float)(rand() % 512000) / 1000.0f - 256.0f;
191
			TskBuf[id].ty = (rand() % 512000) / 1000.0f - 256.0f;
192
			TskBuf[id].ty = cast(float)(rand() % 512000) / 1000.0f - 256.0f;
192
			TskBuf[id].tx += TskBuf[id].px;
193
			TskBuf[id].tx += TskBuf[id].px;
193
			TskBuf[id].ty += TskBuf[id].py;
194
			TskBuf[id].ty += TskBuf[id].py;
194
			TskBuf[id].wait = 60;
195
			TskBuf[id].wait = 60;
Lines 280-292 Link Here
280
			TskBuf[id].fp_draw = &TSKBrokenBodyDraw;
281
			TskBuf[id].fp_draw = &TSKBrokenBodyDraw;
281
			TskBuf[id].fp_exit = &TSKBrokenBodyExit;
282
			TskBuf[id].fp_exit = &TSKBrokenBodyExit;
282
			TskBuf[id].alpha = 1.0f;
283
			TskBuf[id].alpha = 1.0f;
283
			TskBuf[id].tx = (rand() % 256000) / 1000.0f - 128.0f;
284
			TskBuf[id].tx = cast(float)(rand() % 256000) / 1000.0f - 128.0f;
284
			TskBuf[id].ty = (rand() % 256000) / 1000.0f - 128.0f;
285
			TskBuf[id].ty = cast(float)(rand() % 256000) / 1000.0f - 128.0f;
285
			TskBuf[id].tx *= 2.0f;
286
			TskBuf[id].tx *= 2.0f;
286
			TskBuf[id].ty *= 2.0f;
287
			TskBuf[id].ty *= 2.0f;
287
			TskBuf[id].tx += TskBuf[id].px;
288
			TskBuf[id].tx += TskBuf[id].px;
288
			TskBuf[id].ty += TskBuf[id].py;
289
			TskBuf[id].ty += TskBuf[id].py;
289
			TskBuf[id].rot_add = (rand % 30) - 15;
290
			TskBuf[id].rot_add = cast(float)(rand % 30) - 15;
290
			if(!(TskBuf[id].rot_add - 15))		TskBuf[id].rot_add = -1;
291
			if(!(TskBuf[id].rot_add - 15))		TskBuf[id].rot_add = -1;
291
			else if(!(TskBuf[id].rot_add + 15)) TskBuf[id].rot_add = +1;
292
			else if(!(TskBuf[id].rot_add + 15)) TskBuf[id].rot_add = +1;
292
			if(TskBuf[id].rot_add < 0) TskBuf[id].rot_add = PI / (TskBuf[id].rot_add - 15);
293
			if(TskBuf[id].rot_add < 0) TskBuf[id].rot_add = PI / (TskBuf[id].rot_add - 15);
Lines 411-423 Link Here
411
			TskBuf[id].fp_draw = &TSKBrokenLineDraw;
412
			TskBuf[id].fp_draw = &TSKBrokenLineDraw;
412
			TskBuf[id].fp_exit = &TSKBrokenLineExit;
413
			TskBuf[id].fp_exit = &TSKBrokenLineExit;
413
			TskBuf[id].alpha = 1.0f;
414
			TskBuf[id].alpha = 1.0f;
414
			TskBuf[id].tx = (rand() % 256000) / 1000.0f - 128.0f;
415
			TskBuf[id].tx = cast(float)(rand() % 256000) / 1000.0f - 128.0f;
415
			TskBuf[id].ty = (rand() % 256000) / 1000.0f - 128.0f;
416
			TskBuf[id].ty = cast(float)(rand() % 256000) / 1000.0f - 128.0f;
416
			TskBuf[id].tx *= 2.0f;
417
			TskBuf[id].tx *= 2.0f;
417
			TskBuf[id].ty *= 2.0f;
418
			TskBuf[id].ty *= 2.0f;
418
			TskBuf[id].tx += TskBuf[id].px;
419
			TskBuf[id].tx += TskBuf[id].px;
419
			TskBuf[id].ty += TskBuf[id].py;
420
			TskBuf[id].ty += TskBuf[id].py;
420
			TskBuf[id].rot_add = (rand % 30) - 15;
421
			TskBuf[id].rot_add = cast(float)(rand % 30) - 15;
421
			if(!(TskBuf[id].rot_add - 15))		TskBuf[id].rot_add = -1;
422
			if(!(TskBuf[id].rot_add - 15))		TskBuf[id].rot_add = -1;
422
			else if(!(TskBuf[id].rot_add + 15)) TskBuf[id].rot_add = +1;
423
			else if(!(TskBuf[id].rot_add + 15)) TskBuf[id].rot_add = +1;
423
			if(TskBuf[id].rot_add < 0) TskBuf[id].rot_add = PI / (TskBuf[id].rot_add - 15);
424
			if(TskBuf[id].rot_add < 0) TskBuf[id].rot_add = PI / (TskBuf[id].rot_add - 15);
Lines 507-513 Link Here
507
508
508
	z = BASE_Z - cam_pos;
509
	z = BASE_Z - cam_pos;
509
510
510
	/* ƒtƒF[ƒh•\Ž¦ */
511
	
511
	glBegin(GL_QUADS);
512
	glBegin(GL_QUADS);
512
	glColor4f(fade_r,fade_g,fade_b,fade_a);
513
	glColor4f(fade_r,fade_g,fade_b,fade_a);
513
	glVertex3f(getPointX(TskBuf[id].px-(SCREEN_Y / 2), z),
514
	glVertex3f(getPointX(TskBuf[id].px-(SCREEN_Y / 2), z),
Lines 566-572 Link Here
566
567
567
	z = BASE_Z - cam_pos;
568
	z = BASE_Z - cam_pos;
568
569
569
	/* ƒtƒF[ƒh•\Ž¦ */
570
	
570
    glBlendFunc(GL_SRC_ALPHA, GL_SRC_ALPHA);
571
    glBlendFunc(GL_SRC_ALPHA, GL_SRC_ALPHA);
571
	glBegin(GL_QUADS);
572
	glBegin(GL_QUADS);
572
	glColor4f(fade_r,fade_g,fade_b,fade_a);
573
	glColor4f(fade_r,fade_g,fade_b,fade_a);
(-)a2k/a2k_src/src/enemy01.d (-4 / +4 lines)
Lines 6-12 Link Here
6
	2004/03/27 jumpei isshiki
6
	2004/03/27 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.math;
9
//private	import	std.math;
10
private	import	std.c.math;
10
private	import	std.c.math;
11
private	import	std.random;
11
private	import	std.random;
12
private	import	SDL;
12
private	import	SDL;
Lines 64-71 Link Here
64
	switch(TskBuf[id].step){
64
	switch(TskBuf[id].step){
65
		case	0:
65
		case	0:
66
			TskBuf[id].tskid |= TSKID_ZAKO;
66
			TskBuf[id].tskid |= TSKID_ZAKO;
67
			TskBuf[id].px = (rand() % 1536) - 768.0f;
67
			TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
68
			TskBuf[id].py = (rand() % 1536) - 768.0f;
68
			TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
69
			TskBuf[id].fp_int = null;
69
			TskBuf[id].fp_int = null;
70
			TskBuf[id].fp_draw = &TSKenemy01Draw;
70
			TskBuf[id].fp_draw = &TSKenemy01Draw;
71
			TskBuf[id].fp_exit = &TSKenemy01Exit;
71
			TskBuf[id].fp_exit = &TSKenemy01Exit;
Lines 102-108 Link Here
102
				TskBuf[id].step++;
102
				TskBuf[id].step++;
103
			}
103
			}
104
		case	2:
104
		case	2:
105
			/* À•WXV */
105
			/*  */
106
			if(TskBuf[id].px < ship_px){
106
			if(TskBuf[id].px < ship_px){
107
				if(TskBuf[id].vx > +0.0f) TskBuf[id].vx += 1.0f / SPEED_RATE * 2.0f;
107
				if(TskBuf[id].vx > +0.0f) TskBuf[id].vx += 1.0f / SPEED_RATE * 2.0f;
108
				else					  TskBuf[id].vx += 1.0f / SPEED_RATE * 1.5f;
108
				else					  TskBuf[id].vx += 1.0f / SPEED_RATE * 1.5f;
(-)a2k/a2k_src/src/enemy02.d (-5 / +5 lines)
Lines 6-12 Link Here
6
	2004/04/11 jumpei isshiki
6
	2004/04/11 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.math;
9
//private	import	std.math;
10
private	import	std.c.math;
10
private	import	std.c.math;
11
private	import	std.random;
11
private	import	std.random;
12
private	import	SDL;
12
private	import	SDL;
Lines 64-71 Link Here
64
	switch(TskBuf[id].step){
64
	switch(TskBuf[id].step){
65
		case	0:
65
		case	0:
66
			TskBuf[id].tskid |= TSKID_ZAKO;
66
			TskBuf[id].tskid |= TSKID_ZAKO;
67
			TskBuf[id].px = (rand() % 1536) - 768.0f;
67
			TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
68
			TskBuf[id].py = (rand() % 1536) - 768.0f;
68
			TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
69
			TskBuf[id].fp_int = null;
69
			TskBuf[id].fp_int = null;
70
			TskBuf[id].fp_draw = &TSKenemy02Draw;
70
			TskBuf[id].fp_draw = &TSKenemy02Draw;
71
			TskBuf[id].fp_exit = &TSKenemy02Exit;
71
			TskBuf[id].fp_exit = &TSKenemy02Exit;
Lines 103-116 Link Here
103
				TskBuf[id].step++;
103
				TskBuf[id].step++;
104
			}
104
			}
105
		case	2:
105
		case	2:
106
			/* ˆÚ“®ƒ‚[ƒhXV */
106
			/*  */
107
			if(!TskBuf[id].mov_cnt){
107
			if(!TskBuf[id].mov_cnt){
108
				TskBuf[id].mov_mode = (rand() % 100) & 0x01;
108
				TskBuf[id].mov_mode = (rand() % 100) & 0x01;
109
				TskBuf[id].mov_cnt = (rand() % 60) + 60;
109
				TskBuf[id].mov_cnt = (rand() % 60) + 60;
110
			}else{
110
			}else{
111
				TskBuf[id].mov_cnt--;
111
				TskBuf[id].mov_cnt--;
112
			}
112
			}
113
			/* À•WXV */
113
			/* */
114
			switch(TskBuf[id].mov_mode){
114
			switch(TskBuf[id].mov_mode){
115
				case	0:
115
				case	0:
116
					if(TskBuf[id].px < ship_px){
116
					if(TskBuf[id].px < ship_px){
(-)a2k/a2k_src/src/enemy03.d (-5 / +5 lines)
Lines 6-12 Link Here
6
	2004/04/11 jumpei isshiki
6
	2004/04/11 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.math;
9
//private	import	std.math;
10
private	import	std.c.math;
10
private	import	std.c.math;
11
private	import	std.random;
11
private	import	std.random;
12
private	import	SDL;
12
private	import	SDL;
Lines 64-71 Link Here
64
	switch(TskBuf[id].step){
64
	switch(TskBuf[id].step){
65
		case	0:
65
		case	0:
66
			TskBuf[id].tskid |= TSKID_ZAKO;
66
			TskBuf[id].tskid |= TSKID_ZAKO;
67
			TskBuf[id].px = (rand() % 1536) - 768.0f;
67
			TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
68
			TskBuf[id].py = (rand() % 1536) - 768.0f;
68
			TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
69
			TskBuf[id].tid = ship_id;
69
			TskBuf[id].tid = ship_id;
70
			TskBuf[id].fp_int = null;
70
			TskBuf[id].fp_int = null;
71
			TskBuf[id].fp_draw = &TSKenemy03Draw;
71
			TskBuf[id].fp_draw = &TSKenemy03Draw;
Lines 109-115 Link Here
109
				TskBuf[id].step++;
109
				TskBuf[id].step++;
110
			}
110
			}
111
		case	2:
111
		case	2:
112
			/* ’eŒ‚‚¿ */
112
			/*  */
113
			if(cmd){
113
			if(cmd){
114
				if(TskBuf[id].bullet_wait){
114
				if(TskBuf[id].bullet_wait){
115
					if(cmd.isEnd()) TskBuf[id].bullet_wait--;
115
					if(cmd.isEnd()) TskBuf[id].bullet_wait--;
Lines 138-144 Link Here
138
					}
138
					}
139
				}
139
				}
140
			}
140
			}
141
			/* À•WXV */
141
			/* */
142
			if(TskBuf[id].px < ship_px){
142
			if(TskBuf[id].px < ship_px){
143
				if(TskBuf[id].vx > +0.0f) TskBuf[id].vx += 1.0f / SPEED_RATE * 1.5f;
143
				if(TskBuf[id].vx > +0.0f) TskBuf[id].vx += 1.0f / SPEED_RATE * 1.5f;
144
				else					  TskBuf[id].vx += 1.0f / SPEED_RATE * 2.0f;
144
				else					  TskBuf[id].vx += 1.0f / SPEED_RATE * 2.0f;
(-)a2k/a2k_src/src/enemy04.d (-9 / +9 lines)
Lines 6-12 Link Here
6
	2004/04/11 jumpei isshiki
6
	2004/04/11 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.math;
9
//private	import	std.math;
10
private	import	std.c.math;
10
private	import	std.c.math;
11
private	import	std.random;
11
private	import	std.random;
12
private	import	SDL;
12
private	import	SDL;
Lines 54-61 Link Here
54
	switch(TskBuf[id].step){
54
	switch(TskBuf[id].step){
55
		case	0:
55
		case	0:
56
			TskBuf[id].tskid |= TSKID_ZAKO;
56
			TskBuf[id].tskid |= TSKID_ZAKO;
57
			TskBuf[id].px = (rand() % 1536) - 768.0f;
57
			TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
58
			TskBuf[id].py = (rand() % 1536) - 768.0f;
58
			TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
59
			TskBuf[id].tid = ship_id;
59
			TskBuf[id].tid = ship_id;
60
			TskBuf[id].fp_int = null;
60
			TskBuf[id].fp_int = null;
61
			TskBuf[id].fp_draw = &TSKenemy04Draw;
61
			TskBuf[id].fp_draw = &TSKenemy04Draw;
Lines 100-106 Link Here
100
				TskBuf[id].step++;
100
				TskBuf[id].step++;
101
			}
101
			}
102
		case	2:
102
		case	2:
103
			/* ’eŒ‚‚¿ */
103
			/* */
104
			if(cmd){
104
			if(cmd){
105
				if(TskBuf[id].bullet_wait){
105
				if(TskBuf[id].bullet_wait){
106
					if(cmd.isEnd()) TskBuf[id].bullet_wait--;
106
					if(cmd.isEnd()) TskBuf[id].bullet_wait--;
Lines 129-146 Link Here
129
					}
129
					}
130
				}
130
				}
131
			}
131
			}
132
			/* À•WXV */
132
			/**/
133
			TskBuf[id].vx = TskBuf[id].px;
133
			TskBuf[id].vx = TskBuf[id].px;
134
			TskBuf[id].vy = TskBuf[id].py;
134
			TskBuf[id].vy = TskBuf[id].py;
135
			if(!TskBuf[id].cnt){
135
			if(!TskBuf[id].cnt){
136
				TskBuf[id].tx = (rand() % 512) + 256.0f;
136
				TskBuf[id].tx = cast(float)(rand() % 512) + 256.0f;
137
				TskBuf[id].ty = (rand() % 512) + 256.0f;
137
				TskBuf[id].ty = cast(float)(rand() % 512) + 256.0f;
138
				if(TskBuf[id].px < ship_px) TskBuf[id].tx = +TskBuf[id].tx;
138
				if(TskBuf[id].px < ship_px) TskBuf[id].tx = +TskBuf[id].tx;
139
				else						TskBuf[id].tx = -TskBuf[id].tx;
139
				else						TskBuf[id].tx = -TskBuf[id].tx;
140
				if(TskBuf[id].py < ship_py) TskBuf[id].ty = +TskBuf[id].ty;
140
				if(TskBuf[id].py < ship_py) TskBuf[id].ty = +TskBuf[id].ty;
141
				else						TskBuf[id].ty = -TskBuf[id].ty;
141
				else						TskBuf[id].ty = -TskBuf[id].ty;
142
				if((rand() % 100) > 97) TskBuf[id].tx = -TskBuf[id].tx;
142
				if(cast(float)(rand() % 100) > 97) TskBuf[id].tx = -TskBuf[id].tx;
143
				if((rand() % 100) > 97) TskBuf[id].ty = -TskBuf[id].ty;
143
				if(cast(float)(rand() % 100) > 97) TskBuf[id].ty = -TskBuf[id].ty;
144
				TskBuf[id].tx = TskBuf[id].px + TskBuf[id].tx;
144
				TskBuf[id].tx = TskBuf[id].px + TskBuf[id].tx;
145
				TskBuf[id].ty = TskBuf[id].py + TskBuf[id].ty;
145
				TskBuf[id].ty = TskBuf[id].py + TskBuf[id].ty;
146
				if(TskBuf[id].tx < -ENEMY_AREAMAX) TskBuf[id].tx = -ENEMY_AREAMAX + 1.0f;
146
				if(TskBuf[id].tx < -ENEMY_AREAMAX) TskBuf[id].tx = -ENEMY_AREAMAX + 1.0f;
(-)a2k/a2k_src/src/enemy05.d (-39 / +28 lines)
Lines 6-12 Link Here
6
	2004/05/30 jumpei isshiki
6
	2004/05/30 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.math;
9
//private	import	std.math;
10
private	import	std.c.math;
10
private	import	std.c.math;
11
private	import	std.random;
11
private	import	std.random;
12
private	import	SDL;
12
private	import	SDL;
Lines 54-61 Link Here
54
	switch(TskBuf[id].step){
54
	switch(TskBuf[id].step){
55
		case	0:
55
		case	0:
56
			TskBuf[id].tskid |= TSKID_ZAKO;
56
			TskBuf[id].tskid |= TSKID_ZAKO;
57
			TskBuf[id].px = (rand() % 1536) - 768.0f;
57
			TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
58
			TskBuf[id].py = (rand() % 1536) - 768.0f;
58
			TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
59
			TskBuf[id].tid = ship_id;
59
			TskBuf[id].tid = ship_id;
60
			TskBuf[id].fp_int = null;
60
			TskBuf[id].fp_int = null;
61
			TskBuf[id].fp_draw = &TSKenemy05Draw;
61
			TskBuf[id].fp_draw = &TSKenemy05Draw;
Lines 98-104 Link Here
98
				TskBuf[id].step++;
98
				TskBuf[id].step++;
99
			}
99
			}
100
		case	2:
100
		case	2:
101
			/* ’eŒ‚‚¿ */
101
			/*  */
102
			if(cmd){
102
			if(cmd){
103
				if(TskBuf[id].bullet_wait){
103
				if(TskBuf[id].bullet_wait){
104
					if(cmd.isEnd()) TskBuf[id].bullet_wait--;
104
					if(cmd.isEnd()) TskBuf[id].bullet_wait--;
Lines 127-169 Link Here
127
					}
127
					}
128
				}
128
				}
129
			}
129
			}
130
			/* À•WXV */
130
/**/
131
			if(TskBuf[id].px < ship_px){
131
			TskBuf[id].vx = TskBuf[id].px;
132
				if(TskBuf[id].vx > +0.0f) TskBuf[id].vx += 1.0f / SPEED_RATE * 2.0f;
132
			TskBuf[id].vy = TskBuf[id].py;
133
				else					  TskBuf[id].vx += 1.0f / SPEED_RATE * 1.5f;
133
			if(!TskBuf[id].cnt){
134
				if(TskBuf[id].vx > +MAX_SPEED) TskBuf[id].vx = +MAX_SPEED;
134
				TskBuf[id].tx = cast(float)(rand() % 512) + 256.0f;
135
				TskBuf[id].ty = cast(float)(rand() % 512) + 256.0f;
136
				if(TskBuf[id].px < ship_px) TskBuf[id].tx = +TskBuf[id].tx;
137
				else						TskBuf[id].tx = -TskBuf[id].tx;
138
				if(TskBuf[id].py < ship_py) TskBuf[id].ty = +TskBuf[id].ty;
139
				else						TskBuf[id].ty = -TskBuf[id].ty;
140
				if(cast(float)(rand() % 100) > 97) TskBuf[id].tx = -TskBuf[id].tx;
141
				if(cast(float)(rand() % 100) > 97) TskBuf[id].ty = -TskBuf[id].ty;
142
				TskBuf[id].tx = TskBuf[id].px + TskBuf[id].tx;
143
				TskBuf[id].ty = TskBuf[id].py + TskBuf[id].ty;
144
				if(TskBuf[id].tx < -ENEMY_AREAMAX) TskBuf[id].tx = -ENEMY_AREAMAX + 1.0f;
145
				if(TskBuf[id].tx > +ENEMY_AREAMAX) TskBuf[id].tx = +ENEMY_AREAMAX - 1.0f;
146
				if(TskBuf[id].ty < -ENEMY_AREAMAX) TskBuf[id].ty = -ENEMY_AREAMAX + 1.0f;
147
				if(TskBuf[id].ty > +ENEMY_AREAMAX) TskBuf[id].ty = +ENEMY_AREAMAX - 1.0f;
148
				TskBuf[id].cnt = 180;
135
			}else{
149
			}else{
136
				if(TskBuf[id].vx < +0.0f) TskBuf[id].vx -= 1.0f / SPEED_RATE * 2.0f;
150
				TskBuf[id].cnt--;
137
				else					  TskBuf[id].vx -= 1.0f / SPEED_RATE * 1.5f;
138
				if(TskBuf[id].vx < -MAX_SPEED) TskBuf[id].vx = -MAX_SPEED;
139
			}
140
			if(TskBuf[id].py < ship_py){
141
				if(TskBuf[id].vy > +0.0f) TskBuf[id].vy += 1.0f / SPEED_RATE * 2.0f;
142
				else					  TskBuf[id].vy += 1.0f / SPEED_RATE * 1.5f;
143
				if(TskBuf[id].vy > +MAX_SPEED) TskBuf[id].vy = +MAX_SPEED;
144
			}else{
145
				if(TskBuf[id].vy < +0.0f) TskBuf[id].vy -= 1.0f / SPEED_RATE * 2.0f;
146
				else					  TskBuf[id].vy -= 1.0f / SPEED_RATE * 1.5f;
147
				if(TskBuf[id].vy < -MAX_SPEED) TskBuf[id].vy = -MAX_SPEED;
148
			}
149
			TskBuf[id].px += TskBuf[id].vx;
150
			TskBuf[id].py += TskBuf[id].vy;
151
			if(TskBuf[id].px < -ENEMY_AREAMAX){
152
				TskBuf[id].px = -ENEMY_AREAMAX;
153
				TskBuf[id].vx = -TskBuf[id].vx / 2;
154
			}
155
			if(TskBuf[id].px > +ENEMY_AREAMAX){
156
				TskBuf[id].px = +ENEMY_AREAMAX;
157
				TskBuf[id].vx = -TskBuf[id].vx / 2;
158
			}
159
			if(TskBuf[id].py < -ENEMY_AREAMAX){
160
				TskBuf[id].py = -ENEMY_AREAMAX;
161
				TskBuf[id].vy = -TskBuf[id].vy / 2;
162
			}
163
			if(TskBuf[id].py > +ENEMY_AREAMAX){
164
				TskBuf[id].py = +ENEMY_AREAMAX;
165
				TskBuf[id].vy = -TskBuf[id].vy / 2;
166
			}
151
			}
152
			TskBuf[id].px += (TskBuf[id].tx - TskBuf[id].px) / (180 / 4);
153
			TskBuf[id].py += (TskBuf[id].ty - TskBuf[id].py) / (180 / 4);
154
			TskBuf[id].vx -= TskBuf[id].px;
155
			TskBuf[id].vy -= TskBuf[id].py;
167
			TskBuf[id].rot = atan2(-TskBuf[id].vx, -TskBuf[id].vy);
156
			TskBuf[id].rot = atan2(-TskBuf[id].vx, -TskBuf[id].vy);
168
			break;
157
			break;
169
		default:
158
		default:
(-)a2k/a2k_src/src/enemy06.d (-9 / +9 lines)
Lines 6-12 Link Here
6
	2004/06/04 jumpei isshiki
6
	2004/06/04 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.math;
9
//private	import	std.math;
10
private	import	std.c.math;
10
private	import	std.c.math;
11
private	import	std.random;
11
private	import	std.random;
12
private	import	SDL;
12
private	import	SDL;
Lines 66-73 Link Here
66
	switch(TskBuf[id].step){
66
	switch(TskBuf[id].step){
67
		case	0:
67
		case	0:
68
			TskBuf[id].tskid |= TSKID_ZAKO;
68
			TskBuf[id].tskid |= TSKID_ZAKO;
69
			TskBuf[id].px = (rand() % 1536) - 768.0f;
69
			TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
70
			TskBuf[id].py = (rand() % 1536) - 768.0f;
70
			TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
71
			TskBuf[id].tid = ship_id;
71
			TskBuf[id].tid = ship_id;
72
			TskBuf[id].fp_int = null;
72
			TskBuf[id].fp_int = null;
73
			TskBuf[id].fp_draw = &TSKenemy06Draw;
73
			TskBuf[id].fp_draw = &TSKenemy06Draw;
Lines 113-119 Link Here
113
				TskBuf[id].step++;
113
				TskBuf[id].step++;
114
			}
114
			}
115
		case	2:
115
		case	2:
116
			/* ’eŒ‚‚¿ */
116
			/* */
117
			if(cmd){
117
			if(cmd){
118
				if(TskBuf[id].bullet_wait){
118
				if(TskBuf[id].bullet_wait){
119
					if(cmd.isEnd()) TskBuf[id].bullet_wait--;
119
					if(cmd.isEnd()) TskBuf[id].bullet_wait--;
Lines 142-159 Link Here
142
					}
142
					}
143
				}
143
				}
144
			}
144
			}
145
			/* À•WXV */
145
			/* */
146
			TskBuf[id].vx = TskBuf[id].px;
146
			TskBuf[id].vx = TskBuf[id].px;
147
			TskBuf[id].vy = TskBuf[id].py;
147
			TskBuf[id].vy = TskBuf[id].py;
148
			if(TskBuf[id].cnt == TskBuf[id].mov_cnt){
148
			if(TskBuf[id].cnt == TskBuf[id].mov_cnt){
149
				TskBuf[id].tx = (rand() % 512) + 256.0f;
149
				TskBuf[id].tx = cast(float)(rand() % 512) + 256.0f;
150
				TskBuf[id].ty = (rand() % 512) + 256.0f;
150
				TskBuf[id].ty = cast(float)(rand() % 512) + 256.0f;
151
				if(TskBuf[id].px < ship_px) TskBuf[id].tx = +TskBuf[id].tx;
151
				if(TskBuf[id].px < ship_px) TskBuf[id].tx = +TskBuf[id].tx;
152
				else						TskBuf[id].tx = -TskBuf[id].tx;
152
				else						TskBuf[id].tx = -TskBuf[id].tx;
153
				if(TskBuf[id].py < ship_py) TskBuf[id].ty = +TskBuf[id].ty;
153
				if(TskBuf[id].py < ship_py) TskBuf[id].ty = +TskBuf[id].ty;
154
				else						TskBuf[id].ty = -TskBuf[id].ty;
154
				else						TskBuf[id].ty = -TskBuf[id].ty;
155
				if((rand() % 100) > 97) TskBuf[id].tx = -TskBuf[id].tx;
155
				if(cast(float)(rand() % 100) > 97) TskBuf[id].tx = -TskBuf[id].tx;
156
				if((rand() % 100) > 97) TskBuf[id].ty = -TskBuf[id].ty;
156
				if(cast(float)(rand() % 100) > 97) TskBuf[id].ty = -TskBuf[id].ty;
157
				TskBuf[id].tx = TskBuf[id].px + TskBuf[id].tx;
157
				TskBuf[id].tx = TskBuf[id].px + TskBuf[id].tx;
158
				TskBuf[id].ty = TskBuf[id].py + TskBuf[id].ty;
158
				TskBuf[id].ty = TskBuf[id].py + TskBuf[id].ty;
159
				if(TskBuf[id].tx < -ENEMY_AREAMAX) TskBuf[id].tx = -ENEMY_AREAMAX + 1.0f;
159
				if(TskBuf[id].tx < -ENEMY_AREAMAX) TskBuf[id].tx = -ENEMY_AREAMAX + 1.0f;
(-)a2k/a2k_src/src/enemy07.d (-39 / +28 lines)
Lines 6-12 Link Here
6
	2004/06/05 jumpei isshiki
6
	2004/06/05 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.math;
9
//private	import	std.math;
10
private	import	std.c.math;
10
private	import	std.c.math;
11
private	import	std.random;
11
private	import	std.random;
12
private	import	SDL;
12
private	import	SDL;
Lines 64-71 Link Here
64
	switch(TskBuf[id].step){
64
	switch(TskBuf[id].step){
65
		case	0:
65
		case	0:
66
			TskBuf[id].tskid |= TSKID_ZAKO;
66
			TskBuf[id].tskid |= TSKID_ZAKO;
67
			TskBuf[id].px = (rand() % 1536) - 768.0f;
67
			TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
68
			TskBuf[id].py = (rand() % 1536) - 768.0f;
68
			TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
69
			TskBuf[id].tid = ship_id;
69
			TskBuf[id].tid = ship_id;
70
			TskBuf[id].fp_int = null;
70
			TskBuf[id].fp_int = null;
71
			TskBuf[id].fp_draw = &TSKenemy07Draw;
71
			TskBuf[id].fp_draw = &TSKenemy07Draw;
Lines 108-114 Link Here
108
				TskBuf[id].step++;
108
				TskBuf[id].step++;
109
			}
109
			}
110
		case	2:
110
		case	2:
111
			/* ’eŒ‚‚¿ */
111
			/*  */
112
			if(cmd){
112
			if(cmd){
113
				if(TskBuf[id].bullet_wait){
113
				if(TskBuf[id].bullet_wait){
114
					if(cmd.isEnd()) TskBuf[id].bullet_wait--;
114
					if(cmd.isEnd()) TskBuf[id].bullet_wait--;
Lines 137-179 Link Here
137
					}
137
					}
138
				}
138
				}
139
			}
139
			}
140
			/* À•WXV */
140
/**/
141
			if(TskBuf[id].px < ship_px){
141
			TskBuf[id].vx = TskBuf[id].px;
142
				if(TskBuf[id].vx > +0.0f) TskBuf[id].vx += 1.0f / SPEED_RATE * 2.0f;
142
			TskBuf[id].vy = TskBuf[id].py;
143
				else					  TskBuf[id].vx += 1.0f / SPEED_RATE * 1.5f;
143
			if(!TskBuf[id].cnt){
144
				if(TskBuf[id].vx > +MAX_SPEED) TskBuf[id].vx = +MAX_SPEED;
144
				TskBuf[id].tx = cast(float)(rand() % 512) + 256.0f;
145
				TskBuf[id].ty = cast(float)(rand() % 512) + 256.0f;
146
				if(TskBuf[id].px < ship_px) TskBuf[id].tx = +TskBuf[id].tx;
147
				else						TskBuf[id].tx = -TskBuf[id].tx;
148
				if(TskBuf[id].py < ship_py) TskBuf[id].ty = +TskBuf[id].ty;
149
				else						TskBuf[id].ty = -TskBuf[id].ty;
150
				if(cast(float)(rand() % 100) > 97) TskBuf[id].tx = -TskBuf[id].tx;
151
				if(cast(float)(rand() % 100) > 97) TskBuf[id].ty = -TskBuf[id].ty;
152
				TskBuf[id].tx = TskBuf[id].px + TskBuf[id].tx;
153
				TskBuf[id].ty = TskBuf[id].py + TskBuf[id].ty;
154
				if(TskBuf[id].tx < -ENEMY_AREAMAX) TskBuf[id].tx = -ENEMY_AREAMAX + 1.0f;
155
				if(TskBuf[id].tx > +ENEMY_AREAMAX) TskBuf[id].tx = +ENEMY_AREAMAX - 1.0f;
156
				if(TskBuf[id].ty < -ENEMY_AREAMAX) TskBuf[id].ty = -ENEMY_AREAMAX + 1.0f;
157
				if(TskBuf[id].ty > +ENEMY_AREAMAX) TskBuf[id].ty = +ENEMY_AREAMAX - 1.0f;
158
				TskBuf[id].cnt = 180;
145
			}else{
159
			}else{
146
				if(TskBuf[id].vx < +0.0f) TskBuf[id].vx -= 1.0f / SPEED_RATE * 2.0f;
160
				TskBuf[id].cnt--;
147
				else					  TskBuf[id].vx -= 1.0f / SPEED_RATE * 1.5f;
148
				if(TskBuf[id].vx < -MAX_SPEED) TskBuf[id].vx = -MAX_SPEED;
149
			}
150
			if(TskBuf[id].py < ship_py){
151
				if(TskBuf[id].vy > +0.0f) TskBuf[id].vy += 1.0f / SPEED_RATE * 2.0f;
152
				else					  TskBuf[id].vy += 1.0f / SPEED_RATE * 1.5f;
153
				if(TskBuf[id].vy > +MAX_SPEED) TskBuf[id].vy = +MAX_SPEED;
154
			}else{
155
				if(TskBuf[id].vy < +0.0f) TskBuf[id].vy -= 1.0f / SPEED_RATE * 2.0f;
156
				else					  TskBuf[id].vy -= 1.0f / SPEED_RATE * 1.5f;
157
				if(TskBuf[id].vy < -MAX_SPEED) TskBuf[id].vy = -MAX_SPEED;
158
			}
159
			TskBuf[id].px += TskBuf[id].vx;
160
			TskBuf[id].py += TskBuf[id].vy;
161
			if(TskBuf[id].px < -ENEMY_AREAMAX){
162
				TskBuf[id].px = -ENEMY_AREAMAX;
163
				TskBuf[id].vx = -TskBuf[id].vx / 2;
164
			}
165
			if(TskBuf[id].px > +ENEMY_AREAMAX){
166
				TskBuf[id].px = +ENEMY_AREAMAX;
167
				TskBuf[id].vx = -TskBuf[id].vx / 2;
168
			}
169
			if(TskBuf[id].py < -ENEMY_AREAMAX){
170
				TskBuf[id].py = -ENEMY_AREAMAX;
171
				TskBuf[id].vy = -TskBuf[id].vy / 2;
172
			}
173
			if(TskBuf[id].py > +ENEMY_AREAMAX){
174
				TskBuf[id].py = +ENEMY_AREAMAX;
175
				TskBuf[id].vy = -TskBuf[id].vy / 2;
176
			}
161
			}
162
			TskBuf[id].px += (TskBuf[id].tx - TskBuf[id].px) / (180 / 4);
163
			TskBuf[id].py += (TskBuf[id].ty - TskBuf[id].py) / (180 / 4);
164
			TskBuf[id].vx -= TskBuf[id].px;
165
			TskBuf[id].vy -= TskBuf[id].py;
177
			TskBuf[id].rot = atan2(-TskBuf[id].vx, -TskBuf[id].vy);
166
			TskBuf[id].rot = atan2(-TskBuf[id].vx, -TskBuf[id].vy);
178
			break;
167
			break;
179
		default:
168
		default:
(-)a2k/a2k_src/src/enemy08.d (-5 / +5 lines)
Lines 6-12 Link Here
6
	2004/06/05 jumpei isshiki
6
	2004/06/05 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.math;
9
//private	import	std.math;
10
private	import	std.c.math;
10
private	import	std.c.math;
11
private	import	std.random;
11
private	import	std.random;
12
private	import	SDL;
12
private	import	SDL;
Lines 66-73 Link Here
66
	switch(TskBuf[id].step){
66
	switch(TskBuf[id].step){
67
		case	0:
67
		case	0:
68
			TskBuf[id].tskid |= TSKID_ZAKO;
68
			TskBuf[id].tskid |= TSKID_ZAKO;
69
			TskBuf[id].px = (rand() % 1536) - 768.0f;
69
			TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
70
			TskBuf[id].py = (rand() % 1536) - 768.0f;
70
			TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
71
			TskBuf[id].tid = ship_id;
71
			TskBuf[id].tid = ship_id;
72
			TskBuf[id].fp_int = null;
72
			TskBuf[id].fp_int = null;
73
			TskBuf[id].fp_draw = &TSKenemy08Draw;
73
			TskBuf[id].fp_draw = &TSKenemy08Draw;
Lines 113-119 Link Here
113
				TskBuf[id].step++;
113
				TskBuf[id].step++;
114
			}
114
			}
115
		case	2:
115
		case	2:
116
			/* ’eŒ‚‚¿ */
116
			/*  */
117
			if(cmd){
117
			if(cmd){
118
				if(TskBuf[id].bullet_wait){
118
				if(TskBuf[id].bullet_wait){
119
					if(cmd.isEnd()) TskBuf[id].bullet_wait--;
119
					if(cmd.isEnd()) TskBuf[id].bullet_wait--;
Lines 142-148 Link Here
142
					}
142
					}
143
				}
143
				}
144
			}
144
			}
145
			/* À•WXV */
145
			/* */
146
			if(TskBuf[id].px < ship_px){
146
			if(TskBuf[id].px < ship_px){
147
				if(TskBuf[id].vx > +0.0f) TskBuf[id].vx += 1.0f / SPEED_RATE * 3.0f;
147
				if(TskBuf[id].vx > +0.0f) TskBuf[id].vx += 1.0f / SPEED_RATE * 3.0f;
148
				else					  TskBuf[id].vx += 1.0f / SPEED_RATE * 1.0f;
148
				else					  TskBuf[id].vx += 1.0f / SPEED_RATE * 1.0f;
(-)a2k/a2k_src/src/enemy.d (-1 / +7 lines)
Lines 6-12 Link Here
6
	2004/04/14 jumpei isshiki
6
	2004/04/14 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.math;
9
//private	import	std.math;
10
private	import	std.c.math;
10
private	import	std.c.math;
11
private	import	SDL;
11
private	import	SDL;
12
private	import	opengl;
12
private	import	opengl;
Lines 159-164 Link Here
159
	return;
159
	return;
160
}
160
}
161
161
162
162
void	TSKeshotInt(int id)
163
void	TSKeshotInt(int id)
163
{
164
{
164
	TskBuf[id].step = -1;
165
	TskBuf[id].step = -1;
Lines 166-171 Link Here
166
	return;
167
	return;
167
}
168
}
168
169
170
169
void	TSKeshotDrawSimple(int id)
171
void	TSKeshotDrawSimple(int id)
170
{
172
{
171
	float[XYZ]	pos;
173
	float[XYZ]	pos;
Lines 199-204 Link Here
199
	glEnd();
201
	glEnd();
200
}
202
}
201
203
204
202
void	TSKeshotDrawActive(int id)
205
void	TSKeshotDrawActive(int id)
203
{
206
{
204
	float[XYZ]	pos;
207
	float[XYZ]	pos;
Lines 232-237 Link Here
232
	glEnd();
235
	glEnd();
233
}
236
}
234
237
238
235
void	TSKeshotExit(int id)
239
void	TSKeshotExit(int id)
236
{
240
{
237
	BulletCommand	cmd = TskBuf[id].bullet_command;
241
	BulletCommand	cmd = TskBuf[id].bullet_command;
Lines 244-249 Link Here
244
	}
248
	}
245
}
249
}
246
250
251
247
float	getShipDirection(int id)
252
float	getShipDirection(int id)
248
{
253
{
249
	float	px,py;
254
	float	px,py;
Lines 258-260 Link Here
258
	return	dir;
263
	return	dir;
259
}
264
}
260
265
266
(-)a2k/a2k_src/src/init.d (-68 / +69 lines)
Lines 6-12 Link Here
6
	2003/12/01 jumpei isshiki
6
	2003/12/01 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.stdio;
9
private	import	std.c.stdio;
10
private	import	std.stream;
10
private	import	std.stream;
11
private	import	util_sdl;
11
private	import	util_sdl;
12
private	import	util_snd;
12
private	import	util_snd;
Lines 17-54 Link Here
17
17
18
void	grpINIT()
18
void	grpINIT()
19
{
19
{
20
	readSDLtexture("title.bmp", GRP_TITLE);
20
	readSDLtexture("/usr/share/games/area2048/title.bmp", GRP_TITLE);
21
}
21
}
22
22
23
void	sndINIT()
23
void	sndINIT()
24
{
24
{
25
	/* ‹È */
25
	
26
	loadSNDmusic("stg01.ogg",SND_BGM01);
26
	loadSNDmusic("/usr/share/games/area2048/stg01.ogg",SND_BGM01);
27
	loadSNDmusic("stg02.ogg",SND_BGM02);
27
	loadSNDmusic("/usr/share/games/area2048/stg02.ogg",SND_BGM02);
28
	loadSNDmusic("stg03.ogg",SND_BGM03);
28
	loadSNDmusic("/usr/share/games/area2048/stg03.ogg",SND_BGM03);
29
	loadSNDmusic("stg04.ogg",SND_BGM04);
29
	loadSNDmusic("/usr/share/games/area2048/stg04.ogg",SND_BGM04);
30
	loadSNDmusic("stg05.ogg",SND_BGM05);
30
	loadSNDmusic("/usr/share/games/area2048/stg05.ogg",SND_BGM05);
31
	loadSNDmusic("boss01.ogg",SND_BOSS01);
31
	loadSNDmusic("/usr/share/games/area2048/boss01.ogg",SND_BOSS01);
32
	loadSNDmusic("boss02.ogg",SND_BOSS02);
32
	loadSNDmusic("/usr/share/games/area2048/boss02.ogg",SND_BOSS02);
33
	/* SE */
33
	/* SE */
34
	loadSNDse("se_sdest.wav",SND_SE_SDEST,1);
34
	loadSNDse("/usr/share/games/area2048/se_sdest.wav",SND_SE_SDEST,1);
35
	loadSNDse("se_dmg01.wav",SND_SE_EDMG,2);
35
	loadSNDse("/usr/share/games/area2048/se_dmg01.wav",SND_SE_EDMG,2);
36
	loadSNDse("se_explode01.wav",SND_SE_EDEST,3);
36
	loadSNDse("/usr/share/games/area2048/se_explode01.wav",SND_SE_EDEST,3);
37
	loadSNDse("se_explode02.wav",SND_SE_EEXP01,3);
37
	loadSNDse("/usr/share/games/area2048/se_explode02.wav",SND_SE_EEXP01,3);
38
	loadSNDse("se_explode03.wav",SND_SE_EEXP02,3);
38
	loadSNDse("/usr/share/games/area2048/se_explode03.wav",SND_SE_EEXP02,3);
39
	loadSNDse("se_cursole.wav",SND_SE_CURSOLE,1);
39
	loadSNDse("/usr/share/games/area2048/se_cursole.wav",SND_SE_CURSOLE,1);
40
	loadSNDse("se_correct.wav",SND_SE_CORRECT,1);
40
	loadSNDse("/usr/share/games/area2048/se_correct.wav",SND_SE_CORRECT,1);
41
	loadSNDse("se_cancel.wav",SND_SE_CANCEL,1);
41
	loadSNDse("/usr/share/games/area2048/se_cancel.wav",SND_SE_CANCEL,1);
42
	loadSNDse("se_lock_on.wav",SND_SE_LOCK_ON,1);
42
	loadSNDse("/usr/share/games/area2048/se_lock_on.wav",SND_SE_LOCK_ON,1);
43
	loadSNDse("se_lock_off.wav",SND_SE_LOCK_OFF,1);
43
	loadSNDse("/usr/share/games/area2048/se_lock_off.wav",SND_SE_LOCK_OFF,1);
44
	/* VOICE */
44
	/* VOICE */
45
	loadSNDse("voice04.wav",SND_VOICE_GETREADY,7);
45
	loadSNDse("/usr/share/games/area2048/voice04.wav",SND_VOICE_GETREADY,7);
46
	loadSNDse("voice06.wav",SND_VOICE_EXTEND,6);
46
	loadSNDse("/usr/share/games/area2048/voice06.wav",SND_VOICE_EXTEND,6);
47
	loadSNDse("voice07.wav",SND_VOICE_CHARGE,5);
47
	loadSNDse("/usr/share/games/area2048/voice07.wav",SND_VOICE_CHARGE,5);
48
	loadSNDse("voice08.wav",SND_VOICE_SCENE,7);
48
	loadSNDse("/usr/share/games/area2048/voice08.wav",SND_VOICE_SCENE,7);
49
	loadSNDse("voice09.wav",SND_VOICE_COMPLETE,7);
49
	loadSNDse("/usr/share/games/area2048/voice09.wav",SND_VOICE_COMPLETE,7);
50
	loadSNDse("voice10.wav",SND_VOICE_EMERGENCY,7);
50
	loadSNDse("/usr/share/games/area2048/voice10.wav",SND_VOICE_EMERGENCY,7);
51
	loadSNDse("voice11.wav",SND_VOICE_AREA,7);
51
	loadSNDse("/usr/share/games/area2048/voice11.wav",SND_VOICE_AREA,7);
52
52
53
	volumeSNDse(vol_se);
53
	volumeSNDse(vol_se);
54
	volumeSNDmusic(vol_music);
54
	volumeSNDmusic(vol_music);
Lines 58-92 Link Here
58
{
58
{
59
	/* BULLET */
59
	/* BULLET */
60
	initBulletcommandParser(256);
60
	initBulletcommandParser(256);
61
	readBulletcommandParser( BULLET_SHIP01, "bullet01.xml");
61
	readBulletcommandParser( BULLET_SHIP01, "/usr/share/games/area2048/bullet01.xml");
62
	readBulletcommandParser( BULLET_SHIP02, "bullet02.xml");
62
	readBulletcommandParser( BULLET_SHIP02, "/usr/share/games/area2048/bullet02.xml");
63
	readBulletcommandParser( BULLET_ZAKO03, "bulletzako03.xml");
63
	readBulletcommandParser( BULLET_ZAKO03, "/usr/share/games/area2048/bulletzako03.xml");
64
	readBulletcommandParser( BULLET_ZAKO04, "bulletzako04.xml");
64
	readBulletcommandParser( BULLET_ZAKO04, "/usr/share/games/area2048/bulletzako04.xml");
65
	readBulletcommandParser( BULLET_ZAKO05, "bulletzako05.xml");
65
	readBulletcommandParser( BULLET_ZAKO05, "/usr/share/games/area2048/bulletzako05.xml");
66
	readBulletcommandParser( BULLET_ZAKO06, "bulletzako06.xml");
66
	readBulletcommandParser( BULLET_ZAKO06, "/usr/share/games/area2048/bulletzako06.xml");
67
	readBulletcommandParser( BULLET_ZAKO07, "bulletzako07.xml");
67
	readBulletcommandParser( BULLET_ZAKO07, "/usr/share/games/area2048/bulletzako07.xml");
68
	readBulletcommandParser( BULLET_ZAKO08, "bulletzako08.xml");
68
	readBulletcommandParser( BULLET_ZAKO08, "/usr/share/games/area2048/bulletzako08.xml");
69
	readBulletcommandParser( BULLET_MIDDLE01, "bulletmid01.xml");
69
	readBulletcommandParser( BULLET_MIDDLE01, "/usr/share/games/area2048/bulletmid01.xml");
70
	readBulletcommandParser( BULLET_MIDDLE02, "bulletmid02.xml");
70
	readBulletcommandParser( BULLET_MIDDLE02, "/usr/share/games/area2048/bulletmid02.xml");
71
	readBulletcommandParser( BULLET_MIDDLE03, "bulletmid03.xml");
71
	readBulletcommandParser( BULLET_MIDDLE03, "/usr/share/games/area2048/bulletmid03.xml");
72
	readBulletcommandParser( BULLET_MIDDLE04, "bulletmid04.xml");
72
	readBulletcommandParser( BULLET_MIDDLE04, "/usr/share/games/area2048/bulletmid04.xml");
73
	readBulletcommandParser( BULLET_MIDDLE05, "bulletmid05.xml");
73
	readBulletcommandParser( BULLET_MIDDLE05, "/usr/share/games/area2048/bulletmid05.xml");
74
	readBulletcommandParser( BULLET_BOSS0101, "bulletboss0101.xml");
74
	readBulletcommandParser( BULLET_BOSS0101, "/usr/share/games/area2048/bulletboss0101.xml");
75
	readBulletcommandParser( BULLET_BOSS0102, "bulletboss0102.xml");
75
	readBulletcommandParser( BULLET_BOSS0102, "/usr/share/games/area2048/bulletboss0102.xml");
76
	readBulletcommandParser( BULLET_BOSS0201, "bulletboss0201.xml");
76
	readBulletcommandParser( BULLET_BOSS0201, "/usr/share/games/area2048/bulletboss0201.xml");
77
	readBulletcommandParser( BULLET_BOSS0202, "bulletboss0202.xml");
77
	readBulletcommandParser( BULLET_BOSS0202, "/usr/share/games/area2048/bulletboss0202.xml");
78
	readBulletcommandParser( BULLET_BOSS0301, "bulletboss0301.xml");
78
	readBulletcommandParser( BULLET_BOSS0301, "/usr/share/games/area2048/bulletboss0301.xml");
79
	readBulletcommandParser( BULLET_BOSS0302, "bulletboss0302.xml");
79
	readBulletcommandParser( BULLET_BOSS0302, "/usr/share/games/area2048/bulletboss0302.xml");
80
	readBulletcommandParser( BULLET_BOSS0401, "bulletboss0401.xml");
80
	readBulletcommandParser( BULLET_BOSS0401, "/usr/share/games/area2048/bulletboss0401.xml");
81
	readBulletcommandParser( BULLET_BOSS0402, "bulletboss0402.xml");
81
	readBulletcommandParser( BULLET_BOSS0402, "/usr/share/games/area2048/bulletboss0402.xml");
82
	readBulletcommandParser( BULLET_BOSS0403, "bulletboss0403.xml");
82
	readBulletcommandParser( BULLET_BOSS0403, "/usr/share/games/area2048/bulletboss0403.xml");
83
	readBulletcommandParser( BULLET_BOSS0404, "bulletboss0404.xml");
83
	readBulletcommandParser( BULLET_BOSS0404, "/usr/share/games/area2048/bulletboss0404.xml");
84
	readBulletcommandParser( BULLET_BOSS0501, "bulletboss0501.xml");
84
	readBulletcommandParser( BULLET_BOSS0501, "/usr/share/games/area2048/bulletboss0501.xml");
85
	readBulletcommandParser( BULLET_BOSS0502, "bulletboss0502.xml");
85
	readBulletcommandParser( BULLET_BOSS0502, "/usr/share/games/area2048/bulletboss0502.xml");
86
	readBulletcommandParser( BULLET_BOSS0503, "bulletboss0503.xml");
86
	readBulletcommandParser( BULLET_BOSS0503, "/usr/share/games/area2048/bulletboss0503.xml");
87
	readBulletcommandParser( BULLET_BOSS0504, "bulletboss0504.xml");
87
	readBulletcommandParser( BULLET_BOSS0504, "/usr/share/games/area2048/bulletboss0504.xml");
88
	readBulletcommandParser( BULLET_BOSS0505, "bulletboss0505.xml");
88
	readBulletcommandParser( BULLET_BOSS0505, "/usr/share/games/area2048/bulletboss0505.xml");
89
	readBulletcommandParser( BULLET_BOSS0506, "bulletboss0506.xml");
89
	readBulletcommandParser( BULLET_BOSS0506, "/usr/share/games/area2048/bulletboss0506.xml");
90
}
90
}
91
91
92
void	configINIT()
92
void	configINIT()
Lines 97-107 Link Here
97
97
98
	auto File fd = new File;
98
	auto File fd = new File;
99
	try {
99
	try {
100
		fd.open("score.dat");
100
		fd.open("/var/games/a2kscore.dat");
101
		if(fd.size() != 12){
101
		if(fd.size() != 12){
102
			fd.close();
102
			fd.close();
103
			writefln("score.dat initialized");
103
			//writefln("score.dat initialized");
104
		    fd.create("score.dat");
104
			printf("a2kscore.dat initialized\n");
105
		    fd.create("/var/games/a2kscore.dat");
105
			fd.write(high_easy);
106
			fd.write(high_easy);
106
			fd.write(high_normal);
107
			fd.write(high_normal);
107
			fd.write(high_hard);
108
			fd.write(high_hard);
Lines 111-118 Link Here
111
			fd.read(high_hard);
112
			fd.read(high_hard);
112
		}
113
		}
113
	} catch (Error e) {
114
	} catch (Error e) {
114
		writefln("score.dat initialized");
115
		printf("a2kscore.dat initialized\n");
115
	    fd.create("score.dat");
116
	    fd.create("/var/games/a2kscore.dat");
116
		fd.write(high_easy);
117
		fd.write(high_easy);
117
		fd.write(high_normal);
118
		fd.write(high_normal);
118
		fd.write(high_hard);
119
		fd.write(high_hard);
Lines 121-132 Link Here
121
		fd.close();
122
		fd.close();
122
    }
123
    }
123
124
124
	fd.open("config.dat");
125
	fd.open("/var/games/a2kconfig.dat");
125
	try {
126
	try {
126
		if(fd.size() != 12){
127
		if(fd.size() != 12){
127
			fd.close();
128
			fd.close();
128
			writefln("config.dat initialized");
129
			printf("a2kconfig.dat initialized\n");
129
		    fd.create("config.dat");
130
		    fd.create("/var/games/a2kconfig.dat");
130
			fd.write(pad_type);
131
			fd.write(pad_type);
131
			fd.write(vol_se);
132
			fd.write(vol_se);
132
			fd.write(vol_music);
133
			fd.write(vol_music);
Lines 138-145 Link Here
138
			volumeSNDmusic(vol_music);
139
			volumeSNDmusic(vol_music);
139
		}
140
		}
140
	} catch (Error e) {
141
	} catch (Error e) {
141
		writefln("config.dat initialized");
142
		printf("a2kconfig.dat initialized\n");
142
	    fd.create("config.dat");
143
	    fd.create("/var/games/a2config.dat");
143
		fd.write(pad_type);
144
		fd.write(pad_type);
144
		fd.write(vol_se);
145
		fd.write(vol_se);
145
		fd.write(vol_music);
146
		fd.write(vol_music);
Lines 152-164 Link Here
152
void	configSAVE()
153
void	configSAVE()
153
{
154
{
154
	auto File fd = new File;
155
	auto File fd = new File;
155
    fd.create("score.dat");
156
    fd.create("/var/games/a2kscore.dat");
156
	fd.write(high_easy);
157
	fd.write(high_easy);
157
	fd.write(high_normal);
158
	fd.write(high_normal);
158
	fd.write(high_hard);
159
	fd.write(high_hard);
159
	fd.close();
160
	fd.close();
160
161
161
    fd.create("config.dat");
162
    fd.create("/var/games/a2kconfig.dat");
162
	fd.write(pad_type);
163
	fd.write(pad_type);
163
	fd.write(vol_se);
164
	fd.write(vol_se);
164
	fd.write(vol_music);
165
	fd.write(vol_music);
(-)a2k/a2k_src/src/luminous.d (-2 / +2 lines)
Lines 7-13 Link Here
7
*/
7
*/
8
8
9
private	import std.math;
9
private	import std.math;
10
private	import std.string;
10
private	import std.c.string;
11
private	import opengl;
11
private	import opengl;
12
private	import util_sdl;
12
private	import util_sdl;
13
private	import task;
13
private	import task;
Lines 69-75 Link Here
69
69
70
static	void	makeLuminousTexture()
70
static	void	makeLuminousTexture()
71
{
71
{
72
	uint *data = td;
72
	uint *data = td.ptr;
73
	int i;
73
	int i;
74
74
75
	memset(data, 0, luminousTextureWidth * luminousTextureHeight * 4 * uint.sizeof);
75
	memset(data, 0, luminousTextureWidth * luminousTextureHeight * 4 * uint.sizeof);
(-)a2k/a2k_src/src/main.d (-22 / +24 lines)
Lines 6-13 Link Here
6
	2003/11/28 jumpei isshiki
6
	2003/11/28 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.c.windows.windows;
9
//private	import	std.c.windows.windows;
10
private	import	SDL;
10
private	import	SDL;
11
private	import	SDL_Keysym;
11
private	import	opengl;
12
private	import	opengl;
12
private	import	util_sdl;
13
private	import	util_sdl;
13
private	import	util_pad;
14
private	import	util_pad;
Lines 32-54 Link Here
32
int		pause_flag = 0;
33
int		pause_flag = 0;
33
int		skip = 0;
34
int		skip = 0;
34
35
35
extern (Windows)
36
//extern (Windows)
36
int		WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
37
//int		WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
37
{
38
39
public int main(char[][] args) {
38
	int		result;
40
	int		result;
39
  
41
40
	gc_init();
42
//	gc_init();
41
	_minit();
43
//	_minit();
42
44
43
	try{
45
//	try{
44
		_moduleCtor();
46
//		_moduleCtor();
45
		_moduleUnitTests();
47
//		_moduleUnitTests();
46
		result = boot();
48
		result = boot();
47
	}catch (Object o){
49
//	}catch (Object o){
48
		MessageBoxA(null, o.toString(), "Error", MB_OK | MB_ICONEXCLAMATION);
50
//		MessageBoxA(null, o.toString(), "Error", MB_OK | MB_ICONEXCLAMATION);
49
		result = 0;
51
//		result = 0;
50
	}
52
//	}
51
	gc_term();
53
//	gc_term();
52
54
53
	return result;
55
	return result;
54
}
56
}
Lines 158-164 Link Here
158
	int	prev;
160
	int	prev;
159
	int	group;
161
	int	group;
160
162
161
	/* Ž©‹@’e */
163
	/*  */
162
	group = GROUP_04;
164
	group = GROUP_04;
163
	for(int i = TskIndex[group]; i != -1; i = prev){
165
	for(int i = TskIndex[group]; i != -1; i = prev){
164
		prev = TskBuf[i].prev;
166
		prev = TskBuf[i].prev;
Lines 166-172 Link Here
166
			collision_sub1(i, GROUP_02);
168
			collision_sub1(i, GROUP_02);
167
		}
169
		}
168
	}
170
	}
169
	/* Ž©‹@ */
171
	/**/
170
	if(TskBuf[ship_id].tskid != 0 && TskBuf[ship_id].fp_int) collision_sub2(ship_id, GROUP_02);
172
	if(TskBuf[ship_id].tskid != 0 && TskBuf[ship_id].fp_int) collision_sub2(ship_id, GROUP_02);
171
	if(TskBuf[ship_id].tskid != 0 && TskBuf[ship_id].fp_int) collision_sub3(ship_id, GROUP_06);
173
	if(TskBuf[ship_id].tskid != 0 && TskBuf[ship_id].fp_int) collision_sub3(ship_id, GROUP_06);
172
174
Lines 188-194 Link Here
188
	sex = cast(int)(TskBuf[id].px + TskBuf[id].cx);
190
	sex = cast(int)(TskBuf[id].px + TskBuf[id].cx);
189
	sey = cast(int)(TskBuf[id].py + TskBuf[id].cy);
191
	sey = cast(int)(TskBuf[id].py + TskBuf[id].cy);
190
192
191
	/* “G */
193
	/*  */
192
	for(int i = TskIndex[group]; i != -1; i = prev){
194
	for(int i = TskIndex[group]; i != -1; i = prev){
193
		prev = TskBuf[i].prev;
195
		prev = TskBuf[i].prev;
194
		if(TskBuf[i].tskid != 0 && TskBuf[i].fp_int){
196
		if(TskBuf[i].tskid != 0 && TskBuf[i].fp_int){
Lines 227-233 Link Here
227
	sex = cast(int)(TskBuf[id].px + TskBuf[id].cx);
229
	sex = cast(int)(TskBuf[id].px + TskBuf[id].cx);
228
	sey = cast(int)(TskBuf[id].py + TskBuf[id].cy);
230
	sey = cast(int)(TskBuf[id].py + TskBuf[id].cy);
229
231
230
	/* “G */
232
	/*  */
231
	for(int i = TskIndex[group]; i != -1; i = prev){
233
	for(int i = TskIndex[group]; i != -1; i = prev){
232
		prev = TskBuf[i].prev;
234
		prev = TskBuf[i].prev;
233
		if(TskBuf[i].tskid != 0 && TskBuf[i].fp_int){
235
		if(TskBuf[i].tskid != 0 && TskBuf[i].fp_int){
Lines 264-270 Link Here
264
	sex = cast(int)(TskBuf[id].px + TskBuf[id].cx);
266
	sex = cast(int)(TskBuf[id].px + TskBuf[id].cx);
265
	sey = cast(int)(TskBuf[id].py + TskBuf[id].cy);
267
	sey = cast(int)(TskBuf[id].py + TskBuf[id].cy);
266
268
267
	/* “G’e */
269
	/*  */
268
	for(int i = TskIndex[group]; i != -1; i = prev){
270
	for(int i = TskIndex[group]; i != -1; i = prev){
269
		prev = TskBuf[i].prev;
271
		prev = TskBuf[i].prev;
270
		if(TskBuf[i].tskid != 0 && TskBuf[i].fp_int){
272
		if(TskBuf[i].tskid != 0 && TskBuf[i].fp_int){
(-)a2k/a2k_src/src/middle01.d (-1 / +1 lines)
Lines 6-12 Link Here
6
	2004/05/05 jumpei isshiki
6
	2004/05/05 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.math;
9
//private	import	std.math;
10
private	import	std.c.math;
10
private	import	std.c.math;
11
private	import	std.random;
11
private	import	std.random;
12
private	import	std.string;
12
private	import	std.string;
(-)a2k/a2k_src/src/middle02.d (-1 / +1 lines)
Lines 6-12 Link Here
6
	2004/06/03 jumpei isshiki
6
	2004/06/03 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.math;
9
//private	import	std.math;
10
private	import	std.c.math;
10
private	import	std.c.math;
11
private	import	std.random;
11
private	import	std.random;
12
private	import	std.string;
12
private	import	std.string;
(-)a2k/a2k_src/src/middle03.d (-1 / +1 lines)
Lines 6-12 Link Here
6
	2004/06/07 jumpei isshiki
6
	2004/06/07 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.math;
9
//private	import	std.math;
10
private	import	std.c.math;
10
private	import	std.c.math;
11
private	import	std.random;
11
private	import	std.random;
12
private	import	std.string;
12
private	import	std.string;
(-)a2k/a2k_src/src/middle04.d (-1 / +1 lines)
Lines 6-12 Link Here
6
	2004/07/05 jumpei isshiki
6
	2004/07/05 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.math;
9
//private	import	std.math;
10
private	import	std.c.math;
10
private	import	std.c.math;
11
private	import	std.random;
11
private	import	std.random;
12
private	import	std.string;
12
private	import	std.string;
(-)a2k/a2k_src/src/middle05.d (-1 / +1 lines)
Lines 6-12 Link Here
6
	2004/07/06 jumpei isshiki
6
	2004/07/06 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.math;
9
//private	import	std.math;
10
private	import	std.c.math;
10
private	import	std.c.math;
11
private	import	std.random;
11
private	import	std.random;
12
private	import	std.string;
12
private	import	std.string;
(-)a2k/a2k_src/src/ship.d (-15 / +15 lines)
Lines 6-12 Link Here
6
	2003/12/01 jumpei isshiki
6
	2003/12/01 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.math;
9
//private	import	std.math;
10
private	import	std.intrinsic;
10
private	import	std.intrinsic;
11
private	import	std.random;
11
private	import	std.random;
12
private	import	std.c.math;
12
private	import	std.c.math;
Lines 204-210 Link Here
204
			old_dat = pad_dat;
204
			old_dat = pad_dat;
205
			pad_dat = getAttractPadData(id);
205
			pad_dat = getAttractPadData(id);
206
			trg_dat = getAttractTrgData(id,pad_dat,old_dat);
206
			trg_dat = getAttractTrgData(id,pad_dat,old_dat);
207
			/* ƒƒbƒNˆ— */
207
			
208
			ship_trg = getNearEnemy(id,512.0f);
208
			ship_trg = getNearEnemy(id,512.0f);
209
			if((trg_dat & PAD_SHOT) && ship_trg != -1){
209
			if((trg_dat & PAD_SHOT) && ship_trg != -1){
210
				ship_lock = 1;
210
				ship_lock = 1;
Lines 213-219 Link Here
213
				ship_lock = 0;
213
				ship_lock = 0;
214
				TskBuf[id].trg_id = -1;
214
				TskBuf[id].trg_id = -1;
215
			}
215
			}
216
			/* •ûŒüŽæ“¾(•qŠ´‚É”½‰ž‚µ‚È‚¢‚½‚߂̏ˆ—) */
216
			
217
			int	trg = trg_dat & PAD_DIR;
217
			int	trg = trg_dat & PAD_DIR;
218
			int	pad = pad_dat & PAD_DIR;
218
			int	pad = pad_dat & PAD_DIR;
219
			if(trg){
219
			if(trg){
Lines 229-235 Link Here
229
				ship_pbk = 0;
229
				ship_pbk = 0;
230
				ship_cnt = 0;
230
				ship_cnt = 0;
231
			}
231
			}
232
			/* ‘¬“x••ûŒüÝ’è */
232
			
233
			if(ship_lock == 0){
233
			if(ship_lock == 0){
234
				if(ship_pad) TskBuf[id].rot = ship_move[ship_pad][0];
234
				if(ship_pad) TskBuf[id].rot = ship_move[ship_pad][0];
235
			}else{
235
			}else{
Lines 243-249 Link Here
243
				TskBuf[id].ax *= 1.5f;
243
				TskBuf[id].ax *= 1.5f;
244
				TskBuf[id].ay *= 1.5f;
244
				TskBuf[id].ay *= 1.5f;
245
			}
245
			}
246
			/* ‰ÁŒ¸‘¬ */
246
			
247
			acc = ACC_RATE;
247
			acc = ACC_RATE;
248
			if(TskBuf[id].ax != 0.0f){
248
			if(TskBuf[id].ax != 0.0f){
249
				if(TskBuf[id].vx < TskBuf[id].ax){
249
				if(TskBuf[id].vx < TskBuf[id].ax){
Lines 269-275 Link Here
269
			}else{
269
			}else{
270
				TskBuf[id].vy -= TskBuf[id].vy / (acc * 2.0f);
270
				TskBuf[id].vy -= TskBuf[id].vy / (acc * 2.0f);
271
			}
271
			}
272
			/* À•WXV */
272
			
273
			TskBuf[id].px += TskBuf[id].vx;
273
			TskBuf[id].px += TskBuf[id].vx;
274
			TskBuf[id].py += TskBuf[id].vy;
274
			TskBuf[id].py += TskBuf[id].vy;
275
			if(TskBuf[id].px < -SHIP_AREAMAX){
275
			if(TskBuf[id].px < -SHIP_AREAMAX){
Lines 296-302 Link Here
296
			ship_py = TskBuf[id].py;
296
			ship_py = TskBuf[id].py;
297
			TskBuf[id].tx = TskBuf[id].px + sin(TskBuf[id].rot) * 1.0f;
297
			TskBuf[id].tx = TskBuf[id].px + sin(TskBuf[id].rot) * 1.0f;
298
			TskBuf[id].ty = TskBuf[id].py + cos(TskBuf[id].rot) * 1.0f;
298
			TskBuf[id].ty = TskBuf[id].py + cos(TskBuf[id].rot) * 1.0f;
299
			/* ƒ{ƒ€ */
299
			
300
			if(!enemy_stg) BombOFF();
300
			if(!enemy_stg) BombOFF();
301
			if(TskBuf[id].step == 2){
301
			if(TskBuf[id].step == 2){
302
				if(bomb && BombTST() && (trg_dat & PAD_BOMB)){
302
				if(bomb && BombTST() && (trg_dat & PAD_BOMB)){
Lines 304-310 Link Here
304
					BombEXEC();
304
					BombEXEC();
305
				}
305
				}
306
			}
306
			}
307
			/* ƒVƒ‡ƒbƒg */
307
			
308
			if(BombTSTwait()){
308
			if(BombTSTwait()){
309
				cmd.vanish();
309
				cmd.vanish();
310
				BombSTOP();
310
				BombSTOP();
Lines 331-343 Link Here
331
					else			 cmd.set(id, BULLET_SHIP02);
331
					else			 cmd.set(id, BULLET_SHIP02);
332
				}
332
				}
333
			}
333
			}
334
			/* ƒ{ƒ€—­‚ß */
334
			
335
			if(BombTST()){
335
			if(BombTST()){
336
				if((pad_dat & PAD_SHOT)) BmbGaugeAdd(BOMB_ADD_MIN);
336
				if((pad_dat & PAD_SHOT)) BmbGaugeAdd(BOMB_ADD_MIN);
337
				else					 BmbGaugeAdd(BOMB_ADD_MAX);
337
				else					 BmbGaugeAdd(BOMB_ADD_MAX);
338
				BombREMAINscore();
338
				BombREMAINscore();
339
			}
339
			}
340
			/* ŽžŠÔƒ`ƒFƒbƒN */
340
			
341
			if(time_flag && !time_left){
341
			if(time_flag && !time_left){
342
				playSNDse(SND_SE_SDEST);
342
				playSNDse(SND_SE_SDEST);
343
				effSetBrokenLine(id, ship_line,  0, 10, 0.0f, 0.0f);
343
				effSetBrokenLine(id, ship_line,  0, 10, 0.0f, 0.0f);
Lines 352-358 Link Here
352
				TskBuf[id].step = 255;
352
				TskBuf[id].step = 255;
353
				break;
353
				break;
354
			}
354
			}
355
			/* ƒNƒŠƒAƒ`ƒFƒbƒN */
355
			
356
			if(!enemy_stg){
356
			if(!enemy_stg){
357
				TskBuf[id].fp_int = null;
357
				TskBuf[id].fp_int = null;
358
				TskBuf[id].tskid |= TSKID_MUTEKI;
358
				TskBuf[id].tskid |= TSKID_MUTEKI;
Lines 387-393 Link Here
387
			cmd.vanish();
387
			cmd.vanish();
388
			TskBuf[id].step++;
388
			TskBuf[id].step++;
389
		case	102:
389
		case	102:
390
			/* À•WXV */
390
			
391
			acc = ACC_RATE;
391
			acc = ACC_RATE;
392
			TskBuf[id].vx -= TskBuf[id].vx / (acc * 2.0f);
392
			TskBuf[id].vx -= TskBuf[id].vx / (acc * 2.0f);
393
			TskBuf[id].vy -= TskBuf[id].vy / (acc * 2.0f);
393
			TskBuf[id].vy -= TskBuf[id].vy / (acc * 2.0f);
Lines 423-429 Link Here
423
			acc = ACC_RATE;
423
			acc = ACC_RATE;
424
			BombOFF();
424
			BombOFF();
425
			TskBuf[id].alpha = 1.00f;
425
			TskBuf[id].alpha = 1.00f;
426
			/* À•WXV */
426
			
427
			TskBuf[id].vx -= TskBuf[id].vx / (acc * 2.0f);
427
			TskBuf[id].vx -= TskBuf[id].vx / (acc * 2.0f);
428
			TskBuf[id].vy -= TskBuf[id].vy / (acc * 2.0f);
428
			TskBuf[id].vy -= TskBuf[id].vy / (acc * 2.0f);
429
			TskBuf[id].px += TskBuf[id].vx;
429
			TskBuf[id].px += TskBuf[id].vx;
Lines 1059-1065 Link Here
1059
	int	eid = getNearEnemy(id, 4096.0f);
1059
	int	eid = getNearEnemy(id, 4096.0f);
1060
	int	pad = 0;
1060
	int	pad = 0;
1061
1061
1062
	/* ˆÚ“® */
1062
	
1063
	if(eid != -1){
1063
	if(eid != -1){
1064
		if(TskBuf[id].px > TskBuf[eid].px){
1064
		if(TskBuf[id].px > TskBuf[eid].px){
1065
			pad |= PAD_RIGHT;
1065
			pad |= PAD_RIGHT;
Lines 1085-1091 Link Here
1085
		demo_eid = eid;
1085
		demo_eid = eid;
1086
	}
1086
	}
1087
1087
1088
	/* ƒVƒ‡ƒbƒg */
1088
	
1089
	if(!demo_fire && eid != -1){
1089
	if(!demo_fire && eid != -1){
1090
		demo_fire = rand() % 120 + 120;
1090
		demo_fire = rand() % 120 + 120;
1091
	}else{
1091
	}else{
(-)a2k/a2k_src/src/stg.d (-19 / +30 lines)
Lines 91-115 Link Here
91
void	TSKstgCtrl(int id)
91
void	TSKstgCtrl(int id)
92
{
92
{
93
	switch(TskBuf[id].step){
93
	switch(TskBuf[id].step){
94
		case	0:
94
		case	0:
95
			area_num = AREA_01;
95
			area_num = AREA_01;
96
			scene_num = SCENE_01;
96
			scene_num = SCENE_01;
97
			debug{
97
98
				//area_num = AREA_02;
98
			switch(area_num){
99
				//area_num = AREA_03;
99
				case	AREA_01:
100
				//area_num = AREA_04;
100
					stg_ctrl = STG_MAIN;
101
				//area_num = AREA_05;
101
					setTSK(GROUP_01,&TSKstg01);
102
				//scene_num = SCENE_02;
102
					break;
103
				//scene_num = SCENE_03;
103
				case	AREA_02:
104
				//scene_num = SCENE_04;
104
					stg_ctrl = STG_MAIN;
105
				//scene_num = SCENE_05;
105
					setTSK(GROUP_01,&TSKstg02);
106
				//scene_num = SCENE_06;
106
					break;
107
				//scene_num = SCENE_07;
107
				case	AREA_03:
108
				//scene_num = SCENE_08;
108
					stg_ctrl = STG_MAIN;
109
				//scene_num = SCENE_09;
109
					setTSK(GROUP_01,&TSKstg03);
110
				//scene_num = SCENE_10;
110
					break;
111
			}
111
				case	AREA_04:
112
			stg_bgm = -1;
112
					stg_ctrl = STG_MAIN;
113
					setTSK(GROUP_01,&TSKstg04);
114
					break;
115
				case	AREA_05:
116
					stg_ctrl = STG_MAIN;
117
					setTSK(GROUP_01,&TSKstg05);
118
					break;
119
				default:
120
					g_step = GSTEP_CLEAR;
121
					break;
122
			}
123
			stg_bgm = -1;
113
			stg_ctrl = STG_INIT;
124
			stg_ctrl = STG_INIT;
114
			TskBuf[id].step++;
125
			TskBuf[id].step++;
115
			break;
126
			break;
Lines 177-183 Link Here
177
{
188
{
178
	switch(TskBuf[id].step){
189
	switch(TskBuf[id].step){
179
		case	0:
190
		case	0:
180
			stg_ctrl = STG_INIT;
191
//			stg_ctrl = ;
181
			TskBuf[id].step++;
192
			TskBuf[id].step++;
182
			break;
193
			break;
183
		case	1:
194
		case	1:
(-)a2k/a2k_src/src/system.d (-13 / +18 lines)
Lines 6-12 Link Here
6
	2004/03/24 jumpei isshiki
6
	2004/03/24 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.stdio;
9
private	import	std.c.stdio;
10
private	import	std.math;
10
private	import	std.math;
11
private	import	std.random;
11
private	import	std.random;
12
private	import	std.string;
12
private	import	std.string;
Lines 22-27 Link Here
22
private	import	stg;
22
private	import	stg;
23
private	import	bg;
23
private	import	bg;
24
private	import	ship;
24
private	import	ship;
25
26
const real PI =		0x1.921fb54442d1846ap+1; 
27
const real PI_2 =  1.57079632679489661923; 
28
const real PI_4 =  0.78539816339744830962; 
29
const real SQRT2 = 1.41421356237309504880;
25
30
26
private	char[]	str_buf;
31
private	char[]	str_buf;
27
private	int		wrk1_time;
32
private	int		wrk1_time;
Lines 59-65 Link Here
59
	float[XY] base;
64
	float[XY] base;
60
	float gauge;
65
	float gauge;
61
66
62
	/* •¶Žšî•ñ•`‰æ */
67
	
63
	glBegin(GL_QUADS);
68
	glBegin(GL_QUADS);
64
	glColor3f(1.0f,1.0f,1.0f);
69
	glColor3f(1.0f,1.0f,1.0f);
65
	str_buf  = "SCORE ";
70
	str_buf  = "SCORE ";
Lines 101-107 Link Here
101
	drawASCII(str_buf, -(SCREEN_S / 2) + 8 + (getWidthASCII("         ",0.5f)), -(SCREEN_S / 2) + 20, 0.50f);
106
	drawASCII(str_buf, -(SCREEN_S / 2) + 8 + (getWidthASCII("         ",0.5f)), -(SCREEN_S / 2) + 20, 0.50f);
102
	glEnd();
107
	glEnd();
103
108
104
	/* ƒ{ƒ€ƒQ[ƒW•`‰æ */
109
	
105
	z = BASE_Z - cam_pos;
110
	z = BASE_Z - cam_pos;
106
111
107
	base[X] = -(SCREEN_S / 2) + 4 + getWidthASCII("         ",0.5f);
112
	base[X] = -(SCREEN_S / 2) + 4 + getWidthASCII("         ",0.5f);
Lines 195-201 Link Here
195
200
196
	z = BASE_Z - cam_pos;
201
	z = BASE_Z - cam_pos;
197
202
198
	/* ƒŒ[ƒ_[BG•\Ž¦ */
203
	
199
	glColor4f(0.05f,0.50f,0.05f,0.25f);
204
	glColor4f(0.05f,0.50f,0.05f,0.25f);
200
	glBegin(GL_QUADS);
205
	glBegin(GL_QUADS);
201
	glVertex3f(getPointX(TskBuf[id].px-64.0f, z),
206
	glVertex3f(getPointX(TskBuf[id].px-64.0f, z),
Lines 228-234 Link Here
228
	glEnd();
233
	glEnd();
229
234
230
	glBegin(GL_QUADS);
235
	glBegin(GL_QUADS);
231
	/* “G•\Ž¦ */
236
	
232
	for(int i = TskIndex[GROUP_02]; i != -1; i = prev){
237
	for(int i = TskIndex[GROUP_02]; i != -1; i = prev){
233
		glColor4f(1.0f,0.0f,0.0f,TskBuf[i].alpha);
238
		glColor4f(1.0f,0.0f,0.0f,TskBuf[i].alpha);
234
		prev = TskBuf[i].prev;
239
		prev = TskBuf[i].prev;
Lines 251-257 Link Here
251
					   0.0f);
256
					   0.0f);
252
		}
257
		}
253
	}
258
	}
254
	/* Ž©‹@•\Ž¦ */
259
	
255
	glColor4f(1.0f,1.0f,1.0f,1.0f);
260
	glColor4f(1.0f,1.0f,1.0f,1.0f);
256
	if(TskBuf[ship_id].tskid != 0){
261
	if(TskBuf[ship_id].tskid != 0){
257
		pos[X] = TskBuf[id].px - TskBuf[ship_id].px / 16.0f;
262
		pos[X] = TskBuf[id].px - TskBuf[ship_id].px / 16.0f;
Lines 612-618 Link Here
612
	float[XY] base;
617
	float[XY] base;
613
	float energy;
618
	float energy;
614
619
615
	/* ƒ{ƒ€ƒQ[ƒW•`‰æ */
620
	
616
	z = BASE_Z - cam_pos;
621
	z = BASE_Z - cam_pos;
617
622
618
	base[X] = TskBuf[id].tx;
623
	base[X] = TskBuf[id].tx;
Lines 823-829 Link Here
823
828
824
	if(ship_lock == 0) return;
829
	if(ship_lock == 0) return;
825
830
826
	/* ƒ^[ƒQƒbƒg•`‰æ */
831
	
827
	z = BASE_Z - cam_pos;
832
	z = BASE_Z - cam_pos;
828
	base[X] = scr_pos[X] - TskBuf[trg].px;
833
	base[X] = scr_pos[X] - TskBuf[trg].px;
829
	base[Y] = scr_pos[Y] - TskBuf[trg].py;
834
	base[Y] = scr_pos[Y] - TskBuf[trg].py;
Lines 850-856 Link Here
850
	lx = 24.0f * TskBuf[id].sx;
855
	lx = 24.0f * TskBuf[id].sx;
851
	ly = 24.0f * TskBuf[id].sx;
856
	ly = 24.0f * TskBuf[id].sx;
852
	glBegin(GL_LINES);
857
	glBegin(GL_LINES);
853
	/* ¶‰º */
858
	
854
	glVertex3f(getPointX(base[X]-size, 0.0f),
859
	glVertex3f(getPointX(base[X]-size, 0.0f),
855
			   getPointY(base[Y]-size+ly, 0.0f),
860
			   getPointY(base[Y]-size+ly, 0.0f),
856
			   z);
861
			   z);
Lines 863-869 Link Here
863
	glVertex3f(getPointX(base[X]-size+lx, 0.0f),
868
	glVertex3f(getPointX(base[X]-size+lx, 0.0f),
864
			   getPointY(base[Y]-size, 0.0f),
869
			   getPointY(base[Y]-size, 0.0f),
865
			   z);
870
			   z);
866
	/* ¶ã */
871
	
867
	glVertex3f(getPointX(base[X]-size, 0.0f),
872
	glVertex3f(getPointX(base[X]-size, 0.0f),
868
			   getPointY(base[Y]+size-ly, 0.0f),
873
			   getPointY(base[Y]+size-ly, 0.0f),
869
			   z);
874
			   z);
Lines 876-882 Link Here
876
	glVertex3f(getPointX(base[X]-size+lx, 0.0f),
881
	glVertex3f(getPointX(base[X]-size+lx, 0.0f),
877
			   getPointY(base[Y]+size, 0.0f),
882
			   getPointY(base[Y]+size, 0.0f),
878
			   z);
883
			   z);
879
	/* ‰E‰º */
884
	
880
	glVertex3f(getPointX(base[X]+size, 0.0f),
885
	glVertex3f(getPointX(base[X]+size, 0.0f),
881
			   getPointY(base[Y]-size+ly, 0.0f),
886
			   getPointY(base[Y]-size+ly, 0.0f),
882
			   z);
887
			   z);
Lines 889-895 Link Here
889
	glVertex3f(getPointX(base[X]+size-lx, 0.0f),
894
	glVertex3f(getPointX(base[X]+size-lx, 0.0f),
890
			   getPointY(base[Y]-size, 0.0f),
895
			   getPointY(base[Y]-size, 0.0f),
891
			   z);
896
			   z);
892
	/* ‰Eã */
897
	
893
	glVertex3f(getPointX(base[X]+size, 0.0f),
898
	glVertex3f(getPointX(base[X]+size, 0.0f),
894
			   getPointY(base[Y]+size-ly, 0.0f),
899
			   getPointY(base[Y]+size-ly, 0.0f),
895
			   z);
900
			   z);
Lines 902-908 Link Here
902
	glVertex3f(getPointX(base[X]+size-lx, 0.0f),
907
	glVertex3f(getPointX(base[X]+size-lx, 0.0f),
903
			   getPointY(base[Y]+size, 0.0f),
908
			   getPointY(base[Y]+size, 0.0f),
904
			   z);
909
			   z);
905
	/* ƒNƒƒX */
910
	
906
	glVertex3f(getPointX(base[X]-lx, 0.0f),
911
	glVertex3f(getPointX(base[X]-lx, 0.0f),
907
			   getPointY(base[Y], 0.0f),
912
			   getPointY(base[Y], 0.0f),
908
			   z);
913
			   z);
(-)a2k/a2k_src/src/task.d (-11 / +13 lines)
Lines 13-19 Link Here
13
private	import	main;
13
private	import	main;
14
14
15
struct TSK {
15
struct TSK {
16
	/* ƒVƒXƒeƒ€ƒƒ“ƒo */
16
	
17
	int		tskid;
17
	int		tskid;
18
	int		group;
18
	int		group;
19
	int		entry;
19
	int		entry;
Lines 23-29 Link Here
23
	void	function(int) fp_int;
23
	void	function(int) fp_int;
24
	void	function(int) fp_draw;
24
	void	function(int) fp_draw;
25
	void	function(int) fp_exit;
25
	void	function(int) fp_exit;
26
	/* ƒAƒvƒŠˆË‘¶ƒƒ“ƒo */
26
	
27
	int				step;
27
	int				step;
28
	int				wait;
28
	int				wait;
29
	int				cnt;
29
	int				cnt;
Lines 34-40 Link Here
34
	int				wrk2;
34
	int				wrk2;
35
	float			fwrk1;
35
	float			fwrk1;
36
	float			fwrk2;
36
	float			fwrk2;
37
	/* ƒQ[ƒ€ˆË‘¶ƒƒ“ƒo */
37
	
38
	int				flag;
38
	int				flag;
39
	int				energy;
39
	int				energy;
40
	int				chr_id;
40
	int				chr_id;
Lines 75-81 Link Here
75
	float[XYZW][]	line_ang;
75
	float[XYZW][]	line_ang;
76
	float[XYZW][]	offset_ang;
76
	float[XYZW][]	offset_ang;
77
	float			alpha;
77
	float			alpha;
78
	/* BulletMLƒƒ“ƒo */
78
	
79
	BulletCommand	bullet_command;
79
	BulletCommand	bullet_command;
80
	BulletMLState*	bullet_state;
80
	BulletMLState*	bullet_state;
81
	int				tid;
81
	int				tid;
Lines 126-132 Link Here
126
void	initTSK()
126
void	initTSK()
127
{
127
{
128
	/*
128
	/*
129
	//	ƒ[ƒN‚ÌŠm•Û
129
	
130
	*/
130
	*/
131
	TskBuf.length = TSK_MAX;
131
	TskBuf.length = TSK_MAX;
132
	TskIndex.length = GROUP_MAX;
132
	TskIndex.length = GROUP_MAX;
Lines 138-144 Link Here
138
	TskEntry = 0;
138
	TskEntry = 0;
139
139
140
	/*
140
	/*
141
	//	‹ó‚«ƒŠƒXƒg‚̍쐬
141
	
142
	*/
142
	*/
143
	{
143
	{
144
		int	i;
144
		int	i;
Lines 153-159 Link Here
153
			TskBuf[i].fp_exit = null;
153
			TskBuf[i].fp_exit = null;
154
			TskBuf[i].image = null;
154
			TskBuf[i].image = null;
155
			TskBuf[i].bullet_command = null;
155
			TskBuf[i].bullet_command = null;
156
			TskBuf[i].bullet_state = null;
156
			TskBuf[i].bullet_state = null;
157
                        TskBuf[i].bullet_accx = 0;
158
                        TskBuf[i].bullet_accy = 0;
157
		}
159
		}
158
		TskBuf[i].tskid = TSKID_NONE;
160
		TskBuf[i].tskid = TSKID_NONE;
159
		TskBuf[i].entry = -1;
161
		TskBuf[i].entry = -1;
Lines 246-252 Link Here
246
	int	prev;
248
	int	prev;
247
249
248
	/*
250
	/*
249
	//	‘SÁ‹Ž
251
	
250
	*/
252
	*/
251
	for(int i = 0; i < GROUP_MAX; i++){
253
	for(int i = 0; i < GROUP_MAX; i++){
252
		for(int j = TskIndex[i]; j != -1; j = prev){
254
		for(int j = TskIndex[i]; j != -1; j = prev){
Lines 266-272 Link Here
266
	int	prev;
268
	int	prev;
267
269
268
	/*
270
	/*
269
	//	‘SÁ‹Ž
271
	
270
	*/
272
	*/
271
	for(int i = TskIndex[group]; i != -1; i = prev){
273
	for(int i = TskIndex[group]; i != -1; i = prev){
272
		prev = TskBuf[i].prev;
274
		prev = TskBuf[i].prev;
Lines 286-292 Link Here
286
	TskCnt = 0;
288
	TskCnt = 0;
287
289
288
	/*
290
	/*
289
	//	ŽÀs
291
	
290
	*/
292
	*/
291
	for(int i = 0; i < GROUP_MAX; i++){
293
	for(int i = 0; i < GROUP_MAX; i++){
292
		for(int j = TskIndex[i]; j != -1; j = prev){
294
		for(int j = TskIndex[i]; j != -1; j = prev){
Lines 311-317 Link Here
311
	int	prev;
313
	int	prev;
312
314
313
	/*
315
	/*
314
	//	•`‰æ
316
	
315
	*/
317
	*/
316
	for(int i = 0; i < GROUP_MAX; i++){
318
	for(int i = 0; i < GROUP_MAX; i++){
317
		for(int j = TskIndex[i]; j != -1; j = prev){
319
		for(int j = TskIndex[i]; j != -1; j = prev){
(-)a2k/a2k_src/src/title.d (-1 / +1 lines)
Lines 6-12 Link Here
6
	2004/04/08 jumpei isshiki
6
	2004/04/08 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.stdio;
9
private	import	std.c.stdio;
10
private	import	std.math;
10
private	import	std.math;
11
private	import	std.string;
11
private	import	std.string;
12
private	import	SDL;
12
private	import	SDL;
(-)a2k/a2k_src/src/util_ascii.d (-4 / +16 lines)
Lines 13-19 Link Here
13
13
14
const float	ASC_SIZE = (16.0f + 2.0f);
14
const float	ASC_SIZE = (16.0f + 2.0f);
15
15
16
private	float[][]	ascii_font = [
16
float[][] ascii_font;
17
18
19
20
private	char[]	ascii_dict = "ABCDEFGHIJKLMNOPQRSTUVWXYZ.:!?\"'-=+ 0123456789";
21
22
void	initASCII()
23
{
24
static float[][]	af = [
17
									/* 'A' */
25
									/* 'A' */
18
									[
26
									[
19
										3, 0, 11, 2,
27
										3, 0, 11, 2,
Lines 328-337 Link Here
328
									],
336
									],
329
								];
337
								];
330
338
331
private	char[]	ascii_dict = "ABCDEFGHIJKLMNOPQRSTUVWXYZ.:!?\"'-=+ 0123456789";
339
	ascii_font.length = af.length;
340
	for (int i = 0; i < ascii_font.length; i++) {
341
	    ascii_font[i].length = af[i].length;
342
	    for (int j = 0; j < ascii_font[i].length; j++) {
343
	    	ascii_font[i][j] = af[i][j];
344
	    }
345
	}
332
346
333
void	initASCII()
334
{
335
	for(int i = 0; i < ascii_font.length; i++){
347
	for(int i = 0; i < ascii_font.length; i++){
336
		for(int j = 0; j < ascii_font[i].length; j += 4){
348
		for(int j = 0; j < ascii_font[i].length; j += 4){
337
			ascii_font[i][j+2] += 1.0f;
349
			ascii_font[i][j+2] += 1.0f;
(-)a2k/a2k_src/src/util_pad.d (-5 / +6 lines)
Lines 7-13 Link Here
7
*/
7
*/
8
8
9
private	import	SDL;
9
private	import	SDL;
10
10
private	import	SDL_Keysym;
11
private	import	SDL_keyboard;
11
enum{
12
enum{
12
	PAD_UP = 0x01,
13
	PAD_UP = 0x01,
13
	PAD_DOWN = 0x02,
14
	PAD_DOWN = 0x02,
Lines 83-89 Link Here
83
84
84
	keys = SDL_GetKeyState(null);
85
	keys = SDL_GetKeyState(null);
85
86
86
	/* •ûŒü */
87
	
87
	if(joys){
88
	if(joys){
88
		x = SDL_JoystickGetAxis(joys, 0);
89
		x = SDL_JoystickGetAxis(joys, 0);
89
		y = SDL_JoystickGetAxis(joys, 1);
90
		y = SDL_JoystickGetAxis(joys, 1);
Lines 119-125 Link Here
119
120
120
	int	btn1 = 0, btn2 = 0, btn3 = 0, btn4 = 0, btn5 = 0, btn6 = 0, btn7 = 0, btn8 = 0;
121
	int	btn1 = 0, btn2 = 0, btn3 = 0, btn4 = 0, btn5 = 0, btn6 = 0, btn7 = 0, btn8 = 0;
121
122
122
	/* ƒ{ƒ^ƒ“ */
123
	
123
	if(joys){
124
	if(joys){
124
		btn1 = SDL_JoystickGetButton(joys, 0);
125
		btn1 = SDL_JoystickGetButton(joys, 0);
125
		btn2 = SDL_JoystickGetButton(joys, 1);
126
		btn2 = SDL_JoystickGetButton(joys, 1);
Lines 153-164 Link Here
153
		}
154
		}
154
	}
155
	}
155
156
156
	/* ƒgƒŠƒK */
157
	
157
	pads_old = pads;
158
	pads_old = pads;
158
	pads = pad;
159
	pads = pad;
159
	trgs = pads & ~pads_old;
160
	trgs = pads & ~pads_old;
160
161
161
	/* ƒŠƒs[ƒg */
162
	
162
	reps = 0;
163
	reps = 0;
163
	if(pads){
164
	if(pads){
164
		if(!trgs && !rep_cnt){
165
		if(!trgs && !rep_cnt){
(-)a2k/a2k_src/src/util_sdl.d (-26 / +40 lines)
Lines 6-14 Link Here
6
	2003/11/28 jumpei isshiki
6
	2003/11/28 jumpei isshiki
7
*/
7
*/
8
8
9
private	import	std.stdio;
9
private	import	std.string;
10
private	import	std.string;
10
private	import	SDL;
11
private	import	SDL;
12
private	import	SDL_mouse;
11
private	import	opengl;
13
private	import	opengl;
14
private	import	util_pad;
12
private	import	define;
15
private	import	define;
13
16
14
enum{
17
enum{
Lines 31-61 Link Here
31
	EY,
34
	EY,
32
}
35
}
33
36
37
struct VEC_POS {
38
	float	px;
39
	float	py;
40
	float	pz;
41
}
34
42
35
SDL_Surface*	primary;
43
SDL_Surface*	primary;
36
SDL_Surface*[]	offscreen;
44
SDL_Surface*[]	offscreen;
37
45
46
const float SCREEN_RATIOX = cast(float)(SCREEN_X / 2.0f);
47
const float SCREEN_RATIOY = cast(float)(SCREEN_Y / 2.0f);
38
const float	BASE_Z = 2.0f;
48
const float	BASE_Z = 2.0f;
39
float		cam_scr = -0.75f;
49
float		cam_scr = -0.75f;
40
float		cam_pos;
50
float		cam_pos;
41
51
42
private	int		width = SCREEN_X;
52
private	int width = SCREEN_X;
43
private	int		height = SCREEN_Y;
53
private	int height = SCREEN_Y;
44
private	float	nearPlane = 0.0f;
54
private	float nearPlane = 0.0f;
45
private	float	farPlane = 1000.0f;
55
private	float farPlane = 1000.0f;
56
private	GLuint TEXTURE_NONE = 0xffffffff;
46
57
47
private	GLuint[]	tex_bank;
58
private	GLuint[] tex_bank;
48
59
49
int		initSDL()
60
int initSDL()
50
{
61
{
51
	if(SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK) < 0){
62
	if(SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK) < 0){
52
		return	0;
63
		return	0;
53
    }
64
    }
54
55
	Uint32	videoFlags;
65
	Uint32	videoFlags;
56
	videoFlags = SDL_OPENGL | SDL_FULLSCREEN;
66
57
	debug{
67
	debug{
58
		videoFlags = SDL_OPENGL | SDL_RESIZABLE;
68
		if((pads & PAD_BUTTON1)){
69
			videoFlags = SDL_OPENGL | SDL_FULLSCREEN;
70
		}else{
71
			videoFlags = SDL_OPENGL | SDL_RESIZABLE;
72
		}
73
	}else{
74
		videoFlags = SDL_OPENGL | SDL_FULLSCREEN;
59
	}
75
	}
60
	primary = SDL_SetVideoMode(width, height, 0, videoFlags);
76
	primary = SDL_SetVideoMode(width, height, 0, videoFlags);
61
	if(primary == null){
77
	if(primary == null){
Lines 66-84 Link Here
66
	tex_bank.length  = SURFACE_MAX;
82
	tex_bank.length  = SURFACE_MAX;
67
	for(int i = 0; i < SURFACE_MAX; i++){
83
	for(int i = 0; i < SURFACE_MAX; i++){
68
		offscreen[i] = null;
84
		offscreen[i] = null;
69
		tex_bank[i]  = cast(GLuint)-1;
85
		tex_bank[i]  = TEXTURE_NONE;
70
	}
86
	}
71
87
72
	glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
88
	glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
73
    resizedSDL(width, height);
89
    resizedSDL(width, height);
74
	SDL_ShowCursor(SDL_DISABLE);
90
	SDL_ShowCursor(SDL_DISABLE);
75
91
76
	SDL_WM_SetCaption(PROJECT_NAME, null);
92
	SDL_WM_SetCaption(PROJECT_NAME.ptr, null);
93
	SDL_WM_SetIcon(SDL_LoadBMP("/usr/share/games/gradleunison/icon.bmp"), null);
77
94
78
	return	1;
95
	return	1;
79
}
80
81
96
97
}
98
82
void	closeSDL()
99
void	closeSDL()
83
{
100
{
84
	for(int i = 0; i < SURFACE_MAX; i++){
101
	for(int i = 0; i < SURFACE_MAX; i++){
Lines 95-103 Link Here
95
	SDL_ShowCursor(SDL_ENABLE);
112
	SDL_ShowCursor(SDL_ENABLE);
96
	SDL_Quit();
113
	SDL_Quit();
97
}
114
}
115
98
116
99
117
void readSDLtexture(char[] fname, int bank)
100
void	readSDLtexture(char[] fname, int bank)
101
{
118
{
102
	offscreen[bank] = SDL_LoadBMP(toStringz(fname));
119
	offscreen[bank] = SDL_LoadBMP(toStringz(fname));
103
	if(offscreen[bank]){
120
	if(offscreen[bank]){
Lines 109-139 Link Here
109
	}
126
	}
110
}
127
}
111
128
112
129
void bindSDLtexture(int bank)
113
void	bindSDLtexture(int bank)
114
{
130
{
115
	if(tex_bank[bank] != -1) glBindTexture(GL_TEXTURE_2D, tex_bank[bank]);
131
	if(tex_bank[bank] != TEXTURE_NONE) glBindTexture(GL_TEXTURE_2D, tex_bank[bank]);
116
}
132
}
117
133
118
134
void clearSDL()
119
void	clearSDL()
120
{
135
{
121
	glClear(GL_COLOR_BUFFER_BIT);
136
	glClear(GL_COLOR_BUFFER_BIT);
122
}
137
}
123
138
124
139
void flipSDL()
125
void	flipSDL()
126
{
140
{
127
	glFlush();
141
	glFlush();
128
	SDL_GL_SwapBuffers();
142
	SDL_GL_SwapBuffers();
129
}
143
}
130
144
131
145
void resizedSDL(int w, int h)
132
void	resizedSDL(int w, int h)
133
{
146
{
134
	glViewport(0, 0, w, h);
147
	glViewport(0, 0, w, h);
135
	glMatrixMode(GL_PROJECTION);
148
	glMatrixMode(GL_PROJECTION);
136
	glLoadIdentity();
149
	glLoadIdentity();
150
	w = (w ? w : 1);
137
	glFrustum(-nearPlane,nearPlane,
151
	glFrustum(-nearPlane,nearPlane,
138
			  -nearPlane * h / w,
152
			  -nearPlane * h / w,
139
			   nearPlane * h / w,
153
			   nearPlane * h / w,
(-)a2k/a2k_src/src/util_snd.d (-2 / +2 lines)
Lines 84-90 Link Here
84
84
85
	char[] fileName = name ~ "\0";
85
	char[] fileName = name ~ "\0";
86
86
87
	music[ch] = Mix_LoadMUS(fileName);
87
	music[ch] = Mix_LoadMUS(fileName.ptr);
88
	if(!music[ch]){
88
	if(!music[ch]){
89
		sound_use = false;
89
		sound_use = false;
90
	}
90
	}
Lines 104-110 Link Here
104
104
105
	char[] fileName = name ~ "\0";
105
	char[] fileName = name ~ "\0";
106
106
107
	chunk[bank] = Mix_LoadWAV(fileName);
107
	chunk[bank] = Mix_LoadWAV(fileName.ptr);
108
	if(!chunk[bank]){
108
	if(!chunk[bank]){
109
		sound_use = false;
109
		sound_use = false;
110
	}
110
	}
(-)a2k/makefile (+18 lines)
Line 0 Link Here
1
DSRC=$(shell find a2k_src/src -name "*.d")
2
SOURCES=$(DSRC) a2k_src/import/SDL_video.d a2k_src/import/SDL_mixer.d
3
OBJS=$(SOURCES:.d=.o)
4
CFLAGS=
5
DFLAGS=-O -Ia2k_src/import -Ia2k_src/src -I/usr/X11R6/include/
6
EXE=area2048
7
8
all: $(EXE)
9
10
$(EXE): $(OBJS)
11
	gcc $(CFLAGS) -o $@ $(OBJS) $(COBJS) -lbulletml_d -L/usr/local/lib -L/usr/lib -lgphobos -lpthread -lGLU -lGL -lglut -lm -lstdc++ -lSDL -lSDL_mixer
12
13
$(OBJS): %.o: %.d
14
	gdmd -d -c -of$@ $(DFLAGS) $<
15
16
clean:
17
	rm a2k_src/src/*.o
18

Return to bug 189335