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

Collapse All | Expand All

(-)tt/import/opengl.d (-8 / +2 lines)
Lines 1-10 Link Here
1
version (Win32) {
2
	private import std.c.windows.windows;
3
	extern(Windows):
4
}
5
version (linux) {
6
	extern(C):
1
	extern(C):
7
}
8
2
9
alias uint GLenum;
3
alias uint GLenum;
10
alias ubyte GLboolean;
4
alias ubyte GLboolean;
Lines 1116-1122 Link Here
1116
/*************************************************************/
1110
/*************************************************************/
1117
1111
1118
void /*APIENTRY*/glAccum (GLenum op, GLfloat value);
1112
void /*APIENTRY*/glAccum (GLenum op, GLfloat value);
1119
void /*APIENTRY*/glAlphaFunc (GLenum func, GLclampf ref);
1113
void /*APIENTRY*/glAlphaFunc (GLenum func, GLclampf);
1120
GLboolean /*APIENTRY*/glAreTexturesResident (GLsizei n, GLuint *textures, GLboolean *residences);
1114
GLboolean /*APIENTRY*/glAreTexturesResident (GLsizei n, GLuint *textures, GLboolean *residences);
1121
void /*APIENTRY*/glArrayElement (GLint i);
1115
void /*APIENTRY*/glArrayElement (GLint i);
1122
void /*APIENTRY*/glBegin (GLenum mode);
1116
void /*APIENTRY*/glBegin (GLenum mode);
Lines 1369-1375 Link Here
1369
void /*APIENTRY*/glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
1363
void /*APIENTRY*/glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
1370
void /*APIENTRY*/glSelectBuffer (GLsizei size, GLuint *buffer);
1364
void /*APIENTRY*/glSelectBuffer (GLsizei size, GLuint *buffer);
1371
void /*APIENTRY*/glShadeModel (GLenum mode);
1365
void /*APIENTRY*/glShadeModel (GLenum mode);
1372
void /*APIENTRY*/glStencilFunc (GLenum func, GLint ref, GLuint mask);
1366
void /*APIENTRY*/glStencilFunc (GLenum func, GLint, GLuint mask);
1373
void /*APIENTRY*/glStencilMask (GLuint mask);
1367
void /*APIENTRY*/glStencilMask (GLuint mask);
1374
void /*APIENTRY*/glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
1368
void /*APIENTRY*/glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
1375
void /*APIENTRY*/glTexCoord1d (GLdouble s);
1369
void /*APIENTRY*/glTexCoord1d (GLdouble s);
(-)tt/import/openglu.d (-5 lines)
Lines 1-11 Link Here
1
import opengl;
1
import opengl;
2
2
3
version (Win32) {
4
	extern(Windows):
5
}
6
version (linux) {
7
	extern(C):
3
	extern(C):
8
}
9
4
10
GLubyte* gluErrorString (
5
GLubyte* gluErrorString (
11
    GLenum   errCode);
6
    GLenum   errCode);
(-)tt/import/SDL.d (-29 / +22 lines)
Lines 20-37 Link Here
20
    slouken@devolution.com
20
    slouken@devolution.com
21
*/
21
*/
22
22
23
import SDL_types;
23
public import SDL_keysym_;
24
import SDL_getenv;
24
public import SDL_version_;
25
import SDL_error;
25
public import SDL_active;
26
import SDL_rwops;
26
public import SDL_audio;
27
import SDL_timer;
27
public import SDL_byteorder;
28
import SDL_audio;
28
public import SDL_cdrom;
29
import SDL_cdrom;
29
public import SDL_copying;
30
import SDL_joystick;
30
public import SDL_endian;
31
import SDL_events;
31
public import SDL_error;
32
import SDL_video;
32
public import SDL_events;
33
import SDL_byteorder;
33
public import SDL_getenv;
34
import SDL_Version;
34
public import SDL_joystick;
35
public import SDL_keyboard;
36
public import SDL_mouse;
37
public import SDL_mutex;
38
public import SDL_quit;
39
public import SDL_rwops;
40
public import SDL_syswm;
41
public import SDL_thread;
42
public import SDL_timer;
43
public import SDL_types;
44
public import SDL_video;
35
45
36
extern(C):
46
extern(C):
37
47
Lines 73-92 Link Here
73
 */
