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

Collapse All | Expand All

(-)vr/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
+/
(-)vr/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);
(-)vr/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
(-)vr/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);
(-)vr/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 2005/03/13 16:15:04 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
(-)vr/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
(-)vr/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();
(-)vr/Makefile (+17 lines)
Line 0 Link Here
1
DSRC=$(shell find src -name "*.d")
2
SOURCES=$(DSRC) import/SDL_video.d import/SDL_mixer.d
3
OBJS=$(SOURCES:.d=.o)
4
CFLAGS=
5
DFLAGS=-O -release -Iimport -Isrc -I/usr/X11R6/include/
6
EXE=valandrick
7
8
9
all: $(EXE)
10
11
$(EXE): import/SDL_keysym_.d $(OBJS) $(COBJS)
12
	gcc $(CFLAGS) -o $@ $(OBJS) $(COBJS) -lbulletml_d -L/usr/local/lib -L/usr/lib -lgphobos -lpthread -lGLU -lGL -lglut -lm -lstdc++ -lSDL -lSDL_mixer
13
14
$(OBJS): %.o: %.d
15
	gdmd -debug -d -c -of$@ $(DFLAGS) $<
16
17
clean: rm -r src/abagames/vr/*.o
(-)vr/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
  }
(-)vr/src/abagames/util/sdl/luminous.d (+1 lines)
Lines 7-12 Link Here
7
7
8
private import std.math;
8
private import std.math;
9
private import std.string;
9
private import std.string;
10
private import std.c.string;
10
private import opengl;
11
private import opengl;
11
private import abagames.util.actor;
12
private import abagames.util.actor;
12
13
(-)vr/src/abagames/util/sdl/sound.d (-2 / +2 lines)
Lines 67-73 Link Here
67
public class Music: Sound {
67
public class Music: Sound {
68
 public:
68
 public:
69
  static int fadeOutSpeed = 1280;
69
  static int fadeOutSpeed = 1280;
70
  static char[] dir = "sounds/musics";
70
  static char[] dir = "/usr/share/games/valandrick/sounds/musics";
71
 private:
71
 private:
72
  Mix_Music* music;
72
  Mix_Music* music;
73
73
Lines 131-137 Link Here
131
131
132
public class Chunk: Sound {
132
public class Chunk: Sound {
133
 public:
133
 public:
134
  static char[] dir = "sounds/chunks";
134
  static char[] dir = "/usr/share/games/valandrick/sounds/chunks";
135
 private:
135
 private:
136
  Mix_Chunk* chunk;
136
  Mix_Chunk* chunk;
137
  int chunkChannel;
137
  int chunkChannel;
(-)vr/src/abagames/util/sdl/texture.d (-4 / +2 lines)
Lines 16-22 Link Here
16
 */
16
 */
