debian/0000755000000000000000000000000012164051121007157 5ustar debian/source/0000755000000000000000000000000012164051121010457 5ustar debian/source/format0000644000000000000000000000001412164051121011665 0ustar 3.0 (quilt) debian/val-and-rick.manpages0000644000000000000000000000002612164051121013142 0ustar debian/val-and-rick.6 debian/docs0000644000000000000000000000001312164051121010024 0ustar readme.txt debian/readme_e.txt0000644000000000000000000000734312164051121011470 0ustar Val & Rick readme.txt for Windows98/2000/XP(OpenGL required) ver. 0.1 alpha (C) Kenta Cho Annihilate the enemies flying around space! But please excuse the alpha quality of Val & Rick. Usage Instructions Player movement arrow keys, numeric keypad, W/A/S/D, joystick Shot Z, Left Control, ., joystick buttons 1/4/5/8 Hold down for rapid fire Blaster/Fixed direction X, Left Alt, Left Shift, /, joystick buttons 2/3/6/7 The blaster destroys the enemy under the target in front of the player. Use it to destroy the bosses located on the floating asteroids. Pause P How to play At the title screen, press a shot key to start the game. Press the escape key the end the game. Advance the player (Val) toward the top of the screen to destroy enemies. Destroy the enemies and grab the crystals. After collecting a certain number of crystals, a friendly ship (Rick) will enter the game. Combine with the friendly ship, and until the crystals are used up, you can fly through space. Enemy bullets cannot hit you, and you earn points. When the player is destroyed, the game is over. Options The following options may be set. -brightness n Set the brightness (n = 0 - 100, default 100) -luminosity n Set the luminosity (n = 0 - 100, default 0) -res x y Set the resolution -nosound Disable the sound -window Activate windowed mode -reverse Swap shot and blaster keys Suggestions, thoughts Please send comments etc. to cs8k-cyu@asahi-net.or.jp Thanks 2Chan Game Development Board, Shooter Game Development Collaborators 631 other people using this for bitmap creation. Val & Rick was written in the D language. The D Programming Language http://www.kmonos.net/alang/d/ libBulletML is used to parse the BulletML files libBulletML http://shinh.skr.jp/libbulletml/ Simple DirectMedia Layer is used for media handling. Simple DirectMedia Layer http://www.libsdl.org/ SDL_mixer and the Ogg Vorbis codec are used for background music and sound effects. SDL_mixer 1.2 http://www.libsdl.org/projects/SDL_mixer/ Vorbis.com http://www.vorbis.com/ The OpenGL, SDL, and SDL_mixer header files from D - porting are used D - porting http://shinh.skr.jp/d/porting.html The Mersenne Twister random number generator is used Mersenne Twister: A random number generator (since 1997/10) http://www.math.sci.hiroshima-u.ac.jp/‾m-mat/MT/mt.html History 2005 3/14 ver. 0.1 alpha Alpha Version License Val & Rick is distributed under a BSD style license. License ------- Copyright 2005 Kenta Cho. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. debian/copyright0000644000000000000000000000522212164051121011113 0ustar This package was debianized by Miriam Ruiz on Sat, 25 Aug 2007 19:58:40 +0000. It was downloaded from http://www.asahi-net.or.jp/~cs8k-cyu/windows/vr0_1a.zip Upstream Author: Kenta Cho Copyright: Copyright 2005 Kenta Cho import/SDL* : Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga License: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import/SDL*: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA On Debian systems, the complete text of the GNU Lesser General Public License can be found in `/usr/share/common-licenses/LGPL-2'. The Debian packaging is Copyright (C) 2007, Miriam Ruiz and is licensed under the GPL, see `/usr/share/common-licenses/GPL-3'. debian/menu0000644000000000000000000000024112164051121010043 0ustar ?package(val-and-rick):needs="X11" section="Games/Action"\ title="Val & Rick" command="/usr/games/val-and-rick" \ icon="/usr/share/pixmaps/val-and-rick.xpm" debian/val-and-rick.docs0000644000000000000000000000003712164051121012301 0ustar readme.txt debian/readme_e.txt debian/changelog0000644000000000000000000000300112164051120011022 0ustar val-and-rick (0.1a.dfsg1-4) unstable; urgency=low * Ported to D language version 2 (closes: #707274) * Added build-depends on libphobos-dev * Added English translation of the readme file (closes: #617194) - Translated by Christopher Cramer, thanks! * Switch dh-style minimal rules file * Mark -data package as Multi-Arch: foreign * Conforms to standards 3.9.4 -- Peter De Wachter Sun, 30 Jun 2013 13:09:10 +0200 val-and-rick (0.1a.dfsg1-3) unstable; urgency=low * Team upload [ Miriam Ruiz ] * Replaced XS-DM-Upload-Allowed by DM-Upload-Allowed in debian/control. [ Ansgar Burchardt ] * Remove deprecated Encoding key from .desktop file [ Vincent Fourmond ] * Explicitly build with D version 1 (closes: #653094) * Switch to format 3.0 (quilt) and drop build-dep on quilt * Provide build-arch and build-indep targets * Conforms to standards 3.9.2 -- Vincent Fourmond Sat, 07 Jan 2012 16:57:57 +0100 val-and-rick (0.1a.dfsg1-2) unstable; urgency=low [ Peter De Wachter ] * Fixed link command, patch from Arthur Loiret. (Closes: #458281) * Fixed segfault when SDL init fails. (Closes: #456024) [ Miriam Ruiz ] * Added XS-DM-Upload-Allowed tag to control to allow uploads from Debian Maintainers. -- Miriam Ruiz Thu, 03 Jan 2008 12:12:59 +0000 val-and-rick (0.1a.dfsg1-1) unstable; urgency=low * Initial release. Closes: #440901 -- Miriam Ruiz Sat, 25 Aug 2007 19:58:40 +0000 debian/compat0000644000000000000000000000000212164051121010355 0ustar 9 debian/val-and-rick.60000644000000000000000000000445212164051121011523 0ustar .\" (c) 2007 Miriam Ruiz .\" (c) 2005 Kenta Cho .\" .\" This document is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .\" .\" This package is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this package; if not, write to the Free Software .\" Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA .TH "Val & Rick" "6" "" "" "" .SH "NAME" val-and-rick \- shooter game .SH "DESCRIPTION" Val and Rick is probably the precursor to Gunroar, featuring similar controls but in a different environment. Only 2D sprites and backgrounds are used in what seems like a tribute to Xevious and Star Soldier. .SH "OPTIONS" These options are available: .TP \fB\-brightness n\fR Set the brightness of the screen.(n = 0 \- 100, default = 100) .TP \fB\-luminous n\fR Set the luminous intensity.(n = 0 \- 100, default = 50) .TP \fB\-nosound\fR Stop the sound. .TP \fB\-window\fR Launch the game in a window. .TP \fB\-fullscreen\fR Launch the game in fullscreen. .TP \fB\-res width height\fR Sets the resolution of the screen in pixels. .TP \fB\-nosound\fR .TP \fB\-nowait\fR .TP \fB\-accframe\fR .SH "USAGE" Press the Z key to shoot and hold down the X key to fix the direction of your aim. A power\-up icon in the shape of a tiny ship named Rick will appear if you collect enough blue orbs from defeated enemies, which is indicated at the bottom left of the screen. This will cause your ship to go into hyperdrive, that is until all energy is spent or your spacecraft takes damage from enemy bullets. Each successful hyperdrive attempt increases the counter by another hundred. The X key can also be used to drop bombs on grounded objects. Tap the P key to pause. The closer your ship is to the top of the screen, the faster it scrolls. .SH "AUTHOR" This game has been written by Kenta Cho debian/rules0000755000000000000000000000066312164051121010244 0ustar #!/usr/bin/make -f ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) DFLAGS = -fdebug else DFLAGS = -frelease endif %: dh $@ override_dh_auto_build: dh_auto_build -- DFLAGS="$(DFLAGS)" get-orig-source: dh_testdir dh_testroot wget http://www.asahi-net.or.jp/~cs8k-cyu/windows/vr0_1a.zip unzip vr0_1a.zip rm vr/*.dll rm vr/*.exe rm vr/lib/*.lib tar cvfz ../val-and-rick_0.1a.dfsg1.orig.tar.gz vr rm -rf vr0_1a.zip vr debian/control0000644000000000000000000000273312164051121010567 0ustar Source: val-and-rick Section: games Priority: extra Maintainer: Debian Games Team Uploaders: Miriam Ruiz , Peter De Wachter Build-Depends: debhelper (>= 9), gdc (>= 4.8.1), libphobos-dev, libglu1-mesa-dev | libglu-dev, libgl1-mesa-dev | libgl-dev, libsdl1.2-dev, libsdl-mixer1.2-dev, libbulletml-dev Build-Conflicts: libphobos-4.4-dev Standards-Version: 3.9.4 Vcs-Svn: svn://anonscm.debian.org/pkg-games/packages/trunk/val-and-rick/ Vcs-Browser: http://anonscm.debian.org/viewvc/pkg-games/packages/trunk/val-and-rick/ Package: val-and-rick Architecture: any Depends: val-and-rick-data (= ${source:Version}), ${shlibs:Depends}, ${misc:Depends} Description: shooter game Val & Rick is probably the precursor to Gunroar, featuring similar controls but in a different environment. Only 2D sprites and backgrounds are used in what seems like a tribute to Xevious and Star Soldier. . Val & Rick is another gem among many by Kenta Cho. Package: val-and-rick-data Architecture: all Multi-Arch: foreign Depends: ${shlibs:Depends}, ${misc:Depends} Recommends: val-and-rick Description: shooter game - game data Val & Rick is probably the precursor to Gunroar, featuring similar controls but in a different environment. Only 2D sprites and backgrounds are used in what seems like a tribute to Xevious and Star Soldier. . This package includes the architecture-independent data for Kenta Cho's game Val & Rick. debian/val-and-rick.install0000644000000000000000000000014112164051121013013 0ustar val-and-rick usr/games/ debian/*.xpm usr/share/pixmaps/ debian/*.desktop usr/share/applications/ debian/val-and-rick-data.install0000644000000000000000000000016012164051121013723 0ustar images usr/share/games/val-and-rick/ sounds usr/share/games/val-and-rick/ barrage usr/share/games/val-and-rick/ debian/patches/0000755000000000000000000000000012164051121010606 5ustar debian/patches/homedir.patch0000644000000000000000000000610212164051121013255 0ustar # Copyright (C) 2007 Peter De Wachter # Copyright (C) 2007 Miriam Ruiz # Distributed under the same license as the game. See debian/copyright. Index: val-and-rick-0.1a.dfsg1/src/abagames/vr/prefmanager.d =================================================================== --- val-and-rick-0.1a.dfsg1.orig/src/abagames/vr/prefmanager.d 2007-09-05 07:56:30.000000000 +0000 +++ val-and-rick-0.1a.dfsg1/src/abagames/vr/prefmanager.d 2007-09-05 07:57:43.000000000 +0000 @@ -6,6 +6,9 @@ module abagames.vr.prefmanager; private import std.stream; +private import std.c.stdlib; +private import std.string; +private import std.file; private import abagames.util.prefmanager; private import abagames.vr.ship; @@ -15,18 +18,31 @@ public class PrefManager: abagames.util.prefmanager.PrefManager { private: static const int VERSION_NUM = 10; - static const char[] PREF_FILE = "vr.prf"; + static const char[] PREF_FILE = "val-and-rick.prf"; PrefData _prefData; public this() { _prefData = new PrefData; } + public static char[] pref_dir() + { + char * home = getenv("HOME"); + if (home is null) + throw new Error("HOME environment variable not defined"); + char[] dir = std.string.toString(home) ~ "/.val-and-rick"; + try { + mkdir(dir); + } catch (FileException e) { + } + return dir; + } + public void load() { auto File fd = new File; try { int ver; - fd.open(PREF_FILE); + fd.open(pref_dir() ~ "/" ~ PREF_FILE); fd.read(ver); if (ver != VERSION_NUM) throw new Error("Wrong version num"); @@ -41,7 +57,7 @@ public void save() { auto File fd = new File; - fd.create(PREF_FILE); + fd.create(pref_dir() ~ "/" ~ PREF_FILE); fd.write(VERSION_NUM); _prefData.save(fd); fd.close(); Index: val-and-rick-0.1a.dfsg1/src/abagames/vr/replay.d =================================================================== --- val-and-rick-0.1a.dfsg1.orig/src/abagames/vr/replay.d 2007-09-05 07:56:30.000000000 +0000 +++ val-and-rick-0.1a.dfsg1/src/abagames/vr/replay.d 2007-09-05 07:58:45.000000000 +0000 @@ -8,13 +8,13 @@ private import std.stream; private import abagames.util.sdl.recordableinput; private import abagames.util.sdl.pad; +private import abagames.vr.prefmanager; /** * Manage a replay data. */ public class ReplayData { public: - static const char[] dir = "replay"; static const int VERSION_NUM = 10; InputRecord!(PadState) inputRecord; long seed; @@ -22,7 +22,7 @@ public void save(char[] fileName) { auto File fd = new File; - fd.create(dir ~ "/" ~ fileName); + fd.create(PrefManager.pref_dir() ~ "/" ~ fileName); fd.write(VERSION_NUM); fd.write(seed); inputRecord.save(fd); @@ -31,7 +31,7 @@ public void load(char[] fileName) { auto File fd = new File; - fd.open(dir ~ "/" ~ fileName); + fd.open(PrefManager.pref_dir() ~ "/" ~ fileName); int ver; fd.read(ver); if (ver != VERSION_NUM) debian/patches/series0000644000000000000000000000025612164051121012026 0ustar imports.patch fixes.patch makefile.patch directories.patch windowed.patch homedir.patch resizable.patch endian-clean.patch avoid-segfault-when-sdl-fails.patch dlang_v2.patch debian/patches/avoid-segfault-when-sdl-fails.patch0000644000000000000000000000122312164051121017352 0ustar # Copyright (C) 2007 Peter De Wachter # Distributed under the same license as the game. See debian/copyright. Index: val-and-rick-0.1a.dfsg1/src/abagames/vr/gamemanager.d =================================================================== --- val-and-rick-0.1a.dfsg1.orig/src/abagames/vr/gamemanager.d 2007-12-31 20:42:17.000000000 +0100 +++ val-and-rick-0.1a.dfsg1/src/abagames/vr/gamemanager.d 2007-12-31 20:57:38.000000000 +0100 @@ -168,7 +169,7 @@ } public void saveErrorReplay() { - if (state == inGameState) + if (state !is null && state == inGameState) inGameState.saveReplay("error.rpl"); } debian/patches/windowed.patch0000644000000000000000000000310212164051121013443 0ustar # Copyright (C) 2007 Miriam Ruiz # Distributed under the same license as the game. See debian/copyright. Index: val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/screen3d.d =================================================================== --- val-and-rick-0.1a.dfsg1.orig/src/abagames/util/sdl/screen3d.d 2005-03-14 01:15:04.000000000 +0000 +++ val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/screen3d.d 2007-09-05 07:48:38.000000000 +0000 @@ -22,7 +22,7 @@ float _nearPlane = 0.1; int _width = 640; int _height = 480; - bool _windowMode = false; + bool _windowMode = true; protected abstract void init(); protected abstract void close(); Index: val-and-rick-0.1a.dfsg1/src/abagames/vr/boot.d =================================================================== --- val-and-rick-0.1a.dfsg1.orig/src/abagames/vr/boot.d 2005-03-14 01:15:04.000000000 +0000 +++ val-and-rick-0.1a.dfsg1/src/abagames/vr/boot.d 2007-09-05 07:48:38.000000000 +0000 @@ -133,6 +133,9 @@ case "-window": screen.windowMode = true; break; + case "-fullscreen": + screen.windowMode = false; + break; case "-res": if (i >= args.length - 2) { usage(progName); @@ -176,5 +179,5 @@ private void usage(char[] progName) { Logger.error - ("Usage: " ~ progName ~ " [-window] [-res x y] [-brightness [0-100]] [-luminosity [0-100]] [-nosound] [-reverse] [-nowait]"); + ("Usage: " ~ progName ~ " [-window] [-fullscreen] [-res x y] [-brightness [0-100]] [-luminosity [0-100]] [-nosound] [-reverse] [-nowait]"); } debian/patches/resizable.patch0000644000000000000000000000341412164051121013611 0ustar # Copyright (C) 2007 Peter De Wachter # Copyright (C) 2007 Miriam Ruiz # Distributed under the same license as the game. See debian/copyright. Index: val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/screen3d.d =================================================================== --- val-and-rick-0.1a.dfsg1.orig/src/abagames/util/sdl/screen3d.d 2007-09-05 08:09:38.000000000 +0000 +++ val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/screen3d.d 2007-09-05 08:10:56.000000000 +0000 @@ -23,6 +23,7 @@ int _width = 640; int _height = 480; bool _windowMode = true; + Uint32 _videoFlags; protected abstract void init(); protected abstract void close(); @@ -34,13 +35,12 @@ "Unable to initialize SDL: " ~ std.string.toString(SDL_GetError())); } // Create an OpenGL screen. - Uint32 videoFlags; if (_windowMode) { - videoFlags = SDL_OPENGL | SDL_RESIZABLE; + _videoFlags = SDL_OPENGL | SDL_RESIZABLE; } else { - videoFlags = SDL_OPENGL | SDL_FULLSCREEN; + _videoFlags = SDL_OPENGL | SDL_FULLSCREEN; } - if (SDL_SetVideoMode(_width, _height, 0, videoFlags) == null) { + if (SDL_SetVideoMode(_width, _height, 0, _videoFlags) == null) { throw new SDLInitFailedException ("Unable to create SDL screen: " ~ std.string.toString(SDL_GetError())); } @@ -53,6 +53,11 @@ // Reset a viewport when the screen is resized. public void screenResized() { + if (SDL_SetVideoMode(width, height, 0, _videoFlags) == null) { + throw new Exception + ("Unable to resize SDL screen: " ~ std.string.toString(SDL_GetError())); + } + glViewport(0, 0, _width, _height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); debian/patches/makefile.patch0000644000000000000000000000071412164051121013406 0ustar # Copyright (C) 2007 Miriam Ruiz # Distributed under the same license as the game. See debian/copyright. --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +GDC=gdc +DSRC=$(shell find import src/abagames -name "*.d" | sort) +EXE=val-and-rick + +all: $(EXE) + +$(EXE): $(DSRC) + $(GDC) -o $@ -Iimport -Isrc -Wno-deprecated $(DFLAGS) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(DSRC) -lSDL -lGL -lGLU -lSDL_mixer -lbulletml + +clean: + rm -f $(EXE) + debian/patches/directories.patch0000644000000000000000000000416112164051121014145 0ustar # Copyright (C) 2007 Miriam Ruiz # Distributed under the same license as the game. See debian/copyright. Index: val-and-rick-0.1a.dfsg1/src/abagames/vr/barrage.d =================================================================== --- val-and-rick-0.1a.dfsg1.orig/src/abagames/vr/barrage.d 2007-09-07 00:24:50.000000000 +0200 +++ val-and-rick-0.1a.dfsg1/src/abagames/vr/barrage.d 2007-09-07 00:26:48.000000000 +0200 @@ -24,7 +24,7 @@ public class BarrageManager { private: static BulletMLParserTinyXML *parser[char[]][char[]]; - static const char[] BARRAGE_DIR_NAME = "barrage"; + static const char[] BARRAGE_DIR_NAME = "/usr/share/games/val-and-rick/barrage"; public static void load() { char[][] dirs = listdir(BARRAGE_DIR_NAME); Index: val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/texture.d =================================================================== --- val-and-rick-0.1a.dfsg1.orig/src/abagames/util/sdl/texture.d 2007-09-07 00:26:42.000000000 +0200 +++ val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/texture.d 2007-09-07 00:29:38.000000000 +0200 @@ -16,7 +16,7 @@ */ public class Texture { public: - static char[] imagesDir = "images/"; + static char[] imagesDir = "/usr/share/games/val-and-rick/images/"; static SDL_Surface*[char[]] surface; private: GLuint num, maskNum; Index: val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/sound.d =================================================================== --- val-and-rick-0.1a.dfsg1.orig/src/abagames/util/sdl/sound.d 2007-09-07 00:24:50.000000000 +0200 +++ val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/sound.d 2007-09-07 00:26:48.000000000 +0200 @@ -67,7 +67,7 @@ public class Music: Sound { public: static int fadeOutSpeed = 1280; - static char[] dir = "sounds/musics"; + static char[] dir = "/usr/share/games/val-and-rick/sounds/musics"; private: Mix_Music* music; @@ -131,7 +131,7 @@ public class Chunk: Sound { public: - static char[] dir = "sounds/chunks"; + static char[] dir = "/usr/share/games/val-and-rick/sounds/chunks"; private: Mix_Chunk* chunk; int chunkChannel; debian/patches/dlang_v2.patch0000644000000000000000000011515012164051121013326 0ustar Description: port to D language version 2 With this patch the code is accapted by gdc-4.6 0.29.1-4.6.4-3 without triggering deprecated feature warnings/errors. Author: Peter De Wachter --- a/src/abagames/util/actor.d +++ b/src/abagames/util/actor.d @@ -32,7 +32,7 @@ public: T[] actor; protected: - int actorIdx = 0; + ptrdiff_t actorIdx = 0; private: public this() {} @@ -43,7 +43,7 @@ protected void createActors(int n, Object[] args = null) { actor = new T[n]; - foreach (inout T a; actor) { + foreach (ref T a; actor) { a = new T; a.exists = false; a.init(args); --- a/src/abagames/util/iterator.d +++ b/src/abagames/util/iterator.d @@ -35,4 +35,4 @@ } } -alias ArrayIterator!(char[]) StringIterator; +alias ArrayIterator!(string) StringIterator; --- a/src/abagames/util/logger.d +++ b/src/abagames/util/logger.d @@ -7,6 +7,7 @@ private import std.cstream; private import std.string; +private import std.conv; /** * Logger(error/info). @@ -18,7 +19,7 @@ public class Logger { - public static void info(char[] msg, bool nline = true) { + public static void info(string msg, bool nline = true) { // Win32 exe crashes if it writes something to stderr. /*if (nline) stderr.writeLine(msg); @@ -28,24 +29,20 @@ public static void info(double n, bool nline = true) { /*if (nline) - stderr.writeLine(std.string.toString(n)); + stderr.writeLine(to!string(n)); else - stderr.writeString(std.string.toString(n) ~ " ");*/ + stderr.writeString(to!string(n) ~ " ");*/ } - private static void putMessage(char[] msg) { + private static void putMessage(string msg) { MessageBoxA(null, std.string.toStringz(msg), "Error", MB_OK | MB_ICONEXCLAMATION); } - public static void error(char[] msg) { + public static void error(string msg) { putMessage("Error: " ~ msg); } - public static void error(Exception e) { - putMessage("Error: " ~ e.toString()); - } - - public static void error(Error e) { + public static void error(Throwable e) { putMessage("Error: " ~ e.toString()); } } @@ -54,7 +51,7 @@ public class Logger { - public static void info(char[] msg, bool nline = true) { + public static void info(string msg, bool nline = true) { if (nline) derr.writeLine(msg); else @@ -63,20 +60,16 @@ public static void info(double n, bool nline = true) { if (nline) - derr.writeLine(std.string.toString(n)); + derr.writeLine(to!string(n)); else - derr.writeString(std.string.toString(n) ~ " "); + derr.writeString(to!string(n) ~ " "); } - public static void error(char[] msg) { + public static void error(string msg) { derr.writeLine("Error: " ~ msg); } - public static void error(Exception e) { - derr.writeLine("Error: " ~ e.toString()); - } - - public static void error(Error e) { + public static void error(Throwable e) { derr.writeLine("Error: " ~ e.toString()); if (e.next) error(e.next); --- a/src/abagames/util/math.d +++ b/src/abagames/util/math.d @@ -13,7 +13,7 @@ public class Math { private: - public static void normalizeDeg(inout float d) { + public static void normalizeDeg(ref float d) { if (d < -PI) d = PI * 2 - (-d % (PI * 2)); d = (d + PI) % (PI * 2) - PI; --- a/src/abagames/util/rand.d +++ b/src/abagames/util/rand.d @@ -6,7 +6,7 @@ module abagames.util.rand; private import std.stream; -private import std.date; +private import std.datetime; /** * Random number generator. @@ -14,12 +14,12 @@ public class Rand { public this() { - d_time timer = getUTCtime(); - init_genrand(timer); + long timer = Clock.currStdTime(); + init_genrand(cast(uint)timer); } public void setSeed(long n) { - init_genrand(n); + init_genrand(cast(uint)n); } public uint nextInt32() { @@ -55,7 +55,7 @@ Matthe Bellew, and Isaku Wada Andrew C. Edwards v0.1 30 September 2003 edwardsac@ieee.org - Before using, initialize the state by using init_genrand(seed) + Before using, initialize the state by using init_genrand(cast(uint)seed) or init_by_array(init_key, key_length). Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, @@ -122,7 +122,7 @@ { state[0]= s & 0xffffffffUL; for (int j=1; j> 30)) + j); + state[j] = (1812433253U * (state[j-1] ^ (state[j-1] >> 30)) + j); /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */ /* In the previous versions, MSBs of the seed affect */ /* only MSBs of the array state[]. */ @@ -140,11 +140,11 @@ void init_by_array(uint init_key[], uint key_length) { int i, j, k; - init_genrand(19650218UL); + init_genrand(cast(uint)19650218UL); i=1; j=0; k = (N>key_length ? N : key_length); for (; k; k--) { - state[i] = (state[i] ^ ((state[i-1] ^ (state[i-1] >> 30)) * 1664525UL)) + state[i] = (state[i] ^ ((state[i-1] ^ (state[i-1] >> 30)) * 1664525U)) + init_key[j] + j; /* non linear */ state[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */ i++; j++; @@ -152,7 +152,7 @@ if (j>=key_length) j=0; } for (k=N-1; k; k--) { - state[i] = (state[i] ^ ((state[i-1] ^ (state[i-1] >> 30)) * 1566083941UL)) + state[i] = (state[i] ^ ((state[i-1] ^ (state[i-1] >> 30)) * 1566083941U)) - i; /* non linear */ state[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */ i++; @@ -165,14 +165,14 @@ void next_state() { - uint *p=state; + uint *p=state.ptr; - /* if init_genrand() has not been called, */ + /* if init_genrand(cast(uint)) has not been called, */ /* a default initial seed is used */ - if (initf==0) init_genrand(5489UL); + if (initf==0) init_genrand(cast(uint)5489UL); left = N; - next = state; + next = state.ptr; for (int j=N-M+1; --j; p++) *p = p[M] ^ TWIST(p[0], p[1]); --- a/src/abagames/util/sdl/mainloop.d +++ b/src/abagames/util/sdl/mainloop.d @@ -87,7 +87,7 @@ frame = cast(int) (nowTick-prvTickCount) / interval; if (frame <= 0) { frame = 1; - SDL_Delay(prvTickCount+interval-nowTick); + SDL_Delay(cast(uint)(prvTickCount+interval-nowTick)); if (accframe) { prvTickCount = SDL_GetTicks(); } else { --- a/src/abagames/util/sdl/pad.d +++ b/src/abagames/util/sdl/pad.d @@ -6,6 +6,7 @@ module abagames.util.sdl.pad; private import std.string; +private import std.conv; private import std.stream; private import SDL; private import abagames.util.sdl.input; @@ -31,7 +32,7 @@ public void openJoystick() { if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0) { throw new SDLInitFailedException( - "Unable to init SDL joystick: " ~ std.string.toString(SDL_GetError())); + "Unable to init SDL joystick: " ~ to!string(SDL_GetError())); } stick = SDL_JoystickOpen(0); } @@ -157,7 +158,11 @@ mixin RecordableInput!(PadState); private: - public PadState getState(bool doRecord = true) { + public override PadState getState() { + return getState(true); + } + + public PadState getState(bool doRecord) { PadState s = super.getState(); if (doRecord) record(s); --- a/src/abagames/util/sdl/recordableinput.d +++ b/src/abagames/util/sdl/recordableinput.d @@ -39,7 +39,7 @@ } public class NoRecordDataException: Exception { - public this(char[] msg) { + public this(string msg) { super(msg); } } --- a/src/abagames/util/sdl/screen3d.d +++ b/src/abagames/util/sdl/screen3d.d @@ -6,6 +6,7 @@ module abagames.util.sdl.screen3d; private import std.string; +private import std.conv; private import SDL; private import opengl; private import abagames.util.vector; @@ -32,7 +33,7 @@ // Initialize SDL. if (SDL_Init(SDL_INIT_VIDEO) < 0) { throw new SDLInitFailedException( - "Unable to initialize SDL: " ~ std.string.toString(SDL_GetError())); + "Unable to initialize SDL: " ~ to!string(SDL_GetError())); } // Create an OpenGL screen. if (_windowMode) { @@ -42,7 +43,7 @@ } if (SDL_SetVideoMode(_width, _height, 0, _videoFlags) == null) { throw new SDLInitFailedException - ("Unable to create SDL screen: " ~ std.string.toString(SDL_GetError())); + ("Unable to create SDL screen: " ~ to!string(SDL_GetError())); } glViewport(0, 0, width, height); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); @@ -55,7 +56,7 @@ public void screenResized() { if (SDL_SetVideoMode(width, height, 0, _videoFlags) == null) { throw new Exception - ("Unable to resize SDL screen: " ~ std.string.toString(SDL_GetError())); + ("Unable to resize SDL screen: " ~ to!string(SDL_GetError())); } glViewport(0, 0, _width, _height); @@ -95,10 +96,10 @@ if (error == GL_NO_ERROR) return; closeSDL(); - throw new Exception("OpenGL error(" ~ std.string.toString(error) ~ ")"); + throw new Exception("OpenGL error(" ~ to!string(error) ~ ")"); } - protected void setCaption(char[] name) { + protected void setCaption(string name) { SDL_WM_SetCaption(std.string.toStringz(name), null); } --- a/src/abagames/util/sdl/sdlexception.d +++ b/src/abagames/util/sdl/sdlexception.d @@ -9,7 +9,7 @@ * SDL initialize failed. */ public class SDLInitFailedException: Exception { - public this(char[] msg) { + public this(string msg) { super(msg); } } @@ -18,7 +18,7 @@ * SDL general exception. */ public class SDLException: Exception { - public this(char[] msg) { + public this(string msg) { super(msg); } } --- a/src/abagames/util/sdl/sound.d +++ b/src/abagames/util/sdl/sound.d @@ -6,6 +6,7 @@ module abagames.util.sdl.sound; private import std.string; +private import std.conv; private import SDL; private import SDL_mixer; private import abagames.util.sdl.sdlexception; @@ -28,7 +29,7 @@ if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) { noSound = true; throw new SDLInitFailedException - ("Unable to initialize SDL_AUDIO: " ~ std.string.toString(SDL_GetError())); + ("Unable to initialize SDL_AUDIO: " ~ to!string(SDL_GetError())); } audio_rate = 44100; audio_format = AUDIO_S16; @@ -37,7 +38,7 @@ if (Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers) < 0) { noSound = true; throw new SDLInitFailedException - ("Couldn't open audio: " ~ std.string.toString(SDL_GetError())); + ("Couldn't open audio: " ~ to!string(SDL_GetError())); } Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels); } @@ -56,8 +57,8 @@ * Music / Chunk. */ public interface Sound { - public void load(char[] name); - public void load(char[] name, int ch); + public void load(string name); + public void load(string name, int ch); public void free(); public void play(); public void fade(); @@ -67,23 +68,23 @@ public class Music: Sound { public: static int fadeOutSpeed = 1280; - static char[] dir = "/usr/share/games/val-and-rick/sounds/musics"; + static string dir = "/usr/share/games/val-and-rick/sounds/musics"; private: Mix_Music* music; - public void load(char[] name) { + public void load(string name) { if (SoundManager.noSound) return; - char[] fileName = dir ~ "/" ~ name; + string fileName = dir ~ "/" ~ name; music = Mix_LoadMUS(std.string.toStringz(fileName)); if (!music) { SoundManager.noSound = true; throw new SDLException("Couldn't load: " ~ fileName ~ - " (" ~ std.string.toString(Mix_GetError()) ~ ")"); + " (" ~ to!string(Mix_GetError()) ~ ")"); } } - public void load(char[] name, int ch) { + public void load(string name, int ch) { load(name); } @@ -131,24 +132,24 @@ public class Chunk: Sound { public: - static char[] dir = "/usr/share/games/val-and-rick/sounds/chunks"; + static string dir = "/usr/share/games/val-and-rick/sounds/chunks"; private: Mix_Chunk* chunk; int chunkChannel; - public void load(char[] name) { + public void load(string name) { load(name, 0); } - public void load(char[] name, int ch) { + public void load(string name, int ch) { if (SoundManager.noSound) return; - char[] fileName = dir ~ "/" ~ name; + string fileName = dir ~ "/" ~ name; chunk = Mix_LoadWAV(std.string.toStringz(fileName)); if (!chunk) { SoundManager.noSound = true; throw new SDLException("Couldn't load: " ~ fileName ~ - " (" ~ std.string.toString(Mix_GetError()) ~ ")"); + " (" ~ to!string(Mix_GetError()) ~ ")"); } chunkChannel = ch; } --- a/src/abagames/util/sdl/texture.d +++ b/src/abagames/util/sdl/texture.d @@ -16,19 +16,19 @@ */ public class Texture { public: - static char[] imagesDir = "/usr/share/games/val-and-rick/images/"; - static SDL_Surface*[char[]] surface; + static string imagesDir = "/usr/share/games/val-and-rick/images/"; + static SDL_Surface*[string] surface; private: GLuint num, maskNum; int textureNum, maskTextureNum; Uint32[128 * 128] pixels; Uint32[128 * 128] maskPixels; - public static SDL_Surface* loadBmp(char[] name) { + public static SDL_Surface* loadBmp(string name) { if ((name in surface) != null) { return surface[name]; } else { - char[] fileName = imagesDir ~ name; + string fileName = imagesDir ~ name; SDL_Surface *s = SDL_LoadBMP(std.string.toStringz(fileName)); if (!s) throw new SDLInitFailedException("Unable to load: " ~ fileName); @@ -55,7 +55,7 @@ } } - public this(char[] name) { + public this(string name) { SDL_Surface *s = loadBmp(name); glGenTextures(1, &num); glBindTexture(GL_TEXTURE_2D, num); @@ -65,7 +65,7 @@ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); } - public this(char[] name, int sx, int sy, int xn, int yn, int panelWidth, int panelHeight, + public this(string name, int sx, int sy, int xn, int yn, int panelWidth, int panelHeight, Uint32 maskColor = 0xffffffffu) { SDL_Surface *s = loadBmp(name); Uint32* surfacePixels = cast(Uint32*) s.pixels; @@ -97,13 +97,13 @@ } glBindTexture(GL_TEXTURE_2D, num + ti); gluBuild2DMipmaps(GL_TEXTURE_2D, 4, panelWidth, panelHeight, - GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, pixels); + GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, pixels.ptr); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); if (maskColor != 0xffffffffu) { glBindTexture(GL_TEXTURE_2D, maskNum + ti); gluBuild2DMipmaps(GL_TEXTURE_2D, 4, panelWidth, panelHeight, - GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, maskPixels); + GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, maskPixels.ptr); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); } --- a/src/abagames/util/tokenizer.d +++ b/src/abagames/util/tokenizer.d @@ -7,6 +7,7 @@ private import std.stream; private import std.string; +private import std.conv; /** * Tokenizer. @@ -14,17 +15,17 @@ public class Tokenizer { private: - public static char[][] readFile(char[] fileName, char[] separator) { - char[][] result; - auto File fd = new File; + public static string[] readFile(string fileName, string separator) { + string[] result; + scope File fd = new File; fd.open(fileName); for (;;) { - char[] line = fd.readLine(); + string line = to!string(fd.readLine()); if (!line) break; - char[][] spl = split(line, separator); - foreach (char[] s; spl) { - char[] r = strip(s); + string[] spl = split(line, separator); + foreach (string s; spl) { + string r = strip(s); if (r.length > 0) result ~= r; } @@ -40,7 +41,7 @@ public class CSVTokenizer { private: - public static char[][] readFile(char[] fileName) { + public static string[] readFile(string fileName) { return Tokenizer.readFile(fileName, ","); } } --- a/src/abagames/util/vector.d +++ b/src/abagames/util/vector.d @@ -7,6 +7,7 @@ private import std.math; private import std.string; +private import std.conv; /** * Vector. @@ -201,8 +202,8 @@ return false; } - public char[] toString() { - return "(" ~ std.string.toString(x) ~ ", " ~ std.string.toString(y) ~ ")"; + public override string toString() { + return "(" ~ to!string(x) ~ ", " ~ to!string(y) ~ ")"; } } --- a/src/abagames/vr/barrage.d +++ b/src/abagames/vr/barrage.d @@ -23,25 +23,27 @@ */ public class BarrageManager { private: - static BulletMLParserTinyXML *parser[char[]][char[]]; - static const char[] BARRAGE_DIR_NAME = "/usr/share/games/val-and-rick/barrage"; + static BulletMLParserTinyXML *parser[string][string]; + static const string BARRAGE_DIR_NAME = "/usr/share/games/val-and-rick/barrage"; public static void load() { - char[][] dirs = listdir(BARRAGE_DIR_NAME); - foreach (char[] dirName; dirs) { - char[][] files = listdir(BARRAGE_DIR_NAME ~ "/" ~ dirName); + auto dirs = dirEntries(BARRAGE_DIR_NAME, SpanMode.shallow); + foreach (string fullDirName; dirs) { + string dirName = baseName(fullDirName); + auto files = dirEntries(fullDirName, SpanMode.shallow); parser[dirName] = null; - foreach (char[] fileName; files) { - if (getExt(fileName) != "xml") + foreach (string fullFileName; files) { + string fileName = baseName(fullFileName); + if (extension(fileName) != ".xml") continue; parser[dirName][fileName] = getInstance(dirName, fileName); } } } - public static BulletMLParserTinyXML* getInstance(char[] dirName, char[] fileName) { + public static BulletMLParserTinyXML* getInstance(string dirName, string fileName) { if (!parser[dirName][fileName]) { - char[] barrageName = dirName ~ "/" ~ fileName; + string barrageName = dirName ~ "/" ~ fileName; Logger.info("Loading BulletML: " ~ barrageName); parser[dirName][fileName] = BulletMLParserTinyXML_new(std.string.toStringz(BARRAGE_DIR_NAME ~ "/" ~ barrageName)); @@ -50,7 +52,7 @@ return parser[dirName][fileName]; } - public static BulletMLParserTinyXML*[] getInstanceList(char[] dirName) { + public static BulletMLParserTinyXML*[] getInstanceList(string dirName) { BulletMLParserTinyXML *pl[]; foreach (BulletMLParserTinyXML *p; parser[dirName]) { pl ~= p; @@ -59,7 +61,7 @@ } public static void unload() { - foreach (BulletMLParserTinyXML *pa[char[]]; parser) { + foreach (BulletMLParserTinyXML *pa[string]; parser) { foreach (BulletMLParserTinyXML *p; pa) { BulletMLParserTinyXML_delete(p); } --- a/src/abagames/vr/boot.d +++ b/src/abagames/vr/boot.d @@ -6,6 +6,7 @@ module abagames.vr.boot; private import std.string; +private import std.conv; private import std.stream; private import std.c.stdlib; private import abagames.util.logger; @@ -51,10 +52,10 @@ _moduleCtor(); char exe[4096]; GetModuleFileNameA(null, exe, 4096); - char[][1] prog; - prog[0] = std.string.toString(exe); - result = boot(prog ~ std.string.split(std.string.toString(lpCmdLine))); - } catch (Object o) { + string[1] prog; + prog[0] = to!string(exe); + result = boot(prog ~ std.string.split(to!string(lpCmdLine))); + } catch (Throwable o) { Logger.error("Exception: " ~ o.toString()); result = EXIT_FAILURE; } @@ -63,12 +64,12 @@ } } else { // Boot as the general executable. - public int main(char[][] args) { + public int main(string[] args) { return boot(args); } } -public int boot(char[][] args) { +public int boot(string[] args) { //Reflection.init(args[0]); screen = new Screen; pad = new RecordablePad; @@ -85,22 +86,22 @@ } try { mainLoop.loop(); - } catch (Object o) { + } catch (Throwable o) { Logger.info(o.toString()); //Logger.info(Reflection.stackTrace()); try { gameManager.saveErrorReplay(); - } catch (Object o1) {} + } catch (Throwable o1) {} throw o; } return EXIT_SUCCESS; } -private void parseArgs(char[][] commandArgs, Screen screen) { - char[][] args = readOptionsIniFile(); +private void parseArgs(string[] commandArgs, Screen screen) { + string[] args = readOptionsIniFile(); for (int i = 1; i < commandArgs.length; i++) args ~= commandArgs[i]; - char[] progName = commandArgs[0]; + string progName = commandArgs[0]; for (int i = 0; i < args.length; i++) { switch (args[i]) { case "-brightness": @@ -109,7 +110,7 @@ throw new Exception("Invalid options"); } i++; - float b = cast(float) std.string.atoi(args[i]) / 100; + float b = cast(float) to!int(args[i]) / 100; if (b < 0 || b > 1) { usage(args[0]); throw new Exception("Invalid options"); @@ -123,7 +124,7 @@ throw new Exception("Invalid options"); } i++; - float l = cast(float) std.string.atoi(args[i]) / 100; + float l = cast(float) to!int(args[i]) / 100; if (l < 0 || l > 1) { usage(progName); throw new Exception("Invalid options"); @@ -142,9 +143,9 @@ throw new Exception("Invalid options"); } i++; - int w = std.string.atoi(args[i]); + int w = to!int(args[i]); i++; - int h = std.string.atoi(args[i]); + int h = to!int(args[i]); screen.width = w; screen.height = h; break; @@ -167,17 +168,17 @@ } } -private final const char[] OPTIONS_INI_FILE = "options.ini"; +private const string OPTIONS_INI_FILE = "options.ini"; -private char[][] readOptionsIniFile() { +private string[] readOptionsIniFile() { try { return Tokenizer.readFile(OPTIONS_INI_FILE, " "); - } catch (Object e) { + } catch (Throwable e) { return null; } } -private void usage(char[] progName) { +private void usage(string progName) { Logger.error ("Usage: " ~ progName ~ " [-window] [-fullscreen] [-res x y] [-brightness [0-100]] [-luminosity [0-100]] [-nosound] [-reverse] [-nowait]"); } --- a/src/abagames/vr/enemy.d +++ b/src/abagames/vr/enemy.d @@ -46,11 +46,8 @@ EnemyState _state; bool damaged; - public static this() { - rand = new Rand; - } - public static void setRandSeed(long seed) { + if (rand is null) rand = new Rand; rand.setSeed(seed); } @@ -200,7 +197,7 @@ public this() { pos = new Vector; - foreach (inout Vector bp; bitPos) + foreach (ref Vector bp; bitPos) bp = new Vector; } @@ -422,7 +419,7 @@ pos = new Vector; ppos = new Vector; vel = new Vector; - foreach (inout EnemyBit eb; enemyBit) + foreach (ref EnemyBit eb; enemyBit) eb = new EnemyBit; } @@ -431,11 +428,11 @@ this.appType = appType; bool validPos = false; for (int i = 0 ; i < 8 ; i++) { - switch (appType) { + switch (appType) { default: break; case AppearanceType.TOP: case AppearanceType.TOP_LEFT: case AppearanceType.TOP_RIGHT: - switch (appType) { + switch (appType) { default: break; case AppearanceType.TOP: pos.x = rand.nextSignedFloat(field.size.x); break; @@ -682,7 +679,7 @@ return true; } - public bool move(EnemyState es) { + public override bool move(EnemyState es) { super.move(es); es.pos.x += sin(es.deg) * es.speed; es.pos.y += cos(es.deg) * es.speed; @@ -697,7 +694,7 @@ es.pos.x += sin(es.deg) * es.speed * 2; es.pos.y += cos(es.deg) * es.speed * 2; } - switch (es.state) { + switch (es.state) { default: break; case MoveState.MOVING: es.speed += (maxSpeed - es.speed) * accel; es.cnt--; @@ -741,7 +738,7 @@ return true; } - public bool move(EnemyState es) { + public override bool move(EnemyState es) { super.move(es); es.pos.x += sin(es.deg) * speed; es.pos.y += cos(es.deg) * speed; @@ -778,7 +775,7 @@ public this(BulletActorPool bullets, Field field, Ship ship) { super(bullets, field, ship, EnemyType.BLOCK, BitmapShape.ground, 12, 2, AnimationType.BACKANDFORTH, 30, 18); - foreach (inout EnemyBitSpec bs; bitSpec) + foreach (ref EnemyBitSpec bs; bitSpec) bs = new EnemyBitSpec; } @@ -800,7 +797,7 @@ } } - public bool move(EnemyState es) { + public override bool move(EnemyState es) { super.move(es); es.pos.y -= field.lastScrollY; if (es.pos.y <= -field.outerSize.y) @@ -808,7 +805,7 @@ return true; } - public void destroyed(EnemyState es, Shot shot, ExplosionPool explosions, ParticlePool particles) { + public override void destroyed(EnemyState es, Shot shot, ExplosionPool explosions, ParticlePool particles) { Explosion ep = explosions.getInstance(); if (ep) ep.set(es.pos, 0, 0, 30, 3); @@ -852,7 +849,7 @@ return true; } - public bool move(EnemyState es) { + public override bool move(EnemyState es) { super.move(es); es.pos.x += es.vel.x; es.pos.y += es.vel.y; @@ -862,7 +859,7 @@ es.pos.y -= field.lastScrollY * SKY_SCROLL_RATIO; if (!field.checkInOuterField(es.pos)) return false; - switch (es.state) { + switch (es.state) { default: break; case MoveState.APPROACHING: if (fabs(es.pos.x - ship.pos.x) < 4.4f) { es.state = MoveState.SEPARATION; --- a/src/abagames/vr/field.d +++ b/src/abagames/vr/field.d @@ -62,7 +62,7 @@ for (int i = 0; i < 2; i++) spacePattern[rand.nextInt(BLOCK_SIZE_X / 4)][rand.nextInt(BLOCK_SIZE_Y / 4)] = 2; panelPos = new Vector[SCREEN_BLOCK_SIZE_X * NEXT_BLOCK_AREA_SIZE]; - foreach (inout Vector pp; panelPos) + foreach (ref Vector pp; panelPos) pp = new Vector; } @@ -302,7 +302,7 @@ private void addGround(int type) { int cx; - switch (type) { + switch (type) { default: break; case 0: cx = rand.nextInt(cast(int) (BLOCK_SIZE_X * 0.4f)) + cast(int) (BLOCK_SIZE_X * 0.1f); break; --- a/src/abagames/vr/gamemanager.d +++ b/src/abagames/vr/gamemanager.d @@ -175,13 +175,13 @@ private void saveLastReplay() { try { inGameState.saveReplay("last.rpl"); - } catch (Object o) {} + } catch (Throwable o) {} } private void loadLastReplay() { try { inGameState.loadReplay("last.rpl"); - } catch (Object o) { + } catch (Throwable o) { inGameState.resetReplay(); } } @@ -466,11 +466,11 @@ distance += dist; } - public void saveReplay(char[] fileName) { + public void saveReplay(string fileName) { _replayData.save(fileName); } - public void loadReplay(char[] fileName) { + public void loadReplay(string fileName) { _replayData = new ReplayData; _replayData.load(fileName); } --- a/src/abagames/vr/letter.d +++ b/src/abagames/vr/letter.d @@ -96,7 +96,7 @@ return idx; } - public static void drawString(char[] str, float lx, float y, float s, + public static void drawString(string str, float lx, float y, float s, int d = Direction.TO_RIGHT, int cl = 0, bool rev = false, float od = 0) { lx += LETTER_WIDTH * s / 2; @@ -104,7 +104,7 @@ float x = lx; int idx; float ld; - switch (d) { + switch (d) { default: break; case Direction.TO_RIGHT: ld = 0; break; @@ -128,7 +128,7 @@ drawLetter(idx, x, y, s, ld, cl); } if (od == 0) { - switch(d) { + switch(d) { default: break; case Direction.TO_RIGHT: x += s * LETTER_WIDTH; break; @@ -156,7 +156,7 @@ int n = num; float x = lx; float ld; - switch (d) { + switch (d) { default: break; case Direction.TO_RIGHT: ld = 0; break; @@ -173,7 +173,7 @@ int digit = dg; for (;;) { drawLetter(n % 10, x, y, s, ld, cl); - switch(d) { + switch(d) { default: break; case Direction.TO_RIGHT: x -= s * LETTER_WIDTH; break; @@ -230,7 +230,7 @@ n /= 6; } if ((i & 1) == 1 || i == 0) { - switch (i) { + switch (i) { default: break; case 3: drawLetter(41, x + s * 1.16f, y, s, Direction.TO_RIGHT, st); break; --- a/src/abagames/vr/prefmanager.d +++ b/src/abagames/vr/prefmanager.d @@ -8,6 +8,7 @@ private import std.stream; private import std.c.stdlib; private import std.string; +private import std.conv; private import std.file; private import abagames.util.prefmanager; private import abagames.vr.ship; @@ -18,19 +19,19 @@ public class PrefManager: abagames.util.prefmanager.PrefManager { private: static const int VERSION_NUM = 10; - static const char[] PREF_FILE = "val-and-rick.prf"; + static const string PREF_FILE = "val-and-rick.prf"; PrefData _prefData; public this() { _prefData = new PrefData; } - public static char[] pref_dir() + public static string pref_dir() { - char * home = getenv("HOME"); + const(char)* home = getenv("HOME"); if (home is null) throw new Error("HOME environment variable not defined"); - char[] dir = std.string.toString(home) ~ "/.val-and-rick"; + string dir = to!string(home) ~ "/.val-and-rick"; try { mkdir(dir); } catch (FileException e) { @@ -39,7 +40,7 @@ } public void load() { - auto File fd = new File; + scope File fd = new File; try { int ver; fd.open(pref_dir() ~ "/" ~ PREF_FILE); @@ -47,7 +48,7 @@ if (ver != VERSION_NUM) throw new Error("Wrong version num"); _prefData.load(fd); - } catch (Object e) { + } catch (Throwable e) { _prefData.init(); } finally { if (fd.isOpen()) @@ -56,7 +57,7 @@ } public void save() { - auto File fd = new File; + scope File fd = new File; fd.create(pref_dir() ~ "/" ~ PREF_FILE); fd.write(VERSION_NUM); _prefData.save(fd); --- a/src/abagames/vr/replay.d +++ b/src/abagames/vr/replay.d @@ -20,8 +20,8 @@ long seed; private: - public void save(char[] fileName) { - auto File fd = new File; + public void save(string fileName) { + scope File fd = new File; fd.create(PrefManager.pref_dir() ~ "/" ~ fileName); fd.write(VERSION_NUM); fd.write(seed); @@ -29,8 +29,8 @@ fd.close(); } - public void load(char[] fileName) { - auto File fd = new File; + public void load(string fileName) { + scope File fd = new File; fd.open(PrefManager.pref_dir() ~ "/" ~ fileName); int ver; fd.read(ver); --- a/src/abagames/vr/screen.d +++ b/src/abagames/vr/screen.d @@ -18,18 +18,15 @@ */ public class Screen: Screen3D { private: - const char[] CAPTION = "Val & Rick"; + const string CAPTION = "Val & Rick"; static Rand rand; LuminousScreen luminousScreen; float _luminosity = 0; int screenShakeCnt; float screenShakeIntense; - public static this() { - rand = new Rand; - } - public static void setRandSeed(long seed) { + if (rand is null) rand = new Rand; rand.setSeed(seed); } @@ -77,7 +74,7 @@ luminousScreen.draw(); } - public void resized(int width, int height) { + public override void resized(int width, int height) { if (luminousScreen) luminousScreen.resized(width, height); super.resized(width, height); --- a/src/abagames/vr/ship.d +++ b/src/abagames/vr/ship.d @@ -109,7 +109,7 @@ public void setShots(ShotPool shots) { this.shots = shots; - foreach (inout ShipShadow ss; shadow) + foreach (ref ShipShadow ss; shadow) ss = new ShipShadow(_shape, shots); } @@ -315,7 +315,7 @@ s.set(_pos, deg); fireCnt = FIRE_INTERVAL; float td; - switch (fireSprCnt % 2) { + switch (fireSprCnt % 2) { default: break; case 0: td = fireSprDeg * (fireSprCnt / 2 % 4 + 1) * 0.2f; fireEvenShadow = true; --- a/src/abagames/vr/soundmanager.d +++ b/src/abagames/vr/soundmanager.d @@ -16,27 +16,31 @@ */ public class SoundManager: abagames.util.sdl.sound.SoundManager { private static: - char[][] seFileName = + string[] seFileName = ["shot.wav", "zako_dest.wav", "large_dest.wav", "ship_dest.wav", "blaster.wav", "crystal.wav", "rocket.wav"]; int[] seChannel = [0, 1, 2, 3, 4, 5, 6, 7]; - Music[char[]] bgm; - Chunk[char[]] se; + Music[string] bgm; + Chunk[string] se; bool bgmDisabled = false; bool seDisabled = false; + private TypeInfo hack1() { return typeid(se); } //workaround for compiler/linker bug in gdc-4.6 0.29.1-4.6.4-3 + private TypeInfo hack2() { return typeid(bgm); } //workaround for compiler/linker bug in gdc-4.6 0.29.1-4.6.4-3 + public static void loadSounds() { bgm = loadMusics(); se = loadChunks(); } - private static Music[char[]] loadMusics() { - Music[char[]] musics; - char[][] files = listdir(Music.dir); - foreach (char[] fileName; files) { - char[] ext = getExt(fileName); - if (ext != "ogg" && ext != "wav") + private static Music[string] loadMusics() { + Music[string] musics; + auto files = dirEntries(Music.dir, SpanMode.shallow); + foreach (string fullFileName; files) { + string fileName = baseName(fullFileName); + string ext = extension(fileName); + if (ext != ".ogg" && ext != ".wav") continue; Music music = new Music(); music.load(fileName); @@ -46,10 +50,10 @@ return musics; } - private static Chunk[char[]] loadChunks() { - Chunk[char[]] chunks; + private static Chunk[string] loadChunks() { + Chunk[string] chunks; int i = 0; - foreach (char[] fileName; seFileName) { + foreach (string fileName; seFileName) { Chunk chunk = new Chunk(); chunk.load(fileName, seChannel[i]); chunks[fileName] = chunk; @@ -59,7 +63,7 @@ return chunks; } - public static void playBgm(char[] name) { + public static void playBgm(string name) { if (bgmDisabled) return; Music.haltMusic(); @@ -74,7 +78,7 @@ Music.haltMusic(); } - public static void playSe(char[] name) { + public static void playSe(string name) { if (seDisabled) return; se[name].play(); --- a/src/abagames/vr/stagemanager.d +++ b/src/abagames/vr/stagemanager.d @@ -45,7 +45,7 @@ this.bullets = bullets; rand = new Rand; zakoApp = new ZakoAppearance[2]; - foreach (inout ZakoAppearance za; zakoApp) + foreach (ref ZakoAppearance za; zakoApp) za = new ZakoAppearance; } @@ -108,7 +108,7 @@ if (apn > 10) apn = 10; zakoApp[1].set(null, 0, null, null); - switch (rand.nextInt(apn)) { + switch (rand.nextInt(apn)) { default: break; case 0: case 1: case 2: @@ -152,7 +152,7 @@ eb1Spec.bitNum = 1; float br = rank / eb1Spec.bitNum; int type; - switch (rand.nextInt(4)) { + switch (rand.nextInt(4)) { default: break; case 0: case 1: type = 0; @@ -168,7 +168,7 @@ float radInc = 0.5f + rand.nextFloat(0.25f); float ad = PI * 2; float a, av, dv, s, sv; - switch (type) { + switch (type) { default: break; case 0: if (rand.nextInt(5) == 0) ad = PI / 2 + rand.nextFloat(PI / 2); @@ -195,7 +195,7 @@ ebs.moveType = type; ebs.radiusBase = rad; float sr; - switch (type) { + switch (type) { default: break; case 0: ebs.alignDeg = ad; ebs.num = 4 + rand.nextInt(6); @@ -267,7 +267,7 @@ BulletMLParserTinyXML*[] ps = BarrageManager.getInstanceList("morph"); while (morphRank > 1) { morphRank /= 3; - int pi = rand.nextInt(ps.length); + int pi = rand.nextInt(cast(int)ps.length); float mr = morphRank; if (mr > 0.75f) mr = 0.75f + rand.nextFloat(0.25f); @@ -313,7 +313,7 @@ BulletMLParserTinyXML*[] ps = BarrageManager.getInstanceList("morph"); while (morphRank > 1) { morphRank /= 3; - int pi = rand.nextInt(ps.length); + int pi = rand.nextInt(cast(int)ps.length); float mr = morphRank; if (mr > 0.75f) mr = 0.75f + rand.nextFloat(0.25f); --- a/src/abagames/util/bulletml/bullet.d +++ b/src/abagames/util/bulletml/bullet.d @@ -28,11 +28,8 @@ BulletMLRunner* runner; float _rank; - public static this() { - rand = new Rand; - } - public static void setRandSeed(long s) { + if (rand is null) rand = new Rand; rand.setSeed(s); } --- a/src/abagames/util/sdl/luminous.d +++ b/src/abagames/util/sdl/luminous.d @@ -33,9 +33,9 @@ } private void makeLuminousTexture() { - uint *data = td; + uint *data = td.ptr; int i; - memset(data, 0, luminousTextureWidth * luminousTextureHeight * 4 * uint.sizeof); + td[] = 0; glGenTextures(1, &luminousTexture); glBindTexture(GL_TEXTURE_2D, luminousTexture); glTexImage2D(GL_TEXTURE_2D, 0, 4, luminousTextureWidth, luminousTextureHeight, 0, --- a/src/abagames/vr/particle.d +++ b/src/abagames/vr/particle.d @@ -29,11 +29,8 @@ float lumAlp; int cnt; - public static this() { - rand = new Rand; - } - public static void setRandSeed(long seed) { + if (rand is null) rand = new Rand; rand.setSeed(seed); } --- a/src/abagames/vr/bulletactorpool.d +++ b/src/abagames/vr/bulletactorpool.d @@ -104,7 +104,7 @@ cnt++; } - public void draw() { + public override void draw() { foreach (BulletActor ba; actor) if (ba.exists) ba.draw(); debian/patches/endian-clean.patch0000644000000000000000000000222012164051121014141 0ustar # Copyright (C) 2007 Peter De Wachter # Distributed under the same license as the game. See debian/copyright. --- a/src/abagames/util/sdl/texture.d +++ b/src/abagames/util/sdl/texture.d @@ -97,13 +97,13 @@ } glBindTexture(GL_TEXTURE_2D, num + ti); gluBuild2DMipmaps(GL_TEXTURE_2D, 4, panelWidth, panelHeight, - GL_RGBA, GL_UNSIGNED_BYTE, pixels); + GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, pixels); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); if (maskColor != 0xffffffffu) { glBindTexture(GL_TEXTURE_2D, maskNum + ti); gluBuild2DMipmaps(GL_TEXTURE_2D, 4, panelWidth, panelHeight, - GL_RGBA, GL_UNSIGNED_BYTE, maskPixels); + GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, maskPixels); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); } debian/patches/imports.patch0000644000000000000000000013763412164051121013342 0ustar Description: port import/ code to D language version 2 With this patch the code is accapted by GDC 4.8 without triggering deprecation warnings/errors. Author: Peter De Wachter --- a/import/SDL.d +++ b/import/SDL.d @@ -20,18 +20,28 @@ slouken@devolution.com */ -import SDL_types; -import SDL_getenv; -import SDL_error; -import SDL_rwops; -import SDL_timer; -import SDL_audio; -import SDL_cdrom; -import SDL_joystick; -import SDL_events; -import SDL_video; -import SDL_byteorder; -import SDL_Version; +public import SDL_keysym_; +public import SDL_version_; +public import SDL_active; +public import SDL_audio; +public import SDL_byteorder; +public import SDL_cdrom; +public import SDL_copying; +public import SDL_endian; +public import SDL_error; +public import SDL_events; +public import SDL_getenv; +public import SDL_joystick; +public import SDL_keyboard; +public import SDL_mouse; +public import SDL_mutex; +public import SDL_quit; +public import SDL_rwops; +public import SDL_syswm; +public import SDL_thread; +public import SDL_timer; +public import SDL_types; +public import SDL_video; extern(C): @@ -73,20 +83,3 @@ */ void SDL_Quit(); -/+ -void SDL_SetModuleHandle(void *hInst); -extern(Windows) void* GetModuleHandle(char*); - -static this() -{ - /* Load SDL dynamic link library */ - if (SDL_Init(SDL_INIT_NOPARACHUTE) < 0) - throw new Error("Error loading SDL"); - SDL_SetModuleHandle(GetModuleHandle(null)); -} - -static ~this() -{ - SDL_Quit(); -} -+/ --- a/import/SDL_Version.d +++ /dev/null @@ -1,75 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@devolution.com -*/ - -/* This header defines the current SDL version */ - -import SDL_types; - -extern(C): - -/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL -*/ -const uint SDL_MAJOR_VERSION = 1; -const uint SDL_MINOR_VERSION = 2; -const uint SDL_PATCHLEVEL = 6; - -struct SDL_version { - Uint8 major; - Uint8 minor; - Uint8 patch; -} - -/* This macro can be used to fill a version structure with the compile-time - * version of the SDL library. - */ -void SDL_VERSION(SDL_version* X) -{ - X.major = SDL_MAJOR_VERSION; - X.minor = SDL_MINOR_VERSION; - X.patch = SDL_PATCHLEVEL; -} - -/* This macro turns the version numbers into a numeric value: - (1,2,3) -> (1203) - This assumes that there will never be more than 100 patchlevels -*/ -uint SDL_VERSIONNUM(Uint8 X, Uint8 Y, Uint8 Z) -{ - return X * 1000 + Y * 100 + Z; -} - -/* This is the version number macro for the current SDL version */ -const uint SDL_COMPILEDVERSION = SDL_MAJOR_VERSION * 1000 + - SDL_MINOR_VERSION * 100 + - SDL_PATCHLEVEL; - -/* This macro will evaluate to true if compiled with SDL at least X.Y.Z */ -bit SDL_VERSION_ATLEAST(Uint8 X, Uint8 Y, Uint8 Z) -{ - return (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)); -} - -/* This function gets the version of the dynamically linked SDL library. - it should NOT be used to fill a version structure, instead you should - use the SDL_Version() macro. - */ -SDL_version * SDL_Linked_Version(); --- a/import/SDL_audio.d +++ b/import/SDL_audio.d @@ -24,6 +24,7 @@ import SDL_error; import SDL_rwops; import SDL_byteorder; +import std.string; extern(C): @@ -42,7 +43,7 @@ Once the callback returns, the buffer will no longer be valid. Stereo samples are stored in a LRLRLR ordering. */ - void (*callback)(void *userdata, Uint8 *stream, int len); + void function(void *userdata, Uint8 *stream, int len) callback; void *userdata; } @@ -74,7 +75,7 @@ int len_cvt; /* Length of converted audio buffer */ int len_mult; /* buffer must be len*len_mult big */ double len_ratio; /* Given len, final size is len*len_ratio */ - void (*filters[10])(SDL_AudioCVT *cvt, Uint16 format); + void function(SDL_AudioCVT *cvt, Uint16 format)[10] filters; int filter_index; /* Current audio conversion function */ } @@ -161,7 +162,7 @@ * This function loads a WAVE from the data source, automatically freeing * that source if 'freesrc' is non-zero. For example, to load a WAVE file, * you could do: - * SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); + * SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", toStringz("rb")), 1, ...); * * If this function succeeds, it returns the given SDL_AudioSpec, * filled with the audio data format of the wave data, and sets @@ -178,7 +179,7 @@ SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); /* Compatibility convenience function -- loads a WAV from a file */ -SDL_AudioSpec *SDL_LoadWAV(char* file, SDL_AudioSpec* spec, +SDL_AudioSpec *SDL_LoadWAV(const(char)* file, SDL_AudioSpec* spec, Uint8 **audio_buf, Uint32 *audio_len) { return SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"), 1, spec, --- a/import/SDL_cdrom.d +++ b/import/SDL_cdrom.d @@ -49,7 +49,7 @@ } /* Given a status, returns true if there's a disk in the drive */ -bit CD_INDRIVE(int status) { return status > 0; } +bool CD_INDRIVE(int status) { return status > 0; } struct SDL_CDtrack { Uint8 id; /* Track number */ --- a/import/SDL_endian.d +++ b/import/SDL_endian.d @@ -47,7 +47,7 @@ */ Uint16 SDL_Swap16(Uint16 D) { - return((D<<8)|(D>>8)); + return cast(Uint16)((D<<8)|(D>>8)); } Uint32 SDL_Swap32(Uint32 D) { --- a/import/SDL_events.d +++ b/import/SDL_events.d @@ -271,7 +271,7 @@ The filter is protypted as: */ -alias int (*SDL_EventFilter)(SDL_Event *event); +alias int function(SDL_Event *event) SDL_EventFilter; /* If the filter returns 1, then the event will be added to the internal queue. If it returns 0, then the event will be dropped from the queue, but the @@ -304,8 +304,8 @@ If 'state' is set to SDL_QUERY, SDL_EventState() will return the current processing state of the specified event. */ -const uint SDL_QUERY = cast(uint) -1; -const uint SDL_IGNORE = 0; -const uint SDL_DISABLE = 0; -const uint SDL_ENABLE = 1; +const int SDL_QUERY = -1; +const int SDL_IGNORE = 0; +const int SDL_DISABLE = 0; +const int SDL_ENABLE = 1; Uint8 SDL_EventState(Uint8 type, int state); --- a/import/SDL_keyboard.d +++ b/import/SDL_keyboard.d @@ -26,7 +26,7 @@ // !!! A hack! struct SDL_keysym is defined in this module, // !!! so we need to resolve the nameclash... // !!! Definitely won't work on *NIX but for now will do. -import SDL_Keysym; +import SDL_keysym_; extern(C): --- a/import/SDL_mixer.d +++ b/import/SDL_mixer.d @@ -22,7 +22,7 @@ // convert to D by shinichiro.h -/* $Id: SDL_mixer.d,v 1.1.1.1 2005/03/13 16:15:04 kenta Exp $ */ +/* $Id: SDL_mixer.d,v 1.1.1.1 2006/11/19 07:54:54 kenta Exp $ */ import SDL; @@ -104,10 +104,10 @@ /* Load a wave file or a music (.mod .s3m .it .xm) file */ Mix_Chunk * Mix_LoadWAV_RW(SDL_RWops *src, int freesrc); - Mix_Chunk * Mix_LoadWAV(char *file) { + Mix_Chunk * Mix_LoadWAV(const(char) *file) { return Mix_LoadWAV_RW(SDL_RWFromFile(file, "rb"), 1); } - Mix_Music * Mix_LoadMUS(char *file); + Mix_Music * Mix_LoadMUS(const(char) *file); /* Load a wave file of the mixer format from a memory buffer */ Mix_Chunk * Mix_QuickLoad_WAV(Uint8 *mem); @@ -128,19 +128,17 @@ This can be used to provide real-time visual display of the audio stream or add a custom mixer filter for the stream data. */ - void Mix_SetPostMix(void (*mix_func) - (void *udata, Uint8 *stream, int len), void *arg); + void Mix_SetPostMix(void function(void *udata, Uint8 *stream, int len) mix_func, void *arg); /* Add your own music player or additional mixer function. If 'mix_func' is NULL, the default music player is re-enabled. */ - void Mix_HookMusic(void (*mix_func) - (void *udata, Uint8 *stream, int len), void *arg); + void Mix_HookMusic(void function(void *udata, Uint8 *stream, int len) mix_func, void *arg); /* Add your own callback when the music has finished playing. This callback is only called if the music finishes naturally. */ - void Mix_HookMusicFinished(void (*music_finished)()); + void Mix_HookMusicFinished(void function() music_finished); /* Get a pointer to the user data for the current music hook */ void * Mix_GetMusicHookData(); @@ -153,7 +151,7 @@ * inside the audio callback, or SDL_mixer will explicitly lock the audio * before calling your callback. */ - void Mix_ChannelFinished(void (*channel_finished)(int channel)); + void Mix_ChannelFinished(void function(int channel) channel_finished); /* Special Effects API by ryan c. gordon. (icculus@linuxgames.com) */ @@ -177,7 +175,7 @@ * * DO NOT EVER call SDL_LockAudio() from your callback function! */ - typedef void (*Mix_EffectFunc_t)(int chan, void *stream, int len, void *udata); + alias void function(int chan, void *stream, int len, void *udata) Mix_EffectFunc_t; /* * This is a callback that signifies that a channel has finished all its @@ -188,7 +186,7 @@ * * DO NOT EVER call SDL_LockAudio() from your callback function! */ - typedef void (*Mix_EffectDone_t)(int chan, void *udata); + alias void function(int chan, void *udata) Mix_EffectDone_t; /* Register a special effect function. At mixing time, the channel data is @@ -510,7 +508,7 @@ int Mix_PlayingMusic(); /* Stop music and set external music playback command */ - int Mix_SetMusicCMD(char *command); + int Mix_SetMusicCMD(const(char) *command); /* Synchro value is set by MikMod from modules while playing */ int Mix_SetSynchroValue(int value); --- a/import/SDL_quit.d +++ b/import/SDL_quit.d @@ -40,8 +40,8 @@ */ /* There are no functions directly affecting the quit event */ -bit SDL_QuitRequested() +bool SDL_QuitRequested() { SDL_PumpEvents(); - return cast(bit)SDL_PeepEvents(null, 0, SDL_PEEKEVENT, SDL_QUITMASK); + return 0 != SDL_PeepEvents(null, 0, SDL_PEEKEVENT, SDL_QUITMASK); } --- a/import/SDL_rwops.d +++ b/import/SDL_rwops.d @@ -28,11 +28,6 @@ extern(C): -typedef int (*_seek_func_t)(SDL_RWops *context, int offset, int whence); -typedef int (*_read_func_t)(SDL_RWops *context, void *ptr, int size, int maxnum); -typedef int (*_write_func_t)(SDL_RWops *context, void *ptr, int size, int num); -typedef int (*_close_func_t)(SDL_RWops *context); - /* This is the read/write operation structure -- very basic */ struct SDL_RWops { @@ -40,26 +35,22 @@ SEEK_SET, SEEK_CUR, SEEK_END Returns the final offset in the data source. */ - _seek_func_t seek; -// int (*seek)(SDL_RWops *context, int offset, int whence); + int function(SDL_RWops *context, int offset, int whence) seek; /* Read up to 'num' objects each of size 'objsize' from the data source to the area pointed at by 'ptr'. Returns the number of objects read, or -1 if the read failed. */ - _read_func_t read; -// int (*read)(SDL_RWops *context, void *ptr, int size, int maxnum); + int function(SDL_RWops *context, void *ptr, int size, int maxnum) read; /* Write exactly 'num' objects each of size 'objsize' from the area pointed at by 'ptr' to data source. Returns 'num', or -1 if the write failed. */ - _write_func_t write; -// int (*write)(SDL_RWops *context, void *ptr, int size, int num); + int function(SDL_RWops *context, void *ptr, int size, int num) write; /* Close and free an allocated SDL_FSops structure */ - _close_func_t close; -// int (*close)(SDL_RWops *context); + int function(SDL_RWops *context) close; Uint32 type; union { @@ -81,7 +72,7 @@ /* Functions to create SDL_RWops structures from various data sources */ -SDL_RWops * SDL_RWFromFile(char *file, char *mode); +SDL_RWops * SDL_RWFromFile(const(char)* file, const(char)* mode); SDL_RWops * SDL_RWFromFP(void *fp, int autoclose); @@ -93,40 +84,25 @@ /* Macros to easily read and write from an SDL_RWops structure */ int SDL_RWseek(SDL_RWops *ctx, int offset, int whence) { - _seek_func_t seek; -// int (*seek)(SDL_RWops *context, int offset, int whence); - seek = ctx.seek; - return (*seek)(ctx, offset, whence); + return ctx.seek(ctx, offset, whence); } int SDL_RWtell(SDL_RWops *ctx) { - _seek_func_t seek; -// int (*seek)(SDL_RWops *context, int offset, int whence); - seek = ctx.seek; - return (*seek)(ctx, 0, 1); + return ctx.seek(ctx, 0, 1); } int SDL_RWread(SDL_RWops *ctx, void* ptr, int size, int n) { - _read_func_t read; -// int (*read)(SDL_RWops *context, void *ptr, int size, int maxnum); - read = ctx.read; - return (*read)(ctx, ptr, size, n); + return ctx.read(ctx, ptr, size, n); } int SDL_RWwrite(SDL_RWops *ctx, void* ptr, int size, int n) { - _write_func_t write; -// int (*write)(SDL_RWops *context, void *ptr, int size, int num); - write = ctx.write; - return (*write)(ctx, ptr, size, n); + return ctx.write(ctx, ptr, size, n); } int SDL_RWclose(SDL_RWops *ctx) { - _close_func_t close; -// int (*close)(SDL_RWops *context); - close = ctx.close; - return (*close)(ctx); + return ctx.close(ctx); } --- a/import/SDL_syswm.d +++ b/import/SDL_syswm.d @@ -22,7 +22,7 @@ /* Include file for SDL custom system window manager hooks */ -import SDL_Version; +import SDL_version_; extern(C): --- a/import/SDL_thread.d +++ b/import/SDL_thread.d @@ -34,7 +34,7 @@ struct SDL_Thread { } /* Create a thread */ -SDL_Thread * SDL_CreateThread(int (*fn)(void *), void *data); +SDL_Thread * SDL_CreateThread(int function(void *) fn, void *data); /* Get the 32-bit thread identifier for the current thread */ Uint32 SDL_ThreadID(); --- a/import/SDL_timer.d +++ b/import/SDL_timer.d @@ -39,7 +39,7 @@ void SDL_Delay(Uint32 ms); /* Function prototype for the timer callback function */ -alias Uint32 (*SDL_TimerCallback)(Uint32 interval); +alias Uint32 function(Uint32 interval) SDL_TimerCallback; /* Set a callback to run after the specified number of milliseconds has * elapsed. The callback function is passed the current timer interval @@ -79,7 +79,7 @@ * passed in, the periodic alarm continues, otherwise a new alarm is * scheduled. If the callback returns 0, the periodic alarm is cancelled. */ -alias Uint32 (*SDL_NewTimerCallback)(Uint32 interval, void *param); +alias Uint32 function(Uint32 interval, void *param) SDL_NewTimerCallback; /* Definition of the timer ID type */ alias void *SDL_TimerID; --- a/import/SDL_types.d +++ b/import/SDL_types.d @@ -33,7 +33,7 @@ alias ushort Uint16; alias short Sint16; alias uint Uint32; -alias int Sint32; +alias int Sint32; alias ulong Uint64; alias long Sint64; --- a/import/SDL_video.d +++ b/import/SDL_video.d @@ -74,9 +74,9 @@ Uint8 alpha; } -/* typedef for private surface blitting functions */ -typedef int (*SDL_blit)(SDL_Surface *src, SDL_Rect *srcrect, - SDL_Surface *dst, SDL_Rect *dstrect); +/* alias for private surface blitting functions */ +alias int function(SDL_Surface *src, SDL_Rect *srcrect, + SDL_Surface *dst, SDL_Rect *dstrect) SDL_blit; /* This structure should be treated as read-only, except for 'pixels', which, if not NULL, contains the raw pixel data for the surface. @@ -132,7 +132,7 @@ const uint SDL_PREALLOC = 0x01000000; /* Surface uses preallocated memory */ /* Evaluates to true if the surface needs to be locked before access */ -bit SDL_MUSTLOCK(SDL_Surface *surface) +bool SDL_MUSTLOCK(SDL_Surface *surface) { return surface.offset || ((surface.flags & (SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_RLEACCEL)) != 0); @@ -186,7 +186,7 @@ /* Special flags */ union { - bit hw_overlay; + bool hw_overlay; Uint32 _dummy; } // Uint32 hw_overlay :1; /* Flag: This overlay hardware accelerated? */ @@ -540,7 +540,7 @@ SDL_Surface * SDL_LoadBMP_RW(SDL_RWops *src, int freesrc); /* Convenience macro -- load a surface from a file */ -SDL_Surface * SDL_LoadBMP(char* file) +SDL_Surface * SDL_LoadBMP(const(char)* file) { return SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1); } @@ -554,7 +554,7 @@ (SDL_Surface *surface, SDL_RWops *dst, int freedst); /* Convenience macro -- save a surface to a file */ -int SDL_SaveBMP(SDL_Surface *surface, char* file) +int SDL_SaveBMP(SDL_Surface *surface, const(char)* file) { return SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1); } @@ -837,7 +837,7 @@ /* * Sets/Gets the title and icon text of the display window */ -void SDL_WM_SetCaption(char *title, char *icon); +void SDL_WM_SetCaption(const(char) *title, char *icon); void SDL_WM_GetCaption(char **title, char **icon); /* --- a/import/bulletml.d +++ b/import/bulletml.d @@ -1,7 +1,7 @@ extern (C) { alias int BulletMLParserTinyXML; -int* BulletMLParserTinyXML_new(char*); -void BulletMLParserTinyXML_parse(int* ); +int* BulletMLParserTinyXML_new(const(char)*); +void BulletMLParserTinyXML_parse(int*); void BulletMLParserTinyXML_delete(int*); alias int BulletMLParser; alias int BulletMLState; @@ -10,22 +10,22 @@ int* BulletMLRunner_new_parser(BulletMLParser*); int* BulletMLRunner_new_state(BulletMLState*); void BulletMLRunner_delete(int*); -void BulletMLRunner_run(int* ); -bool BulletMLRunner_isEnd(int* ); -void BulletMLRunner_set_getBulletDirection(int*, double (*fp) (int* )); -void BulletMLRunner_set_getAimDirection(int*, double (*fp) (int* )); -void BulletMLRunner_set_getBulletSpeed(int*, double (*fp) (int* )); -void BulletMLRunner_set_getDefaultSpeed(int*, double (*fp) (int* )); -void BulletMLRunner_set_getRank(int*, double (*fp) (int* )); -void BulletMLRunner_set_createSimpleBullet(int*, void (*fp) (int* , double, double)); -void BulletMLRunner_set_createBullet(int*, void (*fp) (int* , BulletMLState*, double, double)); -void BulletMLRunner_set_getTurn(int*, int (*fp) (int* )); -void BulletMLRunner_set_doVanish(int*, void (*fp) (int* )); -void BulletMLRunner_set_doChangeDirection(int*, void (*fp) (int* , double)); -void BulletMLRunner_set_doChangeSpeed(int*, void (*fp) (int* , double)); -void BulletMLRunner_set_doAccelX(int*, void (*fp) (int* , double)); -void BulletMLRunner_set_doAccelY(int*, void (*fp) (int* , double)); -void BulletMLRunner_set_getBulletSpeedX(int*, double (*fp) (int* )); -void BulletMLRunner_set_getBulletSpeedY(int*, double (*fp) (int* )); -void BulletMLRunner_set_getRand(int*, double (*fp) (int* )); +void BulletMLRunner_run(int*); +bool BulletMLRunner_isEnd(int*); +void BulletMLRunner_set_getBulletDirection(int*, double function(int*) fp); +void BulletMLRunner_set_getAimDirection(int*, double function(int*) fp); +void BulletMLRunner_set_getBulletSpeed(int*, double function(int*) fp); +void BulletMLRunner_set_getDefaultSpeed(int*, double function(int*) fp); +void BulletMLRunner_set_getRank(int*, double function(int*) fp); +void BulletMLRunner_set_createSimpleBullet(int*, void function(int*, double, double) fp); +void BulletMLRunner_set_createBullet(int*, void function(int*, BulletMLState*, double, double) fp); +void BulletMLRunner_set_getTurn(int*, int function(int*) fp); +void BulletMLRunner_set_doVanish(int*, void function(int*) fp); +void BulletMLRunner_set_doChangeDirection(int*, void function(int*, double) fp); +void BulletMLRunner_set_doChangeSpeed(int*, void function(int*, double) fp); +void BulletMLRunner_set_doAccelX(int*, void function(int*, double) fp); +void BulletMLRunner_set_doAccelY(int*, void function(int*, double) fp); +void BulletMLRunner_set_getBulletSpeedX(int*, double function(int*) fp); +void BulletMLRunner_set_getBulletSpeedY(int*, double function(int*) fp); +void BulletMLRunner_set_getRand(int*, double function(int*) fp); } --- a/import/opengl.d +++ b/import/opengl.d @@ -1,10 +1,4 @@ -version (Win32) { - private import std.c.windows.windows; - extern(Windows): -} -version (linux) { - extern(C): -} +extern(System): alias uint GLenum; alias ubyte GLboolean; @@ -165,6 +159,7 @@ const uint GL_3_BYTES = 0x1408; const uint GL_4_BYTES = 0x1409; const uint GL_DOUBLE = 0x140A; +const uint GL_UNSIGNED_INT_8_8_8_8_REV = 0x8367; /* DepthFunction */ /* GL_NEVER */ @@ -1116,7 +1111,7 @@ /*************************************************************/ void /*APIENTRY*/glAccum (GLenum op, GLfloat value); -void /*APIENTRY*/glAlphaFunc (GLenum func, GLclampf ref); +void /*APIENTRY*/glAlphaFunc (GLenum func, GLclampf ref_); GLboolean /*APIENTRY*/glAreTexturesResident (GLsizei n, GLuint *textures, GLboolean *residences); void /*APIENTRY*/glArrayElement (GLint i); void /*APIENTRY*/glBegin (GLenum mode); @@ -1369,7 +1364,7 @@ void /*APIENTRY*/glScissor (GLint x, GLint y, GLsizei width, GLsizei height); void /*APIENTRY*/glSelectBuffer (GLsizei size, GLuint *buffer); void /*APIENTRY*/glShadeModel (GLenum mode); -void /*APIENTRY*/glStencilFunc (GLenum func, GLint ref, GLuint mask); +void /*APIENTRY*/glStencilFunc (GLenum func, GLint ref_, GLuint mask); void /*APIENTRY*/glStencilMask (GLuint mask); void /*APIENTRY*/glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); void /*APIENTRY*/glTexCoord1d (GLdouble s); @@ -1454,35 +1449,30 @@ /* EXT_vertex_array */ -typedef void (* PFNGLARRAYELEMENTEXTPROC) (GLint i); -typedef void (* PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (* PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer); -typedef void (* PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer); -typedef void (* PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer); -typedef void (* PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer); -typedef void (* PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer); -typedef void (* PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, GLboolean *pointer); -typedef void (* PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); -typedef void (* PFNGLARRAYELEMENTARRAYEXTPROC)(GLenum mode, GLsizei count, GLvoid* pi); +alias void function(GLint i) PFNGLARRAYELEMENTEXTPROC; +alias void function(GLenum mode, GLint first, GLsizei count) PFNGLDRAWARRAYSEXTPROC; +alias void function(GLint size, GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer) PFNGLVERTEXPOINTEREXTPROC; +alias void function(GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer) PFNGLNORMALPOINTEREXTPROC; +alias void function(GLint size, GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer) PFNGLCOLORPOINTEREXTPROC; +alias void function(GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer) PFNGLINDEXPOINTEREXTPROC; +alias void function(GLint size, GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer) PFNGLTEXCOORDPOINTEREXTPROC; +alias void function(GLsizei stride, GLsizei count, GLboolean *pointer) PFNGLEDGEFLAGPOINTEREXTPROC; +alias void function(GLenum pname, GLvoid* *params) PFNGLGETPOINTERVEXTPROC; +alias void function(GLenum mode, GLsizei count, GLvoid* pi) PFNGLARRAYELEMENTARRAYEXTPROC; /* WIN_draw_range_elements */ -typedef void (* PFNGLDRAWRANGEELEMENTSWINPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLvoid *indices); +alias void function(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLvoid *indices) PFNGLDRAWRANGEELEMENTSWINPROC; /* WIN_swap_hint */ -typedef void (* PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height); +alias void function(GLint x, GLint y, GLsizei width, GLsizei height) PFNGLADDSWAPHINTRECTWINPROC; /* EXT_paletted_texture */ -typedef void (* PFNGLCOLORTABLEEXTPROC) - (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, - GLenum type, GLvoid *data); -typedef void (* PFNGLCOLORSUBTABLEEXTPROC) - (GLenum target, GLsizei start, GLsizei count, GLenum format, - GLenum type, GLvoid *data); -typedef void (* PFNGLGETCOLORTABLEEXTPROC) - (GLenum target, GLenum format, GLenum type, GLvoid *data); -typedef void (* PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) - (GLenum target, GLenum pname, GLint *params); -typedef void (* PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) - (GLenum target, GLenum pname, GLfloat *params); +alias void function(GLenum target, GLenum internalFormat, GLsizei width, GLenum format, + GLenum type, GLvoid *data) PFNGLCOLORTABLEEXTPROC; +alias void function(GLenum target, GLsizei start, GLsizei count, GLenum format, + GLenum type, GLvoid *data) PFNGLCOLORSUBTABLEEXTPROC; +alias void function(GLenum target, GLenum format, GLenum type, GLvoid *data) PFNGLGETCOLORTABLEEXTPROC; +alias void function(GLenum target, GLenum pname, GLint *params) PFNGLGETCOLORTABLEPARAMETERIVEXTPROC; +alias void function(GLenum target, GLenum pname, GLfloat *params) PFNGLGETCOLORTABLEPARAMETERFVEXTPROC; //import openglu; --- a/import/openglu.d +++ b/import/openglu.d @@ -1,11 +1,6 @@ import opengl; -version (Win32) { - extern(Windows): -} -version (linux) { - extern(C): -} +extern(System): GLubyte* gluErrorString ( GLenum errCode); @@ -33,7 +28,7 @@ GLdouble y, GLdouble width, GLdouble height, - GLint[4] viewport); + ref GLint[4] viewport); void gluLookAt ( GLdouble eyex, @@ -50,9 +45,9 @@ GLdouble objx, GLdouble objy, GLdouble objz, - GLdouble[16] modelMatrix, - GLdouble[16] projMatrix, - GLint[4] viewport, + ref GLdouble[16] modelMatrix, + ref GLdouble[16] projMatrix, + ref GLint[4] viewport, GLdouble *winx, GLdouble *winy, GLdouble *winz); @@ -61,8 +56,8 @@ GLdouble winx, GLdouble winy, GLdouble winz, - GLdouble[16] modelMatrix, - GLdouble[16] projMatrix, + ref GLdouble[16] modelMatrix, + ref GLdouble[16] projMatrix, GLint[4] viewport, GLdouble *objx, GLdouble *objy, @@ -162,7 +157,7 @@ void gluQuadricCallback ( GLUquadric *qobj, GLenum which, - void (* fn)()); + void function() fn); GLUtesselator* gluNewTess( ); @@ -179,7 +174,7 @@ void gluTessVertex( GLUtesselator *tess, - GLdouble[3] coords, + ref GLdouble[3] coords, void *data ); void gluTessEndContour( @@ -202,7 +197,7 @@ void gluTessCallback( GLUtesselator *tess, GLenum which, - void ( *fn)()); + void function() fn); void gluGetTessProperty( GLUtesselator *tess, @@ -265,9 +260,9 @@ void gluLoadSamplingMatrices ( GLUnurbs *nobj, - GLfloat[16] modelMatrix, - GLfloat[16] projMatrix, - GLint[4] viewport ); + ref GLfloat[16] modelMatrix, + ref GLfloat[16] projMatrix, + ref GLint[4] viewport ); void gluNurbsProperty ( @@ -285,37 +280,37 @@ gluNurbsCallback ( GLUnurbs *nobj, GLenum which, - void (* fn)() ); + void function() fn ); /**** function prototypes ****/ /* gluQuadricCallback */ -typedef void (* GLUquadricErrorProc) (GLenum); +alias void function(GLenum) GLUquadricErrorProc; /* gluTessCallback */ -typedef void (* GLUtessBeginProc) (GLenum); -typedef void (* GLUtessEdgeFlagProc) (GLboolean); -typedef void (* GLUtessVertexProc) (void *); -typedef void (* GLUtessEndProc) (); -typedef void (* GLUtessErrorProc) (GLenum); -typedef void (* GLUtessCombineProc) (GLdouble[3], - void*[4], - GLfloat[4], - void** ); -typedef void (* GLUtessBeginDataProc) (GLenum, void *); -typedef void (* GLUtessEdgeFlagDataProc) (GLboolean, void *); -typedef void (* GLUtessVertexDataProc) (void *, void *); -typedef void (* GLUtessEndDataProc) (void *); -typedef void (* GLUtessErrorDataProc) (GLenum, void *); -typedef void (* GLUtessCombineDataProc) (GLdouble[3], - void*[4], - GLfloat[4], - void**, - void* ); +alias void function(GLenum) GLUtessBeginProc; +alias void function(GLboolean) GLUtessEdgeFlagProc; +alias void function(void *) GLUtessVertexProc; +alias void function() GLUtessEndProc; +alias void function(GLenum) GLUtessErrorProc; +alias void function(ref GLdouble[3], + ref void*[4], + ref GLfloat[4], + void**) GLUtessCombineProc; +alias void function(GLenum, void *) GLUtessBeginDataProc; +alias void function(GLboolean, void *) GLUtessEdgeFlagDataProc; +alias void function(void *, void *) GLUtessVertexDataProc; +alias void function(void *) GLUtessEndDataProc; +alias void function(GLenum, void *) GLUtessErrorDataProc; +alias void function(ref GLdouble[3], + ref void*[4], + ref GLfloat[4], + void**, + void*) GLUtessCombineDataProc; /* gluNurbsCallback */ -typedef void (* GLUnurbsErrorProc) (GLenum); +alias void function(GLenum) GLUnurbsErrorProc; /**** Generic constants ****/ --- /dev/null +++ b/import/SDL_keysym_.d @@ -0,0 +1,308 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Sam Lantinga + slouken@devolution.com +*/ + +/* What we really want is a mapping of every raw key on the keyboard. + To support international keyboards, we use the range 0xA1 - 0xFF + as international virtual keycodes. We'll follow in the footsteps of X11... + The names of the keys + */ + +alias int SDLKey; +enum { + /* The keyboard syms have been cleverly chosen to map to ASCII */ + SDLK_UNKNOWN = 0, + SDLK_FIRST = 0, + SDLK_BACKSPACE = 8, + SDLK_TAB = 9, + SDLK_CLEAR = 12, + SDLK_RETURN = 13, + SDLK_PAUSE = 19, + SDLK_ESCAPE = 27, + SDLK_SPACE = 32, + SDLK_EXCLAIM = 33, + SDLK_QUOTEDBL = 34, + SDLK_HASH = 35, + SDLK_DOLLAR = 36, + SDLK_AMPERSAND = 38, + SDLK_QUOTE = 39, + SDLK_LEFTPAREN = 40, + SDLK_RIGHTPAREN = 41, + SDLK_ASTERISK = 42, + SDLK_PLUS = 43, + SDLK_COMMA = 44, + SDLK_MINUS = 45, + SDLK_PERIOD = 46, + SDLK_SLASH = 47, + SDLK_0 = 48, + SDLK_1 = 49, + SDLK_2 = 50, + SDLK_3 = 51, + SDLK_4 = 52, + SDLK_5 = 53, + SDLK_6 = 54, + SDLK_7 = 55, + SDLK_8 = 56, + SDLK_9 = 57, + SDLK_COLON = 58, + SDLK_SEMICOLON = 59, + SDLK_LESS = 60, + SDLK_EQUALS = 61, + SDLK_GREATER = 62, + SDLK_QUESTION = 63, + SDLK_AT = 64, + /* + Skip uppercase letters + */ + SDLK_LEFTBRACKET = 91, + SDLK_BACKSLASH = 92, + SDLK_RIGHTBRACKET = 93, + SDLK_CARET = 94, + SDLK_UNDERSCORE = 95, + SDLK_BACKQUOTE = 96, + SDLK_a = 97, + SDLK_b = 98, + SDLK_c = 99, + SDLK_d = 100, + SDLK_e = 101, + SDLK_f = 102, + SDLK_g = 103, + SDLK_h = 104, + SDLK_i = 105, + SDLK_j = 106, + SDLK_k = 107, + SDLK_l = 108, + SDLK_m = 109, + SDLK_n = 110, + SDLK_o = 111, + SDLK_p = 112, + SDLK_q = 113, + SDLK_r = 114, + SDLK_s = 115, + SDLK_t = 116, + SDLK_u = 117, + SDLK_v = 118, + SDLK_w = 119, + SDLK_x = 120, + SDLK_y = 121, + SDLK_z = 122, + SDLK_DELETE = 127, + /* End of ASCII mapped keysyms */ + + /* International keyboard syms */ + SDLK_WORLD_0 = 160, /* 0xA0 */ + SDLK_WORLD_1 = 161, + SDLK_WORLD_2 = 162, + SDLK_WORLD_3 = 163, + SDLK_WORLD_4 = 164, + SDLK_WORLD_5 = 165, + SDLK_WORLD_6 = 166, + SDLK_WORLD_7 = 167, + SDLK_WORLD_8 = 168, + SDLK_WORLD_9 = 169, + SDLK_WORLD_10 = 170, + SDLK_WORLD_11 = 171, + SDLK_WORLD_12 = 172, + SDLK_WORLD_13 = 173, + SDLK_WORLD_14 = 174, + SDLK_WORLD_15 = 175, + SDLK_WORLD_16 = 176, + SDLK_WORLD_17 = 177, + SDLK_WORLD_18 = 178, + SDLK_WORLD_19 = 179, + SDLK_WORLD_20 = 180, + SDLK_WORLD_21 = 181, + SDLK_WORLD_22 = 182, + SDLK_WORLD_23 = 183, + SDLK_WORLD_24 = 184, + SDLK_WORLD_25 = 185, + SDLK_WORLD_26 = 186, + SDLK_WORLD_27 = 187, + SDLK_WORLD_28 = 188, + SDLK_WORLD_29 = 189, + SDLK_WORLD_30 = 190, + SDLK_WORLD_31 = 191, + SDLK_WORLD_32 = 192, + SDLK_WORLD_33 = 193, + SDLK_WORLD_34 = 194, + SDLK_WORLD_35 = 195, + SDLK_WORLD_36 = 196, + SDLK_WORLD_37 = 197, + SDLK_WORLD_38 = 198, + SDLK_WORLD_39 = 199, + SDLK_WORLD_40 = 200, + SDLK_WORLD_41 = 201, + SDLK_WORLD_42 = 202, + SDLK_WORLD_43 = 203, + SDLK_WORLD_44 = 204, + SDLK_WORLD_45 = 205, + SDLK_WORLD_46 = 206, + SDLK_WORLD_47 = 207, + SDLK_WORLD_48 = 208, + SDLK_WORLD_49 = 209, + SDLK_WORLD_50 = 210, + SDLK_WORLD_51 = 211, + SDLK_WORLD_52 = 212, + SDLK_WORLD_53 = 213, + SDLK_WORLD_54 = 214, + SDLK_WORLD_55 = 215, + SDLK_WORLD_56 = 216, + SDLK_WORLD_57 = 217, + SDLK_WORLD_58 = 218, + SDLK_WORLD_59 = 219, + SDLK_WORLD_60 = 220, + SDLK_WORLD_61 = 221, + SDLK_WORLD_62 = 222, + SDLK_WORLD_63 = 223, + SDLK_WORLD_64 = 224, + SDLK_WORLD_65 = 225, + SDLK_WORLD_66 = 226, + SDLK_WORLD_67 = 227, + SDLK_WORLD_68 = 228, + SDLK_WORLD_69 = 229, + SDLK_WORLD_70 = 230, + SDLK_WORLD_71 = 231, + SDLK_WORLD_72 = 232, + SDLK_WORLD_73 = 233, + SDLK_WORLD_74 = 234, + SDLK_WORLD_75 = 235, + SDLK_WORLD_76 = 236, + SDLK_WORLD_77 = 237, + SDLK_WORLD_78 = 238, + SDLK_WORLD_79 = 239, + SDLK_WORLD_80 = 240, + SDLK_WORLD_81 = 241, + SDLK_WORLD_82 = 242, + SDLK_WORLD_83 = 243, + SDLK_WORLD_84 = 244, + SDLK_WORLD_85 = 245, + SDLK_WORLD_86 = 246, + SDLK_WORLD_87 = 247, + SDLK_WORLD_88 = 248, + SDLK_WORLD_89 = 249, + SDLK_WORLD_90 = 250, + SDLK_WORLD_91 = 251, + SDLK_WORLD_92 = 252, + SDLK_WORLD_93 = 253, + SDLK_WORLD_94 = 254, + SDLK_WORLD_95 = 255, /* 0xFF */ + + /* Numeric keypad */ + SDLK_KP0 = 256, + SDLK_KP1 = 257, + SDLK_KP2 = 258, + SDLK_KP3 = 259, + SDLK_KP4 = 260, + SDLK_KP5 = 261, + SDLK_KP6 = 262, + SDLK_KP7 = 263, + SDLK_KP8 = 264, + SDLK_KP9 = 265, + SDLK_KP_PERIOD = 266, + SDLK_KP_DIVIDE = 267, + SDLK_KP_MULTIPLY = 268, + SDLK_KP_MINUS = 269, + SDLK_KP_PLUS = 270, + SDLK_KP_ENTER = 271, + SDLK_KP_EQUALS = 272, + + /* Arrows + Home/End pad */ + SDLK_UP = 273, + SDLK_DOWN = 274, + SDLK_RIGHT = 275, + SDLK_LEFT = 276, + SDLK_INSERT = 277, + SDLK_HOME = 278, + SDLK_END = 279, + SDLK_PAGEUP = 280, + SDLK_PAGEDOWN = 281, + + /* Function keys */ + SDLK_F1 = 282, + SDLK_F2 = 283, + SDLK_F3 = 284, + SDLK_F4 = 285, + SDLK_F5 = 286, + SDLK_F6 = 287, + SDLK_F7 = 288, + SDLK_F8 = 289, + SDLK_F9 = 290, + SDLK_F10 = 291, + SDLK_F11 = 292, + SDLK_F12 = 293, + SDLK_F13 = 294, + SDLK_F14 = 295, + SDLK_F15 = 296, + + /* Key state modifier keys */ + SDLK_NUMLOCK = 300, + SDLK_CAPSLOCK = 301, + SDLK_SCROLLOCK = 302, + SDLK_RSHIFT = 303, + SDLK_LSHIFT = 304, + SDLK_RCTRL = 305, + SDLK_LCTRL = 306, + SDLK_RALT = 307, + SDLK_LALT = 308, + SDLK_RMETA = 309, + SDLK_LMETA = 310, + SDLK_LSUPER = 311, /* Left "Windows" key */ + SDLK_RSUPER = 312, /* Right "Windows" key */ + SDLK_MODE = 313, /* "Alt Gr" key */ + SDLK_COMPOSE = 314, /* Multi-key compose key */ + + /* Miscellaneous function keys */ + SDLK_HELP = 315, + SDLK_PRINT = 316, + SDLK_SYSREQ = 317, + SDLK_BREAK = 318, + SDLK_MENU = 319, + SDLK_POWER = 320, /* Power Macintosh power key */ + SDLK_EURO = 321, /* Some european keyboards */ + SDLK_UNDO = 322, /* Atari keyboard has Undo */ + + /* Add any other keys here */ + + SDLK_LAST +} + +/* Enumeration of valid key mods (possibly OR'd together) */ +alias int SDLMod; +enum { + KMOD_NONE = 0x0000, + KMOD_LSHIFT= 0x0001, + KMOD_RSHIFT= 0x0002, + KMOD_LCTRL = 0x0040, + KMOD_RCTRL = 0x0080, + KMOD_LALT = 0x0100, + KMOD_RALT = 0x0200, + KMOD_LMETA = 0x0400, + KMOD_RMETA = 0x0800, + KMOD_NUM = 0x1000, + KMOD_CAPS = 0x2000, + KMOD_MODE = 0x4000, + KMOD_RESERVED = 0x8000 +} + +const uint KMOD_CTRL = (KMOD_LCTRL|KMOD_RCTRL); +const uint KMOD_SHIFT = (KMOD_LSHIFT|KMOD_RSHIFT); +const uint KMOD_ALT = (KMOD_LALT|KMOD_RALT); +const uint KMOD_META = (KMOD_LMETA|KMOD_RMETA); --- /dev/null +++ b/import/SDL_version_.d @@ -0,0 +1,75 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Sam Lantinga + slouken@devolution.com +*/ + +/* This header defines the current SDL version */ + +import SDL_types; + +extern(C): + +/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL +*/ +const uint SDL_MAJOR_VERSION = 1; +const uint SDL_MINOR_VERSION = 2; +const uint SDL_PATCHLEVEL = 6; + +struct SDL_version { + Uint8 major; + Uint8 minor; + Uint8 patch; +} + +/* This macro can be used to fill a version structure with the compile-time + * version of the SDL library. + */ +void SDL_VERSION(SDL_version* X) +{ + X.major = SDL_MAJOR_VERSION; + X.minor = SDL_MINOR_VERSION; + X.patch = SDL_PATCHLEVEL; +} + +/* This macro turns the version numbers into a numeric value: + (1,2,3) -> (1203) + This assumes that there will never be more than 100 patchlevels +*/ +uint SDL_VERSIONNUM(Uint8 X, Uint8 Y, Uint8 Z) +{ + return X * 1000 + Y * 100 + Z; +} + +/* This is the version number macro for the current SDL version */ +const uint SDL_COMPILEDVERSION = SDL_MAJOR_VERSION * 1000 + + SDL_MINOR_VERSION * 100 + + SDL_PATCHLEVEL; + +/* This macro will evaluate to true if compiled with SDL at least X.Y.Z */ +bool SDL_VERSION_ATLEAST(Uint8 X, Uint8 Y, Uint8 Z) +{ + return (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)); +} + +/* This function gets the version of the dynamically linked SDL library. + it should NOT be used to fill a version structure, instead you should + use the SDL_Version() macro. + */ +SDL_version * SDL_Linked_Version(); --- a/import/SDL_Keysym.d +++ /dev/null @@ -1,308 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@devolution.com -*/ - -/* What we really want is a mapping of every raw key on the keyboard. - To support international keyboards, we use the range 0xA1 - 0xFF - as international virtual keycodes. We'll follow in the footsteps of X11... - The names of the keys - */ - -alias int SDLKey; -enum { - /* The keyboard syms have been cleverly chosen to map to ASCII */ - SDLK_UNKNOWN = 0, - SDLK_FIRST = 0, - SDLK_BACKSPACE = 8, - SDLK_TAB = 9, - SDLK_CLEAR = 12, - SDLK_RETURN = 13, - SDLK_PAUSE = 19, - SDLK_ESCAPE = 27, - SDLK_SPACE = 32, - SDLK_EXCLAIM = 33, - SDLK_QUOTEDBL = 34, - SDLK_HASH = 35, - SDLK_DOLLAR = 36, - SDLK_AMPERSAND = 38, - SDLK_QUOTE = 39, - SDLK_LEFTPAREN = 40, - SDLK_RIGHTPAREN = 41, - SDLK_ASTERISK = 42, - SDLK_PLUS = 43, - SDLK_COMMA = 44, - SDLK_MINUS = 45, - SDLK_PERIOD = 46, - SDLK_SLASH = 47, - SDLK_0 = 48, - SDLK_1 = 49, - SDLK_2 = 50, - SDLK_3 = 51, - SDLK_4 = 52, - SDLK_5 = 53, - SDLK_6 = 54, - SDLK_7 = 55, - SDLK_8 = 56, - SDLK_9 = 57, - SDLK_COLON = 58, - SDLK_SEMICOLON = 59, - SDLK_LESS = 60, - SDLK_EQUALS = 61, - SDLK_GREATER = 62, - SDLK_QUESTION = 63, - SDLK_AT = 64, - /* - Skip uppercase letters - */ - SDLK_LEFTBRACKET = 91, - SDLK_BACKSLASH = 92, - SDLK_RIGHTBRACKET = 93, - SDLK_CARET = 94, - SDLK_UNDERSCORE = 95, - SDLK_BACKQUOTE = 96, - SDLK_a = 97, - SDLK_b = 98, - SDLK_c = 99, - SDLK_d = 100, - SDLK_e = 101, - SDLK_f = 102, - SDLK_g = 103, - SDLK_h = 104, - SDLK_i = 105, - SDLK_j = 106, - SDLK_k = 107, - SDLK_l = 108, - SDLK_m = 109, - SDLK_n = 110, - SDLK_o = 111, - SDLK_p = 112, - SDLK_q = 113, - SDLK_r = 114, - SDLK_s = 115, - SDLK_t = 116, - SDLK_u = 117, - SDLK_v = 118, - SDLK_w = 119, - SDLK_x = 120, - SDLK_y = 121, - SDLK_z = 122, - SDLK_DELETE = 127, - /* End of ASCII mapped keysyms */ - - /* International keyboard syms */ - SDLK_WORLD_0 = 160, /* 0xA0 */ - SDLK_WORLD_1 = 161, - SDLK_WORLD_2 = 162, - SDLK_WORLD_3 = 163, - SDLK_WORLD_4 = 164, - SDLK_WORLD_5 = 165, - SDLK_WORLD_6 = 166, - SDLK_WORLD_7 = 167, - SDLK_WORLD_8 = 168, - SDLK_WORLD_9 = 169, - SDLK_WORLD_10 = 170, - SDLK_WORLD_11 = 171, - SDLK_WORLD_12 = 172, - SDLK_WORLD_13 = 173, - SDLK_WORLD_14 = 174, - SDLK_WORLD_15 = 175, - SDLK_WORLD_16 = 176, - SDLK_WORLD_17 = 177, - SDLK_WORLD_18 = 178, - SDLK_WORLD_19 = 179, - SDLK_WORLD_20 = 180, - SDLK_WORLD_21 = 181, - SDLK_WORLD_22 = 182, - SDLK_WORLD_23 = 183, - SDLK_WORLD_24 = 184, - SDLK_WORLD_25 = 185, - SDLK_WORLD_26 = 186, - SDLK_WORLD_27 = 187, - SDLK_WORLD_28 = 188, - SDLK_WORLD_29 = 189, - SDLK_WORLD_30 = 190, - SDLK_WORLD_31 = 191, - SDLK_WORLD_32 = 192, - SDLK_WORLD_33 = 193, - SDLK_WORLD_34 = 194, - SDLK_WORLD_35 = 195, - SDLK_WORLD_36 = 196, - SDLK_WORLD_37 = 197, - SDLK_WORLD_38 = 198, - SDLK_WORLD_39 = 199, - SDLK_WORLD_40 = 200, - SDLK_WORLD_41 = 201, - SDLK_WORLD_42 = 202, - SDLK_WORLD_43 = 203, - SDLK_WORLD_44 = 204, - SDLK_WORLD_45 = 205, - SDLK_WORLD_46 = 206, - SDLK_WORLD_47 = 207, - SDLK_WORLD_48 = 208, - SDLK_WORLD_49 = 209, - SDLK_WORLD_50 = 210, - SDLK_WORLD_51 = 211, - SDLK_WORLD_52 = 212, - SDLK_WORLD_53 = 213, - SDLK_WORLD_54 = 214, - SDLK_WORLD_55 = 215, - SDLK_WORLD_56 = 216, - SDLK_WORLD_57 = 217, - SDLK_WORLD_58 = 218, - SDLK_WORLD_59 = 219, - SDLK_WORLD_60 = 220, - SDLK_WORLD_61 = 221, - SDLK_WORLD_62 = 222, - SDLK_WORLD_63 = 223, - SDLK_WORLD_64 = 224, - SDLK_WORLD_65 = 225, - SDLK_WORLD_66 = 226, - SDLK_WORLD_67 = 227, - SDLK_WORLD_68 = 228, - SDLK_WORLD_69 = 229, - SDLK_WORLD_70 = 230, - SDLK_WORLD_71 = 231, - SDLK_WORLD_72 = 232, - SDLK_WORLD_73 = 233, - SDLK_WORLD_74 = 234, - SDLK_WORLD_75 = 235, - SDLK_WORLD_76 = 236, - SDLK_WORLD_77 = 237, - SDLK_WORLD_78 = 238, - SDLK_WORLD_79 = 239, - SDLK_WORLD_80 = 240, - SDLK_WORLD_81 = 241, - SDLK_WORLD_82 = 242, - SDLK_WORLD_83 = 243, - SDLK_WORLD_84 = 244, - SDLK_WORLD_85 = 245, - SDLK_WORLD_86 = 246, - SDLK_WORLD_87 = 247, - SDLK_WORLD_88 = 248, - SDLK_WORLD_89 = 249, - SDLK_WORLD_90 = 250, - SDLK_WORLD_91 = 251, - SDLK_WORLD_92 = 252, - SDLK_WORLD_93 = 253, - SDLK_WORLD_94 = 254, - SDLK_WORLD_95 = 255, /* 0xFF */ - - /* Numeric keypad */ - SDLK_KP0 = 256, - SDLK_KP1 = 257, - SDLK_KP2 = 258, - SDLK_KP3 = 259, - SDLK_KP4 = 260, - SDLK_KP5 = 261, - SDLK_KP6 = 262, - SDLK_KP7 = 263, - SDLK_KP8 = 264, - SDLK_KP9 = 265, - SDLK_KP_PERIOD = 266, - SDLK_KP_DIVIDE = 267, - SDLK_KP_MULTIPLY = 268, - SDLK_KP_MINUS = 269, - SDLK_KP_PLUS = 270, - SDLK_KP_ENTER = 271, - SDLK_KP_EQUALS = 272, - - /* Arrows + Home/End pad */ - SDLK_UP = 273, - SDLK_DOWN = 274, - SDLK_RIGHT = 275, - SDLK_LEFT = 276, - SDLK_INSERT = 277, - SDLK_HOME = 278, - SDLK_END = 279, - SDLK_PAGEUP = 280, - SDLK_PAGEDOWN = 281, - - /* Function keys */ - SDLK_F1 = 282, - SDLK_F2 = 283, - SDLK_F3 = 284, - SDLK_F4 = 285, - SDLK_F5 = 286, - SDLK_F6 = 287, - SDLK_F7 = 288, - SDLK_F8 = 289, - SDLK_F9 = 290, - SDLK_F10 = 291, - SDLK_F11 = 292, - SDLK_F12 = 293, - SDLK_F13 = 294, - SDLK_F14 = 295, - SDLK_F15 = 296, - - /* Key state modifier keys */ - SDLK_NUMLOCK = 300, - SDLK_CAPSLOCK = 301, - SDLK_SCROLLOCK = 302, - SDLK_RSHIFT = 303, - SDLK_LSHIFT = 304, - SDLK_RCTRL = 305, - SDLK_LCTRL = 306, - SDLK_RALT = 307, - SDLK_LALT = 308, - SDLK_RMETA = 309, - SDLK_LMETA = 310, - SDLK_LSUPER = 311, /* Left "Windows" key */ - SDLK_RSUPER = 312, /* Right "Windows" key */ - SDLK_MODE = 313, /* "Alt Gr" key */ - SDLK_COMPOSE = 314, /* Multi-key compose key */ - - /* Miscellaneous function keys */ - SDLK_HELP = 315, - SDLK_PRINT = 316, - SDLK_SYSREQ = 317, - SDLK_BREAK = 318, - SDLK_MENU = 319, - SDLK_POWER = 320, /* Power Macintosh power key */ - SDLK_EURO = 321, /* Some european keyboards */ - SDLK_UNDO = 322, /* Atari keyboard has Undo */ - - /* Add any other keys here */ - - SDLK_LAST -} - -/* Enumeration of valid key mods (possibly OR'd together) */ -alias int SDLMod; -enum { - KMOD_NONE = 0x0000, - KMOD_LSHIFT= 0x0001, - KMOD_RSHIFT= 0x0002, - KMOD_LCTRL = 0x0040, - KMOD_RCTRL = 0x0080, - KMOD_LALT = 0x0100, - KMOD_RALT = 0x0200, - KMOD_LMETA = 0x0400, - KMOD_RMETA = 0x0800, - KMOD_NUM = 0x1000, - KMOD_CAPS = 0x2000, - KMOD_MODE = 0x4000, - KMOD_RESERVED = 0x8000 -} - -const uint KMOD_CTRL = (KMOD_LCTRL|KMOD_RCTRL); -const uint KMOD_SHIFT = (KMOD_LSHIFT|KMOD_RSHIFT); -const uint KMOD_ALT = (KMOD_LALT|KMOD_RALT); -const uint KMOD_META = (KMOD_LMETA|KMOD_RMETA); debian/patches/fixes.patch0000644000000000000000000000650712164051121012755 0ustar # Copyright (C) 2007 Marcel Unbehaun # Copyright (C) 2007 Peter De Wachter # Distributed under the same license as the game. See debian/copyright. Index: val-and-rick-0.1a.dfsg1/src/abagames/util/logger.d =================================================================== --- val-and-rick-0.1a.dfsg1.orig/src/abagames/util/logger.d 2007-09-07 00:17:49.000000000 +0200 +++ val-and-rick-0.1a.dfsg1/src/abagames/util/logger.d 2007-09-07 00:17:54.000000000 +0200 @@ -5,7 +5,7 @@ */ module abagames.util.logger; -private import std.stream; +private import std.cstream; private import std.string; /** @@ -56,28 +56,28 @@ public static void info(char[] msg, bool nline = true) { if (nline) - stderr.writeLine(msg); + derr.writeLine(msg); else - stderr.writeString(msg); + derr.writeString(msg); } public static void info(double n, bool nline = true) { if (nline) - stderr.writeLine(std.string.toString(n)); + derr.writeLine(std.string.toString(n)); else - stderr.writeString(std.string.toString(n) ~ " "); + derr.writeString(std.string.toString(n) ~ " "); } public static void error(char[] msg) { - stderr.writeLine("Error: " ~ msg); + derr.writeLine("Error: " ~ msg); } public static void error(Exception e) { - stderr.writeLine("Error: " ~ e.toString()); + derr.writeLine("Error: " ~ e.toString()); } public static void error(Error e) { - stderr.writeLine("Error: " ~ e.toString()); + derr.writeLine("Error: " ~ e.toString()); if (e.next) error(e.next); } Index: val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/luminous.d =================================================================== --- val-and-rick-0.1a.dfsg1.orig/src/abagames/util/sdl/luminous.d 2007-09-07 00:17:49.000000000 +0200 +++ val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/luminous.d 2007-09-07 00:17:54.000000000 +0200 @@ -7,6 +7,7 @@ private import std.math; private import std.string; +private import std.c.string; private import opengl; private import abagames.util.actor; Index: val-and-rick-0.1a.dfsg1/src/abagames/vr/barrage.d =================================================================== --- val-and-rick-0.1a.dfsg1.orig/src/abagames/vr/barrage.d 2007-09-07 00:22:29.000000000 +0200 +++ val-and-rick-0.1a.dfsg1/src/abagames/vr/barrage.d 2007-09-07 00:24:50.000000000 +0200 @@ -30,6 +30,7 @@ char[][] dirs = listdir(BARRAGE_DIR_NAME); foreach (char[] dirName; dirs) { char[][] files = listdir(BARRAGE_DIR_NAME ~ "/" ~ dirName); + parser[dirName] = null; foreach (char[] fileName; files) { if (getExt(fileName) != "xml") continue; Index: val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/texture.d =================================================================== --- val-and-rick-0.1a.dfsg1.orig/src/abagames/util/sdl/texture.d 2007-09-07 00:25:03.000000000 +0200 +++ val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/texture.d 2007-09-07 00:26:42.000000000 +0200 @@ -25,7 +25,7 @@ Uint32[128 * 128] maskPixels; public static SDL_Surface* loadBmp(char[] name) { - if (surface[name]) { + if ((name in surface) != null) { return surface[name]; } else { char[] fileName = imagesDir ~ name; debian/val-and-rick.desktop0000644000000000000000000000025412164051121013023 0ustar [Desktop Entry] Type=Application Name=Val & Rick GenericName= Comment=Kenta Cho's Val & Rick Icon=val-and-rick Exec=val-and-rick Terminal=false Categories=Game;ArcadeGame; debian/val-and-rick.xpm0000644000000000000000000000233112164051121012154 0ustar /* XPM */ static char *dummy[]={ "32 32 3 1", ". c None", "# c #000000", "a c #0c74ec", "...#####................#####...", ".#######................#######.", ".####.........aaaa.........####.", "###...........aaaa...........###", "###..........................###", "##............................##", "##............aaaa............##", "##............aaaa............##", "................................", "................................", "..............aaaa..............", "..............aaaa..............", "................................", "................................", "..aa..aa..aa........aa..aa..aa..", "..aa..aa..aa........aa..aa..aa..", "..aa..aa..aa........aa..aa..aa..", "..aa..aa..aa........aa..aa..aa..", "................................", "................................", "..............aaaa..............", "..............aaaa..............", "................................", "................................", "##............aaaa............##", "##............aaaa............##", "##............................##", "###..........................###", "###...........aaaa...........###", ".####.........aaaa.........####.", ".#######................#######.", "...#####................#####..."};