83
 */
74
void SDL_Quit();
84
void SDL_Quit();
75
85
76
/+
77
void SDL_SetModuleHandle(void *hInst);
78
extern(Windows) void* GetModuleHandle(char*);
79
80
static this()
81
{
82
	/* Load SDL dynamic link library */
83
	if (SDL_Init(SDL_INIT_NOPARACHUTE) < 0)
84
		throw new Error("Error loading SDL");
85
	SDL_SetModuleHandle(GetModuleHandle(null));
86
}
87
88
static ~this()
89
{
90
	SDL_Quit();
91
}
92
+/
(-)tt/import/SDL_events.d (-4 / +4 lines)
Lines 304-311 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 uint SDL_QUERY	= cast(uint) -1;
307
const int SDL_QUERY	= -1;
308
const uint SDL_IGNORE	= 0;
308
const int SDL_IGNORE	= 0;
309
const uint SDL_DISABLE	= 0;
309
const int SDL_DISABLE	= 0;
310
const uint SDL_ENABLE	= 1;
310
const int SDL_ENABLE	= 1;
311
Uint8 SDL_EventState(Uint8 type, int state);
311
Uint8 SDL_EventState(Uint8 type, int state);
(-)tt/import/SDL_keyboard.d (-1 / +1 lines)
Lines 26-32 Link Here
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
import SDL_Keysym;
29
import SDL_keysym_;
30
30
31
extern(C):
31
extern(C):
32
32
(-)tt/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);
(-)tt/import/SDL_mixer.d (-1 / +1 lines)
Lines 22-28 Link Here
22
22
23
// convert to D by shinichiro.h
23
// convert to D by shinichiro.h
24
24
25
/* $Id: SDL_mixer.d,v 1.1.1.1 2004/11/10 13:45:22 kenta Exp $ */
25
/* $Id: SDL_mixer.d,v 1.1.1.1 2006/11/19 07:54:54 kenta Exp $ */
26
26
27
import SDL;
27
import SDL;
28
28
(-)tt/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
import SDL_Version;
25
import SDL_version_;
26
26
27
extern(C):
27
extern(C):
28
28
(-)tt/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();
(-)tt/Makefile (+27 lines)
Line 0 Link Here
1
DC=gdmd
2
#DC=gdc
3
ifeq ($(DC), gdmd)
4
DFLAGS=-O -d -release -Iimport -Isrc
5
#DFLAGS=-g -debug -Iimport -Isrc
6
DOUT=-of
7
else
8
DFLAGS=-O -frelease -Iimport -Isrc
9
#DFLAGS=-g -fdebug -Iimport -Isrc
10
DOUT=-o
11
endif
12
13
DSRC=$(shell find src/ -name "*.d")
14
SOURCES=$(DSRC) import/SDL_video.d import/SDL_mixer.d
15
OBJS=$(SOURCES:.d=.o)
16
EXE=torustrooper
17
18
all: $(EXE)
19
20
$(EXE): $(OBJS)
21
	gcc -o $@ $(OBJS) -lbulletml_d -lgphobos -lpthread -lm -lSDL -lGL -lGLU -lSDL_mixer -lstdc++
22
23
$(OBJS): %.o: %.d
24
	$(DC) -c $(DOUT)$@ $(DFLAGS) $<