17
public class Texture {
17
public class Texture {
18
 public:
18
 public:
19
  static char[] imagesDir = "images/";
19
  static char[] imagesDir = "/usr/share/games/valandrick/images/";
20
  static SDL_Surface*[char[]] surface;
20
  static SDL_Surface*[char[]] surface;
21
 private:
21
 private:
22
  GLuint num, maskNum;
22
  GLuint num, maskNum;
Lines 25-33 Link Here
25
  Uint32[128 * 128] maskPixels;
25
  Uint32[128 * 128] maskPixels;
26
26
27
  public static SDL_Surface* loadBmp(char[] name) {
27
  public static SDL_Surface* loadBmp(char[] name) {
28
    if (surface[name]) {
28
{
29
      return surface[name];
30
    } else {
31
      char[] fileName = imagesDir ~ name;
29
      char[] fileName = imagesDir ~ name;
32
      SDL_Surface *s = SDL_LoadBMP(std.string.toStringz(fileName));
30
      SDL_Surface *s = SDL_LoadBMP(std.string.toStringz(fileName));
33
      if (!s)
31
      if (!s)
(-)vr/src/abagames/vr/barrage.d (-6 / +8 lines)
Lines 24-30 Link Here
24
public class BarrageManager {
24
public class BarrageManager {
25
 private:
25
 private:
26
  static BulletMLParserTinyXML *parser[char[]][char[]];
26
  static BulletMLParserTinyXML *parser[char[]][char[]];
27
  static const char[] BARRAGE_DIR_NAME = "barrage";
27
  static BulletMLParserTinyXML *parser2[char[]];
28
  static const char[] BARRAGE_DIR_NAME = "/usr/share/games/valandrick/barrage";
28
29
29
  public static void load() {
30
  public static void load() {
30
    char[][] dirs = listdir(BARRAGE_DIR_NAME);
31
    char[][] dirs = listdir(BARRAGE_DIR_NAME);
Lines 33-52 Link Here
33
      foreach (char[] fileName; files) {
34
      foreach (char[] fileName; files) {
34
        if (getExt(fileName) != "xml")
35
        if (getExt(fileName) != "xml")
35
          continue;
36
          continue;
36
        parser[dirName][fileName] = getInstance(dirName, fileName);
37
	char[] barrageName = dirName ~ "/" ~ fileName;
38
        parser2[barrageName] = getInstance(dirName, fileName);
37
      }
39
      }
38
    }
40
    }
39
  }
41
  }
40
42
41
  public static BulletMLParserTinyXML* getInstance(char[] dirName, char[] fileName) {
43
  public static BulletMLParserTinyXML* getInstance(char[] dirName, char[] fileName) {
42
    if (!parser[dirName][fileName]) {
43
      char[] barrageName = dirName ~ "/" ~ fileName;
44
      char[] barrageName = dirName ~ "/" ~ fileName;
45
    if (!parser2[barrageName]) {
44
      Logger.info("Loading BulletML: " ~ barrageName);
46
      Logger.info("Loading BulletML: " ~ barrageName);
45
      parser[dirName][fileName] = 
47
      parser2[barrageName] = 
46
        BulletMLParserTinyXML_new(std.string.toStringz(BARRAGE_DIR_NAME ~ "/" ~ barrageName));
48
        BulletMLParserTinyXML_new(std.string.toStringz(BARRAGE_DIR_NAME ~ "/" ~ barrageName));
47
      BulletMLParserTinyXML_parse(parser[dirName][fileName]);
49
      BulletMLParserTinyXML_parse(parser2[barrageName]);
48
    }
50
    }
49
    return parser[dirName][fileName];
51
    return parser2[barrageName];
50
  }
52
  }
51
53
52
  public static BulletMLParserTinyXML*[] getInstanceList(char[] dirName) {
54
  public static BulletMLParserTinyXML*[] getInstanceList(char[] dirName) {
(-)vr/src/abagames/vr/prefmanager.d (-1 / +1 lines)
Lines 15-21 Link Here
15
public class PrefManager: abagames.util.prefmanager.PrefManager {
15
public class PrefManager: abagames.util.prefmanager.PrefManager {
16
 private:
16
 private:
17
  static const int VERSION_NUM = 10;
17
  static const int VERSION_NUM = 10;
18
  static const char[] PREF_FILE = "vr.prf";
18
  static const char[] PREF_FILE = "/var/games/vr.prf";
19
  PrefData _prefData;
19
  PrefData _prefData;
20
20
21
  public this() {
21
  public this() {
(-)vr/src/abagames/vr/stagemanager.d (-6 / +6 lines)
Lines 264-277 Link Here
264
      ebs.barrage = null;
264
      ebs.barrage = null;
265
      BulletMLParserTinyXML* bp = BarrageManager.getInstance("basic", "straight.xml");
265
      BulletMLParserTinyXML* bp = BarrageManager.getInstance("basic", "straight.xml");
266
      ebs.barrage ~= new ParserParam(bp, 1, false, 1);
266
      ebs.barrage ~= new ParserParam(bp, 1, false, 1);
267
      BulletMLParserTinyXML*[] ps = BarrageManager.getInstanceList("morph");
267
//      BulletMLParserTinyXML*[] ps = BarrageManager.getInstanceList("morph");
268
      while (morphRank > 1) {
268
      while (morphRank > 1) {
269
        morphRank /= 3;
269
        morphRank /= 3;
270
        int pi = rand.nextInt(ps.length);
270
        int pi = rand.nextInt(11);
271
        float mr = morphRank;
271
        float mr = morphRank;
272
        if (mr > 0.75f)
272
        if (mr > 0.75f)
273
          mr = 0.75f + rand.nextFloat(0.25f);
273
          mr = 0.75f + rand.nextFloat(0.25f);
274
        ebs.barrage ~= new ParserParam(ps[pi], mr, false, 1);
274
   //     ebs.barrage ~= 11, mr, false, 1);
275
      }
275
      }
276
      rad += radInc;
276
      rad += radInc;
277
      ad *= 1 + rand.nextSignedFloat(0.2f);
277
      ad *= 1 + rand.nextSignedFloat(0.2f);
Lines 310-323 Link Here
310
    bulletMinSpeed = 0.5f / (sr + 1);
310
    bulletMinSpeed = 0.5f / (sr + 1);
311
    if (ship.airMode) {
311
    if (ship.airMode) {
312
      float morphRank = rank * 0.25f;
312
      float morphRank = rank * 0.25f;
313
      BulletMLParserTinyXML*[] ps = BarrageManager.getInstanceList("morph");
313
    //  BulletMLParserTinyXML*[] ps = BarrageManager.getInstanceList("morph");
314
      while (morphRank > 1) {
314
      while (morphRank > 1) {
315
        morphRank /= 3;
315
        morphRank /= 3;
316
        int pi = rand.nextInt(ps.length);
316
        int pi = rand.nextInt(11);
317
        float mr = morphRank;
317
        float mr = morphRank;
318
        if (mr > 0.75f)
318
        if (mr > 0.75f)
319
          mr = 0.75f + rand.nextFloat(0.25f);
319
          mr = 0.75f + rand.nextFloat(0.25f);
320
        spec.barrage ~= new ParserParam(ps[pi], mr, false, 1);
320
     //   spec.barrage ~= new 11, mr, false, 1);
321
      }
321
      }
322
      bulletMaxSpeed *= 3;
322
      bulletMaxSpeed *= 3;
323
      bulletMinSpeed *= 1.75f;
323
      bulletMinSpeed *= 1.75f;

Return to bug 185587