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-org/a2k_src/import/opengl.d (-14 / +4 lines)
Lines 1-16 Link Here
1
version (Win32) {
1
2
	import std.c.windows.windows;
3
}
4
extern(System):
5
6
/* Please use this code with old D compiler.
7
version (Win32) {
8
	extern(Windows):
9
}
10
else {
11
	extern(C):
2
	extern(C):
12
}
3
13
*/
14
4
15
alias uint GLenum;
5
alias uint GLenum;
16
alias ubyte GLboolean;
6
alias ubyte GLboolean;
Lines 1122-1128 Link Here
1122
/*************************************************************/
1112
/*************************************************************/
1123
1113
1124
void /*APIENTRY*/glAccum (GLenum op, GLfloat value);
1114
void /*APIENTRY*/glAccum (GLenum op, GLfloat value);
1125
void /*APIENTRY*/glAlphaFunc (GLenum func, GLclampf cref);
1115
void /*APIENTRY*/glAlphaFunc (GLenum func, GLclampf);
1126
GLboolean /*APIENTRY*/glAreTexturesResident (GLsizei n, GLuint *textures, GLboolean *residences);
1116
GLboolean /*APIENTRY*/glAreTexturesResident (GLsizei n, GLuint *textures, GLboolean *residences);
1127
void /*APIENTRY*/glArrayElement (GLint i);
1117
void /*APIENTRY*/glArrayElement (GLint i);
1128
void /*APIENTRY*/glBegin (GLenum mode);
1118
void /*APIENTRY*/glBegin (GLenum mode);
Lines 1375-1381 Link Here
1375
void /*APIENTRY*/glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
1365
void /*APIENTRY*/glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
1376
void /*APIENTRY*/glSelectBuffer (GLsizei size, GLuint *buffer);
1366
void /*APIENTRY*/glSelectBuffer (GLsizei size, GLuint *buffer);
1377
void /*APIENTRY*/glShadeModel (GLenum mode);
1367
void /*APIENTRY*/glShadeModel (GLenum mode);
1378
void /*APIENTRY*/glStencilFunc (GLenum func, GLint cref, GLuint mask);
1368
void /*APIENTRY*/glStencilFunc (GLenum func, GLint, GLuint mask);
1379
void /*APIENTRY*/glStencilMask (GLuint mask);
1369
void /*APIENTRY*/glStencilMask (GLuint mask);
1380
void /*APIENTRY*/glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
1370
void /*APIENTRY*/glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
1381
void /*APIENTRY*/glTexCoord1d (GLdouble s);
1371
void /*APIENTRY*/glTexCoord1d (GLdouble s);
(-)a2k-org/a2k_src/import/openglu.d (-10 / +1 lines)
Lines 1-15 Link Here
1
import opengl;
2
1
3
extern(System):
4
5
/* Please use this code with old D compiler.
6
version (Win32) {
7
	extern(Windows):
8
}
9
else {
10
	extern(C):
2
	extern(C):
11
}
3
12
*/
13
4
14
GLubyte* gluErrorString (
5
GLubyte* gluErrorString (
15
    GLenum   errCode);
6
    GLenum   errCode);
(-)a2k-org/a2k_src/import/SDL_active.d (-1 / +1 lines)
Lines 22-28 Link Here
22
22
23
/* Include file for SDL application focus event handling */
23
/* Include file for SDL application focus event handling */
24
24
25
public import SDL_types;
25
import SDL_types;
26
26
27
extern(C):
27
extern(C):
28
28
(-)a2k-org/a2k_src/import/SDL_audio.d (-4 / +4 lines)
Lines 20-29 Link Here
20
    slouken@devolution.com
20
    slouken@devolution.com
21
*/
21
*/
22
22
23
public import SDL_types;
23
import SDL_types;
24
public import SDL_error;
24
import SDL_error;
25
public import SDL_rwops;
25
import SDL_rwops;
26
public import SDL_byteorder;
26
import SDL_byteorder;
27
27
28
extern(C):
28
extern(C):
29
29
(-)a2k-org/a2k_src/import/SDL_cdrom.d (-1 / +1 lines)
Lines 22-28 Link Here
22
22
23
/* This is the CD-audio control API for Simple DirectMedia Layer */
23
/* This is the CD-audio control API for Simple DirectMedia Layer */
24
24
25
public import SDL_types;
25
import SDL_types;
26
26
27
extern(C):
27
extern(C):
28
28
(-)a2k-org/a2k_src/import/SDL.d (-57 / +57 lines)
Lines 33-92 Link Here
33
public import SDL_byteorder;
33
public import SDL_byteorder;
34
public 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-org/a2k_src/import/SDL_endian.d (-4 / +4 lines)
Lines 34-42 Link Here
34
         and other data sources.
34
         and other data sources.