25
26
27
(-)tt/src/abagames/tt/barrage.d (-11 / +15 lines)
Lines 17-22 Link Here
17
private import abagames.tt.bulletimpl;
17
private import abagames.tt.bulletimpl;
18
private import abagames.tt.bullettarget;
18
private import abagames.tt.bullettarget;
19
private import abagames.tt.shape;
19
private import abagames.tt.shape;
20
import linux_listdir;
20
21
21
/**
22
/**
22
 * Barrage pattern.
23
 * Barrage pattern.
Lines 30-40 Link Here
30
  int prevWait, postWait;
31
  int prevWait, postWait;
31
  bool noXReverse = false;
32
  bool noXReverse = false;
32
33
33
  public static this() {
34
  public static void randInit() {
34
    rand = new Rand;
35
    rand = new Rand;
35
  }
36
  }
36
37
37
  public static void setRandSeed(long seed) {
38
  public static void setRandSeed(long seed) {
39
  if (!rand) rand = new Rand;
38
    rand.setSeed(seed);
40
    rand.setSeed(seed);
39
  }
41
  }
40
42
Lines 93-121 Link Here
93
public class BarrageManager {
95
public class BarrageManager {
94
 private:
96
 private:
95
  static BulletMLParserTinyXML *parser[char[]][char[]];
97
  static BulletMLParserTinyXML *parser[char[]][char[]];
98
  static BulletMLParserTinyXML *parser2[char[]];
96
  static const char[] BARRAGE_DIR_NAME = "barrage";
99
  static const char[] BARRAGE_DIR_NAME = "barrage";
97
100
98
  public static void load() {
101
  public static void load() {
99
    char[][] dirs = listdir(BARRAGE_DIR_NAME);
102
    char[][] dirs = linux_listdir.listdir(BARRAGE_DIR_NAME);
100
    foreach (char[] dirName; dirs) {
103
    foreach (char[] dirName; dirs) {
101
      char[][] files = listdir(BARRAGE_DIR_NAME ~ "/" ~ dirName);
104
      char[][] files = linux_listdir.listdir(BARRAGE_DIR_NAME ~ "/" ~ dirName);
102
      foreach (char[] fileName; files) {
105
      foreach (char[] fileName; files) {
103
        if (getExt(fileName) != "xml")
106
        if (getExt(fileName) != "xml")
104
          continue;
107
          continue;
105
        parser[dirName][fileName] = getInstance(dirName, fileName);
108
	char[] barrageName = dirName ~ "/" ~ fileName;
109
        parser2[barrageName] = getInstance(dirName, fileName);
106
      }
110
      }
107
    }
111
    }
108
  }
112
  }
109
113
110
  public static BulletMLParserTinyXML* getInstance(char[] dirName, char[] fileName) {
114
  public static BulletMLParserTinyXML* getInstance(char[] dirName, char[] fileName) {
111
    if (!parser[dirName][fileName]) {
115
	char[] barrageName = dirName ~ "/" ~ fileName;
112
      char[] barrageName = dirName ~ "/" ~ fileName;
116
    if (!parser2[barrageName]) {
113
      Logger.info("Load BulletML: " ~ barrageName);
117
	Logger.info("Load BulletML: " ~ barrageName);
114
      parser[dirName][fileName] = 
118
	parser2[barrageName] = 
115
        BulletMLParserTinyXML_new(std.string.toStringz(BARRAGE_DIR_NAME ~ "/" ~ barrageName));
119
	  BulletMLParserTinyXML_new(std.string.toStringz(BARRAGE_DIR_NAME ~ "/" ~ barrageName));
116
      BulletMLParserTinyXML_parse(parser[dirName][fileName]);
120
	BulletMLParserTinyXML_parse(parser2[barrageName]);
117
    }
121
    }
118
    return parser[dirName][fileName];
122
    return parser2[barrageName];
119
  }
123
  }
120
124
121
  public static BulletMLParserTinyXML*[] getInstanceList(char[] dirName) {
125
  public static BulletMLParserTinyXML*[] getInstanceList(char[] dirName) {
(-)tt/src/abagames/tt/enemy.d (+3 lines)
Lines 59-64 Link Here
59
59
60
  public static this() {
60
  public static this() {
61
    rand = new Rand;
61
    rand = new Rand;
62
    ShipShape.randInit();
63
    Particle.randInit();
64
    Barrage.randInit();
62
  }
65
  }
63
66
64
  public static void setRandSeed(long seed) {
67
  public static void setRandSeed(long seed) {
(-)tt/src/abagames/tt/particle.d (-1 / +1 lines)
Lines 42-48 Link Here
42
  float d1, d2, md1, md2;
42
  float d1, d2, md1, md2;
43
  float width, height;
43
  float width, height;
44
44
45
  public static this() {
45
  public static void randInit() {
46
    rand = new Rand;
46
    rand = new Rand;
47
  }
47
  }
48
48
(-)tt/src/abagames/tt/shape.d (-3 / +3 lines)
Lines 66-75 Link Here
66
  Vector rocketPos, fragmentPos;
66
  Vector rocketPos, fragmentPos;
67
  int color;
67
  int color;
68
68
69
  static this() {
69
  public static void randInit() {
70
    rand = new Rand;
70
    rand = new Rand;
71
  }
71
  }
72
  
72
73
  public this(long randSeed) {
73
  public this(long randSeed) {
74
    rand.setSeed(randSeed);
74
    rand.setSeed(randSeed);
75
  }
75
  }
Lines 809-815 Link Here
809
    _collision = new Vector;
809
    _collision = new Vector;
810
    return _shape = v;
810
    return _shape = v;
811
  }
811
  }
812
  
812
813
  public float size(float v) {
813
  public float size(float v) {
814
    return _size = v;
814
    return _size = v;
815
  }
815
  }
(-)tt/src/abagames/tt/stagemanager.d (-16 / +16 lines)
Lines 435-459 Link Here
435
    br.setLongRange(longRange);
435
    br.setLongRange(longRange);
436
    BulletMLParserTinyXML*[] ps;
436
    BulletMLParserTinyXML*[] ps;
437
    int psn;
437
    int psn;
438
    if (baseDir) {
438
  //  if (baseDir) {
439
      ps = BarrageManager.getInstanceList(baseDir);
439
    //  ps = BarrageManager.getInstanceList(baseDir);
440
      int pi = rand.nextInt(ps.length);
440
    //  int pi = rand.nextInt(ps.length);
441
      br.addBml(ps[pi], rank, true, speedRank);
441
    //  br.addBml(ps[pi], rank, true, speedRank);
442
    } else {
442
  //  } else {
443
      br.addBml("basic", "straight.xml", rank, true, speedRank);
443
      br.addBml("basic", "straight.xml", rank, true, speedRank);
444
    }
444
  //  }
445
    ps = BarrageManager.getInstanceList("morph");
445
 //   ps = BarrageManager.getInstanceList("morph");
446
    psn = ps.length;
446
    psn = 13;
447
    for (int i = 0; i < morphCnt; i++) {
447
    for (int i = 0; i < morphCnt; i++) {
448
      int pi = rand.nextInt(ps.length);
448
      int pi = rand.nextInt(13);
449
      while (!ps[pi]) {
449
    //  while (!ps[pi]) {
450
        pi--;
450
      //  pi--;
451
        if (pi < 0)
451
        if (pi < 0)
452
          pi = ps.length - 1;
452
          pi = 13 - 1;
453
      }
453
  //    }
454
      br.addBml(ps[pi], morphRank, true, speedRank);
454
//      br.addBml(ps[pi], morphRank, true, speedRank);
455
      delete ps[pi];
455
  //    delete ps[pi];
456
      psn--;
456
    //  psn--;
457
    }
457
    }
458
    return br;
458
    return br;
459
  }
459
  }
(-)tt/src/abagames/util/bulletml/bullet.d (-1 / +1 lines)
Lines 77-83 Link Here
77
    this.runner = runner;
77
    this.runner = runner;
78
  }
78
  }
79
79
80
  public void set(BulletMLRunner* runner, 
80
  public void set(BulletMLRunner* runner,
81
		  float x, float y, float deg, float speed, float rank) {
81
		  float x, float y, float deg, float speed, float rank) {
82
    set(x, y, deg, speed, rank);
82
    set(x, y, deg, speed, rank);
83
    setRunner(runner);
83
    setRunner(runner);
(-)tt/src/abagames/util/iterator.d (-1 / +4 lines)
Lines 35-38 Link Here
35
  }
35
  }
36
}
36
}
37
37
38
alias ArrayIterator!(char[]) StringIterator;
38
//alias ArrayIterator!(char[]) StringIterator;
39
class StringIterator : ArrayIterator!(char[]) {
40
    this(char[][] d) { super(d); }
41
}
(-)tt/src/abagames/util/logger.d (-8 / +8 lines)
Lines 5-11 Link Here
5
 */
5
 */
6
module abagames.util.logger;
6
module abagames.util.logger;
7
7
8
private import std.stream;
8
private import std.cstream;
9
private import std.string;
9
private import std.string;
10
10
11
/**
11
/**
Lines 56-83 Link Here
56
56
57
  public static void info(char[] msg, bool nline = true) {
57
  public static void info(char[] msg, bool nline = true) {
58
    if (nline)
58
    if (nline)
59
      stderr.writeLine(msg);
59
      derr.writeLine(msg);
60
    else
60
    else
61
      stderr.writeString(msg);
61
      derr.writeString(msg);
62
  }
62
  }
63
63
64
  public static void info(double n, bool nline = true) {
64
  public static void info(double n, bool nline = true) {
65
    if (nline)
65
    if (nline)
66
      stderr.writeLine(std.string.toString(n));
66
      derr.writeLine(std.string.toString(n));
67
    else
67
    else
68
      stderr.writeString(std.string.toString(n) ~ " ");
68
      derr.writeString(std.string.toString(n) ~ " ");
69
  }
69
  }
70
70
71
  public static void error(char[] msg) {
71
  public static void error(char[] msg) {
72
    stderr.writeLine("Error: " ~ msg);
72
    derr.writeLine("Error: " ~ msg);
73
  }
73
  }
74
74
75
  public static void error(Exception e) {
75
  public static void error(Exception e) {
76
    stderr.writeLine("Error: " ~ e.toString());
76
    derr.writeLine("Error: " ~ e.toString());
77
  }
77
  }
78
78
79
  public static void error(Error e) {
79
  public static void error(Error e) {
80
    stderr.writeLine("Error: " ~ e.toString());
80
    derr.writeLine("Error: " ~ e.toString());
81
    if (e.next)
81
    if (e.next)
82
      error(e.next);
82
      error(e.next);
83
  }
83
  }
(-)tt/src/abagames/util/sdl/luminous.d (+1 lines)
Lines 9-14 Link Here
9
private import std.string;
9
private import std.string;
10
private import opengl;
10
private import opengl;
11
private import abagames.util.actor;
11
private import abagames.util.actor;
12
import std.c.string;
12
13
13
/**
14
/**
14
 * Luminous effect texture.
15
 * Luminous effect texture.
(-)tt/src/linux_listdir.d (+45 lines)
Line 0 Link Here
1
private import std.string;
2
3
/***************************************************
4
 * Return contents of directory.
5
 */
6
7
extern (C)
8
{
9
	struct DIR;
10
11
	struct Dirent
12
	{
13
		uint d_ino;
14
		uint d_off;
15
		ushort d_reclen;
16
		char d_type;
17
		char[256] d_name;	/* NAME_MAX+1 from linux/limits.h */
18
	};
19
	
20
	DIR* opendir(char* name);
21
	int closedir(DIR* dir);
22
	Dirent* readdir(DIR* dir);
23
}
24
25
char[][] listdir(char[] pathname)
26
{
27
28
	Dirent* entry;
29
	DIR* dir = opendir(toStringz(pathname));
30
	char[][] result;
31
	entry = readdir(dir);
32
	while ( entry !is null )
33
	{
34
		
35
		if ( std.string.strcmp(entry.d_name.ptr, ".") != 0
36
			&& std.string.strcmp(entry.d_name.ptr, "..") != 0)
37
		{
38
			result ~= std.string.toString(entry.d_name.ptr).dup;
39
		}
40
		entry = readdir(dir);
41
	}
42
	closedir(dir);
43
	return result;
44
45
}

Return to bug 185583