35
*/
35
*/
36
36
37
public import SDL_types;
37
import SDL_types;
38
public import SDL_rwops;
38
import SDL_rwops;
39
public import SDL_byteorder;
39
import SDL_byteorder;
40
40
41
extern(C):
41
extern(C):
42
42
Lines 47-53 Link Here
47
*/
47
*/
48
48
49
Uint16 SDL_Swap16(Uint16 D) {
49
Uint16 SDL_Swap16(Uint16 D) {
50
	return cast(Uint16)((D<<8)|(D>>8));
50
	return((D<<8)|(D>>8));
51
}
51
}
52
52
53
Uint32 SDL_Swap32(Uint32 D) {
53
Uint32 SDL_Swap32(Uint32 D) {
(-)a2k-org/a2k_src/import/SDL_events.d (-7 / +7 lines)
Lines 22-33 Link Here
22
22
23
/* Include file for SDL event handling */
23
/* Include file for SDL event handling */
24
24
25
public import SDL_types;
25
import SDL_types;
26
public import SDL_active;
26
import SDL_active;
27
public import SDL_keyboard;
27
import SDL_keyboard;
28
public import SDL_mouse;
28
import SDL_mouse;
29
public import SDL_joystick;
29
import SDL_joystick;
30
public import SDL_syswm;
30
import SDL_syswm;
31
31
32
extern(C):
32
extern(C):
33
33
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-org/a2k_src/import/SDL_image.d (-1 / +1 lines)
Lines 26-32 Link Here
26
26
27
/* A simple library to load images of various formats as SDL surfaces */
27
/* A simple library to load images of various formats as SDL surfaces */
28
28
29
public import SDL;
29
import SDL;
30
30
31
extern (C) {
31
extern (C) {
32
32
(-)a2k-org/a2k_src/import/SDL_joystick.d (-1 / +1 lines)
Lines 22-28 Link Here
22
22
23
/* Include file for SDL joystick event handling */
23
/* Include file for SDL joystick event handling */
24
24
25
public import SDL_types;
25
import SDL_types;
26
26
27
extern(C):
27
extern(C):
28
28
(-)a2k-org/a2k_src/import/SDL_keyboard.d (-2 / +2 lines)
Lines 22-32 Link Here
22
22
23
/* Include file for SDL keyboard event handling */
23
/* Include file for SDL keyboard event handling */
24
24
25
public import SDL_types;
25
import SDL_types;
26
// !!! A hack! struct SDL_keysym is defined in this module,
26
// !!! A hack! struct SDL_keysym is defined in this module,
27
// !!! so we need to resolve the nameclash...
27
// !!! so we need to resolve the nameclash...
28
// !!! Definitely won't work on *NIX but for now will do.
28
// !!! Definitely won't work on *NIX but for now will do.
29
public import SDL_Keysym;
29
import SDL_Keysym;
30
30
31
extern(C):
31
extern(C):
32
32
(-)a2k-org/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-org/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-org/a2k_src/import/SDL_mixer.d (-1 / +1 lines)
Lines 24-30 Link Here
24
24
25
/* $Id: SDL_mixer.h,v 1.24 2002/05/21 05:45:59 slouken Exp $ */
25
/* $Id: SDL_mixer.h,v 1.24 2002/05/21 05:45:59 slouken Exp $ */
26
26
27
public import SDL;
27
import SDL;
28
28
29
extern (C) {
29
extern (C) {
30
30
(-)a2k-org/a2k_src/import/SDL_mouse.d (-2 / +2 lines)
Lines 22-29 Link Here
22
22
23
/* Include file for SDL mouse event handling */
23
/* Include file for SDL mouse event handling */
24
24
25
public import SDL_types;
25
import SDL_types;
26
public import SDL_video;
26
import SDL_video;
27
27
28
extern(C):
28
extern(C):
29
29
(-)a2k-org/a2k_src/import/SDL_mutex.d (-1 / +1 lines)
Lines 25-31 Link Here
25
	These are independent of the other SDL routines.
25
	These are independent of the other SDL routines.
26
*/
26
*/
27
27
28
public import SDL_types;
28
import SDL_types;
29
29
30
extern(C):
30
extern(C):
31
31
(-)a2k-org/a2k_src/import/SDL_quit.d (-1 / +1 lines)
Lines 22-28 Link Here
22
22
23
/* Include file for SDL quit event handling */
23
/* Include file for SDL quit event handling */
24
24
25
public import SDL_events;
25
import SDL_events;
26
26
27
/* 
27
/* 
28
  An SDL_QUITEVENT is generated when the user tries to close the application
28
  An SDL_QUITEVENT is generated when the user tries to close the application
(-)a2k-org/a2k_src/import/SDL_rwops.d (-1 / +1 lines)
Lines 24-30 Link Here
24
   data sources.  It can easily be extended to files, memory, etc.
24
   data sources.  It can easily be extended to files, memory, etc.
25
*/
25
*/
26
26
27
public import SDL_types;
27
import SDL_types;
28
28
29
extern(C):
29
extern(C):
30
30
(-)a2k-org/a2k_src/import/SDL_sound.d (-1 / +1 lines)
Lines 62-68 Link Here
62
62
63
// convert to D by shinichiro.h
63
// convert to D by shinichiro.h
64
64
65
public import SDL;
65
import SDL;
66
66
67
extern (C) {
67
extern (C) {
68
	const int SOUND_VER_MAJOR = 1;
68
	const int SOUND_VER_MAJOR = 1;
(-)a2k-org/a2k_src/import/SDL_syswm.d (-1 / +1 lines)
Lines 22-28 Link Here
22
22
23
/* Include file for SDL custom system window manager hooks */
23
/* Include file for SDL custom system window manager hooks */
24
24
25
public import SDL_Version;
25
import SDL_Version;
26
26
27
extern(C):
27
extern(C):
28
28
(-)a2k-org/a2k_src/import/SDL_thread.d (-2 / +2 lines)
Lines 25-32 Link Here
25
	These are independent of the other SDL routines.
25
	These are independent of the other SDL routines.
26
*/
26
*/
27
27
28
public import SDL_types;
28
import SDL_types;
29
public import SDL_mutex;
29
import SDL_mutex;
30
30
31
extern(C):
31
extern(C):
32
32
(-)a2k-org/a2k_src/import/SDL_timer.d (-1 / +1 lines)
Lines 20-26 Link Here
20
    slouken@devolution.com
20
    slouken@devolution.com
21
*/
21
*/
22
22
23
public import SDL_types;
23
import SDL_types;
24
24
25
extern(C):
25
extern(C):
26
26
(-)a2k-org/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
public 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-org/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-org/a2k_src/import/SDL_video.d (-3 / +3 lines)
Lines 22-30 Link Here
22
22
23
/* Header file for access to the SDL raw framebuffer window */
23
/* Header file for access to the SDL raw framebuffer window */
24
24
25
public import SDL_types;
25
import SDL_types;
26
public import SDL_mutex;
26
import SDL_mutex;
27
public import SDL_rwops;
27
import SDL_rwops;
28
28
29
extern(C):
29
extern(C):
30
30
(-)a2k-org/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-org/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.c.math;
11
private	import	std.random;
11
private	import	std.random;
12
private	import	std.string;
12
private	import	std.string;
13
private	import	SDL;
13
private	import	SDL;
(-)a2k-org/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.c.math;
10
private	import	std.random;
10
private	import	std.random;
11
private	import	std.string;
11
private	import	std.string;
12
private	import	SDL;
12
private	import	SDL;
(-)a2k-org/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.c.math;
10
private	import	std.random;
10
private	import	std.random;
11
private	import	std.string;
11
private	import	std.string;
12
private	import	SDL;
12
private	import	SDL;
Lines 358-364 Link Here
358
			}
358
			}
359
			if(!cmd.isEnd()) cmd.run();
359
			if(!cmd.isEnd()) cmd.run();
360
			break;
360
			break;
361
			TskBuf[id].ang_x  = rand() % 65536;
361
			TskBuf[id].ang_x  = cast(float)rand() % 65536;
362
			TskBuf[id].ang_x *= PI / 65536.0f;
362
			TskBuf[id].ang_x *= PI / 65536.0f;
363
			TskBuf[id].ax = 
363
			TskBuf[id].ax = 
364
			TskBuf[id].ay = sin(TskBuf[id].ang_x) * 5.0f / PI;
364
			TskBuf[id].ay = sin(TskBuf[id].ang_x) * 5.0f / PI;
(-)a2k-org/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.c.math;
10
private	import	std.random;
10
private	import	std.random;
11
private	import	std.string;
11
private	import	std.string;
12
private	import	SDL;
12
private	import	SDL;
(-)a2k-org/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.c.math;
10
private	import	std.random;
10
private	import	std.random;
11
private	import	std.string;
11
private	import	std.string;
12
private	import	SDL;
12
private	import	SDL;
(-)a2k-org/a2k_src/src/bulletcommand.d (-1 / +1 lines)
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-org/a2k_src/src/effect.d (-24 / +25 lines)
Lines 6-19 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.c.math;
10
private	import	std.random;
10
private	import	std.random;
11
private	import	std.string;
11
private	import	std.string;
12
private	import	SDL;
12
private	import	SDL;
13
private	import	opengl;
13
private	import	opengl;
14
private	import	util_sdl;
14
private	import	util_sdl;
15
private	import	task;
15
private	import	task;
16
private	import	bg;
16
private	import	bg;
17
private	import	system;
17
18
18
float	fade_r = 0.0f;
19
float	fade_r = 0.0f;
19
float	fade_g = 0.0f;
20
float	fade_g = 0.0f;
Lines 53-68 Link Here
53
			for(int i = 0; i < 3; i++){
54
			for(int i = 0; i < 3; i++){
54
				switch(i){
55
				switch(i){
55
					case	0:
56
					case	0:
56
							tpos[X] = -((rand() % 4096) / 1024.0f + 1.0f);
57
							tpos[X] = -cast(float)((rand() % 4096) / 1024.0f + 1.0f);
57
							tpos[Y] = +((rand() % 4096) / 1024.0f + 1.0f);
58
							tpos[Y] = +cast(float)((rand() % 4096) / 1024.0f + 1.0f);
58
							break;
59
							break;
59
					case	1:
60
					case	1:
60
							tpos[X] =  ((rand() % 2048) / 1024.0f - 1.0f);
61
							tpos[X] =  cast(float)((rand() % 2048) / 1024.0f - 1.0f);
61
							tpos[Y] = -((rand() % 4096) / 1024.0f + 1.0f);
62
							tpos[Y] = -cast(float)((rand() % 4096) / 1024.0f + 1.0f);
62
							break;
63
							break;
63
					case	2:
64
					case	2:
64
							tpos[X] = +((rand() % 4096) / 1024.0f + 1.0f);
65
							tpos[X] = +cast(float)((rand() % 4096) / 1024.0f + 1.0f);
65
							tpos[Y] = +((rand() % 4096) / 1024.0f + 1.0f);
66
							tpos[Y] = +cast(float)((rand() % 4096) / 1024.0f + 1.0f);
66
							break;
67
							break;
67
					default:
68
					default:
68
							break;
69
							break;
Lines 74-81 Link Here
74
				tpos[Y] = fabs(tpos[Y]);
75
				tpos[Y] = fabs(tpos[Y]);
75
				TskBuf[id].body_ang[i][W] = sqrt(pow(tpos[X],2.0) + pow(tpos[Y],2.0));
76
				TskBuf[id].body_ang[i][W] = sqrt(pow(tpos[X],2.0) + pow(tpos[Y],2.0));
76
			}
77
			}
77
			TskBuf[id].tx = (rand() % 256000) / 1000.0f - 128.0f;
78
			TskBuf[id].tx = cast(float)(rand() % 256000) / 1000.0f - 128.0f;
78
			TskBuf[id].ty = (rand() % 256000) / 1000.0f - 128.0f;
79
			TskBuf[id].ty = cast(float)(rand() % 256000) / 1000.0f - 128.0f;
79
			TskBuf[id].tx += TskBuf[id].px;
80
			TskBuf[id].tx += TskBuf[id].px;
80
			TskBuf[id].ty += TskBuf[id].py;
81
			TskBuf[id].ty += TskBuf[id].py;
81
			TskBuf[id].wait = 60;
82
			TskBuf[id].wait = 60;
Lines 165-180 Link Here
165
			for(int i = 0; i < 3; i++){
166
			for(int i = 0; i < 3; i++){
166
				switch(i){
167
				switch(i){
167
					case	0:
168
					case	0:
168
							tpos[X] = -((rand() % 12288) / 1024.0f + 3.0f);
169
							tpos[X] = -(cast(float)(rand() % 12288) / 1024.0f + 3.0f);
169
							tpos[Y] = +((rand() % 12288) / 1024.0f + 3.0f);
170
							tpos[Y] = +(cast(float)(rand() % 12288) / 1024.0f + 3.0f);
170
							break;
171
							break;
171
					case	1:
172
					case	1:
172
							tpos[X] =  ((rand() %  6144) / 1024.0f - 3.0f);
173
							tpos[X] =  (cast(float)(rand() %  6144) / 1024.0f - 3.0f);
173
							tpos[Y] = -((rand() % 12288) / 1024.0f + 3.0f);
174
							tpos[Y] = -(cast(float)(rand() % 12288) / 1024.0f + 3.0f);
174
							break;
175
							break;
175
					case	2:
176
					case	2:
176
							tpos[X] = +((rand() % 12288) / 1024.0f + 3.0f);
177
							tpos[X] = +(cast(float)(rand() % 12288) / 1024.0f + 3.0f);
177
							tpos[Y] = +((rand() % 12288) / 1024.0f + 3.0f);
178
							tpos[Y] = +(cast(float)(rand() % 12288) / 1024.0f + 3.0f);
178
							break;
179
							break;
179
					default:
180
					default:
180
							break;
181
							break;
Lines 186-193 Link Here
186
				tpos[Y] = fabs(tpos[Y]);
187
				tpos[Y] = fabs(tpos[Y]);
187
				TskBuf[id].body_ang[i][W] = sqrt(pow(tpos[X],2.0) + pow(tpos[Y],2.0));
188
				TskBuf[id].body_ang[i][W] = sqrt(pow(tpos[X],2.0) + pow(tpos[Y],2.0));
188
			}
189
			}
189
			TskBuf[id].tx = (rand() % 512000) / 1000.0f - 256.0f;
190
			TskBuf[id].tx = cast(float)(rand() % 512000) / 1000.0f - 256.0f;
190
			TskBuf[id].ty = (rand() % 512000) / 1000.0f - 256.0f;
191
			TskBuf[id].ty = cast(float)(rand() % 512000) / 1000.0f - 256.0f;
191
			TskBuf[id].tx += TskBuf[id].px;
192
			TskBuf[id].tx += TskBuf[id].px;
192
			TskBuf[id].ty += TskBuf[id].py;
193
			TskBuf[id].ty += TskBuf[id].py;
193
			TskBuf[id].wait = 60;
194
			TskBuf[id].wait = 60;
Lines 279-291 Link Here
279
			TskBuf[id].fp_draw = &TSKBrokenBodyDraw;
280
			TskBuf[id].fp_draw = &TSKBrokenBodyDraw;
280
			TskBuf[id].fp_exit = &TSKBrokenBodyExit;
281
			TskBuf[id].fp_exit = &TSKBrokenBodyExit;
281
			TskBuf[id].alpha = 1.0f;
282
			TskBuf[id].alpha = 1.0f;
282
			TskBuf[id].tx = (rand() % 256000) / 1000.0f - 128.0f;
283
			TskBuf[id].tx = cast(float)(rand() % 256000) / 1000.0f - 128.0f;
283
			TskBuf[id].ty = (rand() % 256000) / 1000.0f - 128.0f;
284
			TskBuf[id].ty = cast(float)(rand() % 256000) / 1000.0f - 128.0f;
284
			TskBuf[id].tx *= 2.0f;
285
			TskBuf[id].tx *= 2.0f;
285
			TskBuf[id].ty *= 2.0f;
286
			TskBuf[id].ty *= 2.0f;
286
			TskBuf[id].tx += TskBuf[id].px;
287
			TskBuf[id].tx += TskBuf[id].px;
287
			TskBuf[id].ty += TskBuf[id].py;
288
			TskBuf[id].ty += TskBuf[id].py;
288
			TskBuf[id].rot_add = (rand % 30) - 15;
289
			TskBuf[id].rot_add = cast(float)(rand % 30) - 15;
289
			if(!(TskBuf[id].rot_add - 15))		TskBuf[id].rot_add = -1;
290
			if(!(TskBuf[id].rot_add - 15))		TskBuf[id].rot_add = -1;
290
			else if(!(TskBuf[id].rot_add + 15)) TskBuf[id].rot_add = +1;
291
			else if(!(TskBuf[id].rot_add + 15)) TskBuf[id].rot_add = +1;
291
			if(TskBuf[id].rot_add < 0) TskBuf[id].rot_add = PI / (TskBuf[id].rot_add - 15);
292
			if(TskBuf[id].rot_add < 0) TskBuf[id].rot_add = PI / (TskBuf[id].rot_add - 15);
Lines 410-422 Link Here
410
			TskBuf[id].fp_draw = &TSKBrokenLineDraw;
411
			TskBuf[id].fp_draw = &TSKBrokenLineDraw;
411
			TskBuf[id].fp_exit = &TSKBrokenLineExit;
412
			TskBuf[id].fp_exit = &TSKBrokenLineExit;
412
			TskBuf[id].alpha = 1.0f;
413
			TskBuf[id].alpha = 1.0f;
413
			TskBuf[id].tx = (rand() % 256000) / 1000.0f - 128.0f;
414
			TskBuf[id].tx = cast(float)(rand() % 256000) / 1000.0f - 128.0f;
414
			TskBuf[id].ty = (rand() % 256000) / 1000.0f - 128.0f;
415
			TskBuf[id].ty = cast(float)(rand() % 256000) / 1000.0f - 128.0f;
415
			TskBuf[id].tx *= 2.0f;
416
			TskBuf[id].tx *= 2.0f;
416
			TskBuf[id].ty *= 2.0f;
417
			TskBuf[id].ty *= 2.0f;
417
			TskBuf[id].tx += TskBuf[id].px;
418
			TskBuf[id].tx += TskBuf[id].px;
418
			TskBuf[id].ty += TskBuf[id].py;
419
			TskBuf[id].ty += TskBuf[id].py;
419
			TskBuf[id].rot_add = (rand % 30) - 15;
420
			TskBuf[id].rot_add = cast(float)(rand % 30) - 15;
420
			if(!(TskBuf[id].rot_add - 15))		TskBuf[id].rot_add = -1;
421
			if(!(TskBuf[id].rot_add - 15))		TskBuf[id].rot_add = -1;
421
			else if(!(TskBuf[id].rot_add + 15)) TskBuf[id].rot_add = +1;
422
			else if(!(TskBuf[id].rot_add + 15)) TskBuf[id].rot_add = +1;
422
			if(TskBuf[id].rot_add < 0) TskBuf[id].rot_add = PI / (TskBuf[id].rot_add - 15);
423
			if(TskBuf[id].rot_add < 0) TskBuf[id].rot_add = PI / (TskBuf[id].rot_add - 15);
(-)a2k-org/a2k_src/src/enemy01.d (-3 / +3 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.c.math;
10
private	import	std.random;
10
private	import	std.random;
11
private	import	SDL;
11
private	import	SDL;
12
private	import	opengl;
12
private	import	opengl;
Lines 63-70 Link Here
63
	switch(TskBuf[id].step){
63
	switch(TskBuf[id].step){
64
		case	0:
64
		case	0:
65
			TskBuf[id].tskid |= TSKID_ZAKO;
65
			TskBuf[id].tskid |= TSKID_ZAKO;
66
			TskBuf[id].px = (rand() % 1536) - 768.0f;
66
			TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
67
			TskBuf[id].py = (rand() % 1536) - 768.0f;
67
			TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
68
			TskBuf[id].fp_int = null;
68
			TskBuf[id].fp_int = null;
69
			TskBuf[id].fp_draw = &TSKenemy01Draw;
69
			TskBuf[id].fp_draw = &TSKenemy01Draw;
70
			TskBuf[id].fp_exit = &TSKenemy01Exit;
70
			TskBuf[id].fp_exit = &TSKenemy01Exit;
(-)a2k-org/a2k_src/src/enemy02.d (-3 / +3 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.c.math;
10
private	import	std.random;
10
private	import	std.random;
11
private	import	SDL;
11
private	import	SDL;
12
private	import	opengl;
12
private	import	opengl;
Lines 63-70 Link Here
63
	switch(TskBuf[id].step){
63
	switch(TskBuf[id].step){
64
		case	0:
64
		case	0:
65
			TskBuf[id].tskid |= TSKID_ZAKO;
65
			TskBuf[id].tskid |= TSKID_ZAKO;
66
			TskBuf[id].px = (rand() % 1536) - 768.0f;
66
			TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
67
			TskBuf[id].py = (rand() % 1536) - 768.0f;
67
			TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
68
			TskBuf[id].fp_int = null;
68
			TskBuf[id].fp_int = null;
69
			TskBuf[id].fp_draw = &TSKenemy02Draw;
69
			TskBuf[id].fp_draw = &TSKenemy02Draw;
70
			TskBuf[id].fp_exit = &TSKenemy02Exit;
70
			TskBuf[id].fp_exit = &TSKenemy02Exit;
(-)a2k-org/a2k_src/src/enemy03.d (-3 / +3 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.c.math;
10
private	import	std.random;
10
private	import	std.random;
11
private	import	SDL;
11
private	import	SDL;
12
private	import	opengl;
12
private	import	opengl;
Lines 63-70 Link Here
63
	switch(TskBuf[id].step){
63
	switch(TskBuf[id].step){
64
		case	0:
64
		case	0:
65
			TskBuf[id].tskid |= TSKID_ZAKO;
65
			TskBuf[id].tskid |= TSKID_ZAKO;
66
			TskBuf[id].px = (rand() % 1536) - 768.0f;
66
			TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
67
			TskBuf[id].py = (rand() % 1536) - 768.0f;
67
			TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
68
			TskBuf[id].tid = ship_id;
68
			TskBuf[id].tid = ship_id;
69
			TskBuf[id].fp_int = null;
69
			TskBuf[id].fp_int = null;
70
			TskBuf[id].fp_draw = &TSKenemy03Draw;
70
			TskBuf[id].fp_draw = &TSKenemy03Draw;
(-)a2k-org/a2k_src/src/enemy04.d (-7 / +7 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.c.math;
10
private	import	std.random;
10
private	import	std.random;
11
private	import	SDL;
11
private	import	SDL;
12
private	import	opengl;
12
private	import	opengl;
Lines 53-60 Link Here
53
	switch(TskBuf[id].step){
53
	switch(TskBuf[id].step){
54
		case	0:
54
		case	0:
55
			TskBuf[id].tskid |= TSKID_ZAKO;
55
			TskBuf[id].tskid |= TSKID_ZAKO;
56
			TskBuf[id].px = (rand() % 1536) - 768.0f;
56
			TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
57
			TskBuf[id].py = (rand() % 1536) - 768.0f;
57
			TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
58
			TskBuf[id].tid = ship_id;
58
			TskBuf[id].tid = ship_id;
59
			TskBuf[id].fp_int = null;
59
			TskBuf[id].fp_int = null;
60
			TskBuf[id].fp_draw = &TSKenemy04Draw;
60
			TskBuf[id].fp_draw = &TSKenemy04Draw;
Lines 132-145 Link Here
132
			TskBuf[id].vx = TskBuf[id].px;
132
			TskBuf[id].vx = TskBuf[id].px;
133
			TskBuf[id].vy = TskBuf[id].py;
133
			TskBuf[id].vy = TskBuf[id].py;
134
			if(!TskBuf[id].cnt){
134
			if(!TskBuf[id].cnt){
135
				TskBuf[id].tx = (rand() % 512) + 256.0f;
135
 				TskBuf[id].tx = cast(float)(rand() % 512) + 256.0f;
136
				TskBuf[id].ty = (rand() % 512) + 256.0f;
136
 				TskBuf[id].ty = cast(float)(rand() % 512) + 256.0f;
137
				if(TskBuf[id].px < ship_px) TskBuf[id].tx = +TskBuf[id].tx;
137
				if(TskBuf[id].px < ship_px) TskBuf[id].tx = +TskBuf[id].tx;
138
				else						TskBuf[id].tx = -TskBuf[id].tx;
138
				else						TskBuf[id].tx = -TskBuf[id].tx;
139
				if(TskBuf[id].py < ship_py) TskBuf[id].ty = +TskBuf[id].ty;
139
				if(TskBuf[id].py < ship_py) TskBuf[id].ty = +TskBuf[id].ty;
140
				else						TskBuf[id].ty = -TskBuf[id].ty;
140
				else						TskBuf[id].ty = -TskBuf[id].ty;
141
				if((rand() % 100) > 97) TskBuf[id].tx = -TskBuf[id].tx;
141
 				if(cast(float)(rand() % 100) > 97) TskBuf[id].tx = -TskBuf[id].tx;
142
				if((rand() % 100) > 97) TskBuf[id].ty = -TskBuf[id].ty;
142
 				if(cast(float)(rand() % 100) > 97) TskBuf[id].ty = -TskBuf[id].ty;
143
				TskBuf[id].tx = TskBuf[id].px + TskBuf[id].tx;
143
				TskBuf[id].tx = TskBuf[id].px + TskBuf[id].tx;
144
				TskBuf[id].ty = TskBuf[id].py + TskBuf[id].ty;
144
				TskBuf[id].ty = TskBuf[id].py + TskBuf[id].ty;
145
				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;
(-)a2k-org/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.c.math;
10
private	import	std.random;
10
private	import	std.random;
11
private	import	SDL;
11
private	import	SDL;
12
private	import	opengl;
12
private	import	opengl;
Lines 53-60 Link Here
53
	switch(TskBuf[id].step){
53
	switch(TskBuf[id].step){
54
		case	0:
54
		case	0:
55
			TskBuf[id].tskid |= TSKID_ZAKO;
55
			TskBuf[id].tskid |= TSKID_ZAKO;
56
			TskBuf[id].px = (rand() % 1536) - 768.0f;
56
			TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
57
			TskBuf[id].py = (rand() % 1536) - 768.0f;
57
			TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
58
			TskBuf[id].tid = ship_id;
58
			TskBuf[id].tid = ship_id;
59
			TskBuf[id].fp_int = null;
59
			TskBuf[id].fp_int = null;
60
			TskBuf[id].fp_draw = &TSKenemy05Draw;
60
			TskBuf[id].fp_draw = &TSKenemy05Draw;
Lines 127-168 Link Here
127
				}
127
				}
128
			}
128
			}
129
			/* 座標更新 */
129
			/* 座標更新 */
130
			if(TskBuf[id].px < ship_px){
130
 			TskBuf[id].vx = TskBuf[id].px;
131
				if(TskBuf[id].vx > +0.0f) TskBuf[id].vx += 1.0f / SPEED_RATE * 2.0f;
131
 			TskBuf[id].vy = TskBuf[id].py;
132
				else					  TskBuf[id].vx += 1.0f / SPEED_RATE * 1.5f;
132
 			if(!TskBuf[id].cnt){
133
				if(TskBuf[id].vx > +MAX_SPEED) TskBuf[id].vx = +MAX_SPEED;
133
 				TskBuf[id].tx = cast(float)(rand() % 512) + 256.0f;
134
			}else{
134
 				TskBuf[id].ty = cast(float)(rand() % 512) + 256.0f;
135
				if(TskBuf[id].vx < +0.0f) TskBuf[id].vx -= 1.0f / SPEED_RATE * 2.0f;
135
 				if(TskBuf[id].px < ship_px) TskBuf[id].tx = +TskBuf[id].tx;
136
				else					  TskBuf[id].vx -= 1.0f / SPEED_RATE * 1.5f;
136
 				else						TskBuf[id].tx = -TskBuf[id].tx;
137
				if(TskBuf[id].vx < -MAX_SPEED) TskBuf[id].vx = -MAX_SPEED;
137
 				if(TskBuf[id].py < ship_py) TskBuf[id].ty = +TskBuf[id].ty;
138
			}
138
 				else						TskBuf[id].ty = -TskBuf[id].ty;
139
			if(TskBuf[id].py < ship_py){
139
 				if(cast(float)(rand() % 100) > 97) TskBuf[id].tx = -TskBuf[id].tx;
140
				if(TskBuf[id].vy > +0.0f) TskBuf[id].vy += 1.0f / SPEED_RATE * 2.0f;
140
 				if(cast(float)(rand() % 100) > 97) TskBuf[id].ty = -TskBuf[id].ty;
141
				else					  TskBuf[id].vy += 1.0f / SPEED_RATE * 1.5f;
141
 				TskBuf[id].tx = TskBuf[id].px + TskBuf[id].tx;
142
				if(TskBuf[id].vy > +MAX_SPEED) TskBuf[id].vy = +MAX_SPEED;
142
 				TskBuf[id].ty = TskBuf[id].py + TskBuf[id].ty;
143
			}else{
143
 				if(TskBuf[id].tx < -ENEMY_AREAMAX) TskBuf[id].tx = -ENEMY_AREAMAX + 1.0f;
144
				if(TskBuf[id].vy < +0.0f) TskBuf[id].vy -= 1.0f / SPEED_RATE * 2.0f;
144
 				if(TskBuf[id].tx > +ENEMY_AREAMAX) TskBuf[id].tx = +ENEMY_AREAMAX - 1.0f;
145
				else					  TskBuf[id].vy -= 1.0f / SPEED_RATE * 1.5f;
145
 				if(TskBuf[id].ty < -ENEMY_AREAMAX) TskBuf[id].ty = -ENEMY_AREAMAX + 1.0f;
146
				if(TskBuf[id].vy < -MAX_SPEED) TskBuf[id].vy = -MAX_SPEED;
146
 				if(TskBuf[id].ty > +ENEMY_AREAMAX) TskBuf[id].ty = +ENEMY_AREAMAX - 1.0f;
147
			}
147
 				TskBuf[id].cnt = 180;
148
			TskBuf[id].px += TskBuf[id].vx;
148
  			}else{
149
			TskBuf[id].py += TskBuf[id].vy;
149
 				TskBuf[id].cnt--;
150
			if(TskBuf[id].px < -ENEMY_AREAMAX){
150
  			}
151
				TskBuf[id].px = -ENEMY_AREAMAX;
151
 			TskBuf[id].px += (TskBuf[id].tx - TskBuf[id].px) / (180 / 4);
152
				TskBuf[id].vx = -TskBuf[id].vx / 2;
152
 			TskBuf[id].py += (TskBuf[id].ty - TskBuf[id].py) / (180 / 4);
153
			}
153
 			TskBuf[id].vx -= TskBuf[id].px;
154
			if(TskBuf[id].px > +ENEMY_AREAMAX){
154
 			TskBuf[id].vy -= TskBuf[id].py;
155
				TskBuf[id].px = +ENEMY_AREAMAX;
156
				TskBuf[id].vx = -TskBuf[id].vx / 2;
157
			}
158
			if(TskBuf[id].py < -ENEMY_AREAMAX){
159
				TskBuf[id].py = -ENEMY_AREAMAX;
160
				TskBuf[id].vy = -TskBuf[id].vy / 2;
161
			}
162
			if(TskBuf[id].py > +ENEMY_AREAMAX){
163
				TskBuf[id].py = +ENEMY_AREAMAX;
164
				TskBuf[id].vy = -TskBuf[id].vy / 2;
165
			}
166
			TskBuf[id].rot = atan2(-TskBuf[id].vx, -TskBuf[id].vy);
155
			TskBuf[id].rot = atan2(-TskBuf[id].vx, -TskBuf[id].vy);
167
			break;
156
			break;
168
		default:
157
		default:
(-)a2k-org/a2k_src/src/enemy06.d (-7 / +7 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.c.math;
10
private	import	std.random;
10
private	import	std.random;
11
private	import	SDL;
11
private	import	SDL;
12
private	import	opengl;
12
private	import	opengl;
Lines 65-72 Link Here
65
	switch(TskBuf[id].step){
65
	switch(TskBuf[id].step){
66
		case	0:
66
		case	0:
67
			TskBuf[id].tskid |= TSKID_ZAKO;
67
			TskBuf[id].tskid |= TSKID_ZAKO;
68
			TskBuf[id].px = (rand() % 1536) - 768.0f;
68
			TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
69
			TskBuf[id].py = (rand() % 1536) - 768.0f;
69
			TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
70
			TskBuf[id].tid = ship_id;
70
			TskBuf[id].tid = ship_id;
71
			TskBuf[id].fp_int = null;
71
			TskBuf[id].fp_int = null;
72
			TskBuf[id].fp_draw = &TSKenemy06Draw;
72
			TskBuf[id].fp_draw = &TSKenemy06Draw;
Lines 145-158 Link Here
145
			TskBuf[id].vx = TskBuf[id].px;
145
			TskBuf[id].vx = TskBuf[id].px;
146
			TskBuf[id].vy = TskBuf[id].py;
146
			TskBuf[id].vy = TskBuf[id].py;
147
			if(TskBuf[id].cnt == TskBuf[id].mov_cnt){
147
			if(TskBuf[id].cnt == TskBuf[id].mov_cnt){
148
				TskBuf[id].tx = (rand() % 512) + 256.0f;
148
 				TskBuf[id].tx = cast(float)(rand() % 512) + 256.0f;
149
				TskBuf[id].ty = (rand() % 512) + 256.0f;
149
 				TskBuf[id].ty = cast(float)(rand() % 512) + 256.0f;
150
				if(TskBuf[id].px < ship_px) TskBuf[id].tx = +TskBuf[id].tx;
150
				if(TskBuf[id].px < ship_px) TskBuf[id].tx = +TskBuf[id].tx;
151
				else						TskBuf[id].tx = -TskBuf[id].tx;
151
				else						TskBuf[id].tx = -TskBuf[id].tx;
152
				if(TskBuf[id].py < ship_py) TskBuf[id].ty = +TskBuf[id].ty;
152
				if(TskBuf[id].py < ship_py) TskBuf[id].ty = +TskBuf[id].ty;
153
				else						TskBuf[id].ty = -TskBuf[id].ty;
153
				else						TskBuf[id].ty = -TskBuf[id].ty;
154
				if((rand() % 100) > 97) TskBuf[id].tx = -TskBuf[id].tx;
154
 				if(cast(float)(rand() % 100) > 97) TskBuf[id].tx = -TskBuf[id].tx;
155
				if((rand() % 100) > 97) TskBuf[id].ty = -TskBuf[id].ty;
155
 				if(cast(float)(rand() % 100) > 97) TskBuf[id].ty = -TskBuf[id].ty;
156
				TskBuf[id].tx = TskBuf[id].px + TskBuf[id].tx;
156
				TskBuf[id].tx = TskBuf[id].px + TskBuf[id].tx;
157
				TskBuf[id].ty = TskBuf[id].py + TskBuf[id].ty;
157
				TskBuf[id].ty = TskBuf[id].py + TskBuf[id].ty;
158
				if(TskBuf[id].tx < -ENEMY_AREAMAX) TskBuf[id].tx = -ENEMY_AREAMAX + 1.0f;
158
				if(TskBuf[id].tx < -ENEMY_AREAMAX) TskBuf[id].tx = -ENEMY_AREAMAX + 1.0f;
(-)a2k-org/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.c.math;
10
private	import	std.random;
10
private	import	std.random;
11
private	import	SDL;
11
private	import	SDL;
12
private	import	opengl;
12
private	import	opengl;
Lines 63-70 Link Here
63
	switch(TskBuf[id].step){
63
	switch(TskBuf[id].step){
64
		case	0:
64
		case	0:
65
			TskBuf[id].tskid |= TSKID_ZAKO;
65
			TskBuf[id].tskid |= TSKID_ZAKO;
66
			TskBuf[id].px = (rand() % 1536) - 768.0f;
66
			TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
67
			TskBuf[id].py = (rand() % 1536) - 768.0f;
67
			TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
68
			TskBuf[id].tid = ship_id;
68
			TskBuf[id].tid = ship_id;
69
			TskBuf[id].fp_int = null;
69
			TskBuf[id].fp_int = null;
70
			TskBuf[id].fp_draw = &TSKenemy07Draw;
70
			TskBuf[id].fp_draw = &TSKenemy07Draw;
Lines 137-178 Link Here
137
				}
137
				}
138
			}
138
			}
139
			/* 座標更新 */
139
			/* 座標更新 */
140
			if(TskBuf[id].px < ship_px){
140
 			TskBuf[id].vx = TskBuf[id].px;
141
				if(TskBuf[id].vx > +0.0f) TskBuf[id].vx += 1.0f / SPEED_RATE * 2.0f;
141
 			TskBuf[id].vy = TskBuf[id].py;
142
				else					  TskBuf[id].vx += 1.0f / SPEED_RATE * 1.5f;
142
 			if(!TskBuf[id].cnt){
143
				if(TskBuf[id].vx > +MAX_SPEED) TskBuf[id].vx = +MAX_SPEED;
143
 				TskBuf[id].tx = cast(float)(rand() % 512) + 256.0f;
144
			}else{
144
 				TskBuf[id].ty = cast(float)(rand() % 512) + 256.0f;
145
				if(TskBuf[id].vx < +0.0f) TskBuf[id].vx -= 1.0f / SPEED_RATE * 2.0f;
145
 				if(TskBuf[id].px < ship_px) TskBuf[id].tx = +TskBuf[id].tx;
146
				else					  TskBuf[id].vx -= 1.0f / SPEED_RATE * 1.5f;
146
 				else						TskBuf[id].tx = -TskBuf[id].tx;
147
				if(TskBuf[id].vx < -MAX_SPEED) TskBuf[id].vx = -MAX_SPEED;
147
 				if(TskBuf[id].py < ship_py) TskBuf[id].ty = +TskBuf[id].ty;
148
			}
148
 				else						TskBuf[id].ty = -TskBuf[id].ty;
149
			if(TskBuf[id].py < ship_py){
149
 				if(cast(float)(rand() % 100) > 97) TskBuf[id].tx = -TskBuf[id].tx;
150
				if(TskBuf[id].vy > +0.0f) TskBuf[id].vy += 1.0f / SPEED_RATE * 2.0f;
150
 				if(cast(float)(rand() % 100) > 97) TskBuf[id].ty = -TskBuf[id].ty;
151
				else					  TskBuf[id].vy += 1.0f / SPEED_RATE * 1.5f;
151
 				TskBuf[id].tx = TskBuf[id].px + TskBuf[id].tx;
152
				if(TskBuf[id].vy > +MAX_SPEED) TskBuf[id].vy = +MAX_SPEED;
152
 				TskBuf[id].ty = TskBuf[id].py + TskBuf[id].ty;
153
			}else{
153
 				if(TskBuf[id].tx < -ENEMY_AREAMAX) TskBuf[id].tx = -ENEMY_AREAMAX + 1.0f;
154
				if(TskBuf[id].vy < +0.0f) TskBuf[id].vy -= 1.0f / SPEED_RATE * 2.0f;
154
 				if(TskBuf[id].tx > +ENEMY_AREAMAX) TskBuf[id].tx = +ENEMY_AREAMAX - 1.0f;
155
				else					  TskBuf[id].vy -= 1.0f / SPEED_RATE * 1.5f;
155
 				if(TskBuf[id].ty < -ENEMY_AREAMAX) TskBuf[id].ty = -ENEMY_AREAMAX + 1.0f;
156
				if(TskBuf[id].vy < -MAX_SPEED) TskBuf[id].vy = -MAX_SPEED;
156
 				if(TskBuf[id].ty > +ENEMY_AREAMAX) TskBuf[id].ty = +ENEMY_AREAMAX - 1.0f;
157
			}
157
 				TskBuf[id].cnt = 180;
158
			TskBuf[id].px += TskBuf[id].vx;
158
  			}else{
159
			TskBuf[id].py += TskBuf[id].vy;
159
 				TskBuf[id].cnt--;
160
			if(TskBuf[id].px < -ENEMY_AREAMAX){
160
  			}
161
				TskBuf[id].px = -ENEMY_AREAMAX;
161
 			TskBuf[id].px += (TskBuf[id].tx - TskBuf[id].px) / (180 / 4);
162
				TskBuf[id].vx = -TskBuf[id].vx / 2;
162
 			TskBuf[id].py += (TskBuf[id].ty - TskBuf[id].py) / (180 / 4);
163
			}
163
 			TskBuf[id].vx -= TskBuf[id].px;
164
			if(TskBuf[id].px > +ENEMY_AREAMAX){
164
 			TskBuf[id].vy -= TskBuf[id].py;
165
				TskBuf[id].px = +ENEMY_AREAMAX;
166
				TskBuf[id].vx = -TskBuf[id].vx / 2;
167
			}
168
			if(TskBuf[id].py < -ENEMY_AREAMAX){
169
				TskBuf[id].py = -ENEMY_AREAMAX;
170
				TskBuf[id].vy = -TskBuf[id].vy / 2;
171
			}
172
			if(TskBuf[id].py > +ENEMY_AREAMAX){
173
				TskBuf[id].py = +ENEMY_AREAMAX;
174
				TskBuf[id].vy = -TskBuf[id].vy / 2;
175
			}
176
			TskBuf[id].rot = atan2(-TskBuf[id].vx, -TskBuf[id].vy);
165
			TskBuf[id].rot = atan2(-TskBuf[id].vx, -TskBuf[id].vy);
177
			break;
166
			break;
178
		default:
167
		default:
(-)a2k-org/a2k_src/src/enemy08.d (-3 / +3 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.c.math;
10
private	import	std.random;
10
private	import	std.random;
11
private	import	SDL;
11
private	import	SDL;
12
private	import	opengl;
12
private	import	opengl;
Lines 65-72 Link Here
65
	switch(TskBuf[id].step){
65
	switch(TskBuf[id].step){
66
		case	0:
66
		case	0:
67
			TskBuf[id].tskid |= TSKID_ZAKO;
67
			TskBuf[id].tskid |= TSKID_ZAKO;
68
			TskBuf[id].px = (rand() % 1536) - 768.0f;
68
			TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
69
			TskBuf[id].py = (rand() % 1536) - 768.0f;
69
			TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
70
			TskBuf[id].tid = ship_id;
70
			TskBuf[id].tid = ship_id;
71
			TskBuf[id].fp_int = null;
71
			TskBuf[id].fp_int = null;
72
			TskBuf[id].fp_draw = &TSKenemy08Draw;
72
			TskBuf[id].fp_draw = &TSKenemy08Draw;
(-)a2k-org/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.c.math;
10
private	import	SDL;
10
private	import	SDL;
11
private	import	opengl;
11
private	import	opengl;
12
private	import	util_sdl;
12
private	import	util_sdl;
Lines 158-163 Link Here
158
	return;
158
	return;
159
}
159
}
160
160
161
161
void	TSKeshotInt(int id)
162
void	TSKeshotInt(int id)
162
{
163
{
163
	TskBuf[id].step = -1;
164
	TskBuf[id].step = -1;
Lines 165-170 Link Here
165
	return;
166
	return;
166
}
167
}
167
168
169
168
void	TSKeshotDrawSimple(int id)
170
void	TSKeshotDrawSimple(int id)
169
{
171
{
170
	float[XYZ]	pos;
172
	float[XYZ]	pos;
Lines 198-203 Link Here
198
	glEnd();
200
	glEnd();
199
}
201
}
200
202
203
201
void	TSKeshotDrawActive(int id)
204
void	TSKeshotDrawActive(int id)
202
{
205
{
203
	float[XYZ]	pos;
206
	float[XYZ]	pos;
Lines 231-236 Link Here
231
	glEnd();
234
	glEnd();
232
}
235
}
233
236
237
234
void	TSKeshotExit(int id)
238
void	TSKeshotExit(int id)
235
{
239
{
236
	BulletCommand	cmd = TskBuf[id].bullet_command;
240
	BulletCommand	cmd = TskBuf[id].bullet_command;
Lines 243-248 Link Here
243
	}
247
	}
244
}
248
}
245
249
250
246
float	getShipDirection(int id)
251
float	getShipDirection(int id)
247
{
252
{
248
	float	px,py;
253
	float	px,py;
Lines 257-259 Link Here
257
	return	dir;
262
	return	dir;
258
}
263
}
259
264
265
(-)a2k-org/a2k_src/src/init.d (-5 / +5 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 101-107 Link Here
101
		fd.open("score.dat");
101
		fd.open("score.dat");
102
		if(fd.size() != 12){
102
		if(fd.size() != 12){
103
			fd.close();
103
			fd.close();
104
			writefln("score.dat initialized");
104
			printf("score.dat initialized");
105
		    fd.create("score.dat");
105
		    fd.create("score.dat");
106
			fd.write(high_easy);
106
			fd.write(high_easy);
107
			fd.write(high_normal);
107
			fd.write(high_normal);
Lines 112-118 Link Here
112
			fd.read(high_hard);
112
			fd.read(high_hard);
113
		}
113
		}
114
	} catch (Error e) {
114
	} catch (Error e) {
115
		writefln("score.dat initialized");
115
		printf("score.dat initialized");
116
	    fd.create("score.dat");
116
	    fd.create("score.dat");
117
		fd.write(high_easy);
117
		fd.write(high_easy);
118
		fd.write(high_normal);
118
		fd.write(high_normal);
Lines 126-132 Link Here
126
	try {
126
	try {
127
		if(fd.size() != 12){
127
		if(fd.size() != 12){
128
			fd.close();
128
			fd.close();
129
			writefln("config.dat initialized");
129
			printf("config.dat initialized");
130
		    fd.create("config.dat");
130
		    fd.create("config.dat");
131
			fd.write(pad_type);
131
			fd.write(pad_type);
132
			fd.write(vol_se);
132
			fd.write(vol_se);
Lines 139-145 Link Here
139
			volumeSNDmusic(vol_music);
139
			volumeSNDmusic(vol_music);
140
		}
140
		}
141
	} catch (Error e) {
141
	} catch (Error e) {
142
		writefln("config.dat initialized");
142
		printf("config.dat initialized");
143
	    fd.create("config.dat");
143
	    fd.create("config.dat");
144
		fd.write(pad_type);
144
		fd.write(pad_type);
145
		fd.write(vol_se);
145
		fd.write(vol_se);
(-)a2k-org/a2k_src/src/luminous.d (-1 / +1 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;
(-)a2k-org/a2k_src/src/main.d (-6 / +11 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 31-55 Link Here
31
int		pause = 0;
32
int		pause = 0;
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
*/
40
public int main(char[][] args) {
38
	int		result;
41
	int		result;
39
  
42
/*  
40
	gc_init();
43
	gc_init();
41
	_minit();
44
	_minit();
42
45
43
	try{
46
	try{
44
		_moduleCtor();
47
		_moduleCtor();
45
		_moduleUnitTests();
48
		_moduleUnitTests();
49
*/
46
		result = boot();
50
		result = boot();
51
/*
47
	}catch (Object o){
52
	}catch (Object o){
48
		MessageBoxA(null, cast(char*)o.toString(), "Error", MB_OK | MB_ICONEXCLAMATION);
53
		MessageBoxA(null, cast(char*)o.toString(), "Error", MB_OK | MB_ICONEXCLAMATION);
49
		result = 0;
54
		result = 0;
50
	}
55
	}
51
	gc_term();
56
	gc_term();
52
57
*/
53
	return result;
58
	return result;
54
}
59
}
55
60
(-)a2k-org/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.c.math;
10
private	import	std.random;
10
private	import	std.random;
11
private	import	std.string;
11
private	import	std.string;
12
private	import	SDL;
12
private	import	SDL;
(-)a2k-org/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.c.math;
10
private	import	std.random;
10
private	import	std.random;
11
private	import	std.string;
11
private	import	std.string;
12
private	import	SDL;
12
private	import	SDL;
(-)a2k-org/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.c.math;
10
private	import	std.random;
10
private	import	std.random;
11
private	import	std.string;
11
private	import	std.string;
12
private	import	SDL;
12
private	import	SDL;
(-)a2k-org/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.c.math;
10
private	import	std.random;
10
private	import	std.random;
11
private	import	std.string;
11
private	import	std.string;
12
private	import	SDL;
12
private	import	SDL;
(-)a2k-org/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.c.math;
10
private	import	std.random;
10
private	import	std.random;
11
private	import	std.string;
11
private	import	std.string;
12
private	import	SDL;
12
private	import	SDL;
(-)a2k-org/a2k_src/src/ship.d (-1 / +1 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.c.math;
10
private	import	std.intrinsic;
10
private	import	std.intrinsic;
11
private	import	std.random;
11
private	import	std.random;
12
private	import	SDL;
12
private	import	SDL;
(-)a2k-org/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-org/a2k_src/src/system.d (-1 / +6 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;
(-)a2k-org/a2k_src/src/task.d (-1 / +3 lines)
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;
(-)a2k-org/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-org/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-org/a2k_src/src/util_pad.d (-1 / +2 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,
(-)a2k-org/a2k_src/src/util_sdl.d (-20 / +35 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 30-40 Link Here
30
	EX,
33
	EX,
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;
Lines 43-62 Link Here
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;
46
56
private	GLuint TEXTURE_NONE = 0xffffffff;
47
private	GLuint[]	tex_bank;
57
private	GLuint[]	tex_bank;
48
58
49
int		initSDL()
59
int		initSDL()
60
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
65
55
	Uint32	videoFlags;
66
	Uint32	videoFlags;
56
	videoFlags = SDL_OPENGL | SDL_FULLSCREEN;
67
//	videoFlags = SDL_OPENGL | SDL_FULLSCREEN;
57
	//videoFlags = SDL_OPENGL | SDL_RESIZABLE;
68
	//videoFlags = SDL_OPENGL | SDL_RESIZABLE;
58
	debug{
69
	debug{
59
		videoFlags = SDL_OPENGL | SDL_RESIZABLE;
70
 		if((pads & PAD_BUTTON1)){
71
 			videoFlags = SDL_OPENGL | SDL_FULLSCREEN;
72
 		}else{
73
 			videoFlags = SDL_OPENGL | SDL_RESIZABLE;
74
 		}
75
 	}else{
76
 		videoFlags = SDL_OPENGL | SDL_FULLSCREEN;
60
	}
77
	}
61
	primary = SDL_SetVideoMode(width, height, 0, videoFlags);
78
	primary = SDL_SetVideoMode(width, height, 0, videoFlags);
62
	if(primary == null){
79
	if(primary == null){
Lines 67-80 Link Here
67
	tex_bank.length  = SURFACE_MAX;
84
	tex_bank.length  = SURFACE_MAX;
68
	for(int i = 0; i < SURFACE_MAX; i++){
85
	for(int i = 0; i < SURFACE_MAX; i++){
69
		offscreen[i] = null;
86
		offscreen[i] = null;
70
		tex_bank[i]  = cast(GLuint)-1;
87
 		tex_bank[i]  = TEXTURE_NONE;
71
	}
88
	}
72
89
73
	glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
90
	glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
74
    resizedSDL(width, height);
91
    resizedSDL(width, height);
75
	SDL_ShowCursor(SDL_DISABLE);
92
	SDL_ShowCursor(SDL_DISABLE);
76
93
77
	SDL_WM_SetCaption(cast(char*)PROJECT_NAME, null);
94
	SDL_WM_SetCaption(cast(char*)PROJECT_NAME, null);
95
 	SDL_WM_SetIcon(SDL_LoadBMP("icon.bmp"), null);
78
96
79
	return	1;
97
	return	1;
80
}
98
}
Lines 96-104 Link Here
96
	SDL_ShowCursor(SDL_ENABLE);
114
	SDL_ShowCursor(SDL_ENABLE);
97
	SDL_Quit();
115
	SDL_Quit();
98
}
116
}
117
99
118
100
119
void readSDLtexture(char[] fname, int bank)
101
void	readSDLtexture(char[] fname, int bank)
102
{
120
{
103
	offscreen[bank] = SDL_LoadBMP(toStringz(fname));
121
	offscreen[bank] = SDL_LoadBMP(toStringz(fname));
104
	if(offscreen[bank]){
122
	if(offscreen[bank]){
Lines 110-140 Link Here
110
	}
128
	}
111
}
129
}
112
130
113
131
void bindSDLtexture(int bank)
114
void	bindSDLtexture(int bank)
115
{
132
{
116
	if(tex_bank[bank] != -1) glBindTexture(GL_TEXTURE_2D, tex_bank[bank]);
133
	if(tex_bank[bank] != TEXTURE_NONE) glBindTexture(GL_TEXTURE_2D, tex_bank[bank]);
117
}
134
}
118
135
119
136
void clearSDL()
120
void	clearSDL()
121
{
137
{
122
	glClear(GL_COLOR_BUFFER_BIT);
138
	glClear(GL_COLOR_BUFFER_BIT);
123
}
139
}
124
140
125
141
void flipSDL()
126
void	flipSDL()
127
{
142
{
128
	glFlush();
143
	glFlush();
129
	SDL_GL_SwapBuffers();
144
	SDL_GL_SwapBuffers();
130
}
145
}
131
146
132
147
void resizedSDL(int w, int h)
133
void	resizedSDL(int w, int h)
134
{
148
{
135
	glViewport(0, 0, w, h);
149
	glViewport(0, 0, w, h);
136
	glMatrixMode(GL_PROJECTION);
150
	glMatrixMode(GL_PROJECTION);
137
	glLoadIdentity();
151
	glLoadIdentity();
152
	w = (w ? w : 1);
138
	glFrustum(-nearPlane,nearPlane,
153
	glFrustum(-nearPlane,nearPlane,
139
			  -nearPlane * h / w,
154
			  -nearPlane * h / w,
140
			   nearPlane * h / w,
155
			   nearPlane * h / w,
(-)a2k-org/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