debian/0000755000000000000000000000000012164135446007174 5ustar debian/source/0000755000000000000000000000000012164135446010474 5ustar debian/source/format0000644000000000000000000000001412164135446011702 0ustar 3.0 (quilt) debian/docs0000644000000000000000000000003012164135446010040 0ustar readme_e.txt readme.txt debian/mu-cade.manpages0000644000000000000000000000002112164135446012215 0ustar debian/mu-cade.6 debian/mu-cade-data.install0000644000000000000000000000014112164135446013002 0ustar images usr/share/games/mu-cade/ sounds usr/share/games/mu-cade/ barrage usr/share/games/mu-cade/ debian/mu-cade.xpm0000644000000000000000000001164112164135446011240 0ustar /* XPM */ static char *dummy[]={ "32 32 175 2", "Qt c #000000", "#f c #010000", ".r c #020101", ".e c #030101", ".P c #050202", "#4 c #060303", ".f c #080404", "#6 c #090404", ".y c #0a0505", ".I c #0b0505", ".# c #0c0606", ".S c #0e0707", ".b c #100808", ".B c #110808", ".m c #130909", "#Q c #160b0b", ".9 c #170b0b", ".C c #180c0c", "#2 c #1e0f0f", ".M c #221111", "#A c #261313", ".T c #2a1515", "#b c #2c1616", "#X c #2e1717", ".j c #301818", ".F c #321919", ".c c #341a1a", ".2 c #381c1c", "#C c #3e1f1f", "#x c #422121", "#D c #462323", "#T c #4a2525", ".1 c #4b2525", "#3 c #522929", "#Y c #542a2a", "#5 c #562b2b", "#s c #582c2c", ".d c #592c2c", ".n c #5a2d2d", ".x c #5c2e2e", ".a c #603030", "#H c #613030", "a. c #623131", "#z c #643232", ".5 c #683434", "#u c #6e3737", "#. c #743a3a", "an c #770000", "#t c #7c3e3e", ".W c #7d3e3e", "aS c #800808", "av c #804040", "aK c #807878", "aC c #808080", ".G c #864343", ".Z c #8e4747", "am c #8f0000", "#P c #904747", "#g c #984c4c", "aR c #990909", "au c #994d4d", "aJ c #999090", "aB c #999999", ".J c #9c4e4e", "#r c #9e4f4f", "#o c #a25151", "#I c #a45252", "al c #a60000", ".q c #a85454", "#e c #ac5656", ".Y c #b05858", "aQ c #b10a0a", "at c #b15959", "aI c #b1a7a7", "aA c #b1b1b1", "#7 c #b45a5a", ".i c #b85c5c", "ak c #bc0000", "#l c #bc5e5e", ".s c #c26161", "aP c #c80c0c", "as c #c86464", "aH c #c8bcbc", "az c #c8c8c8", "aj c #d00000", "#W c #d06868", ".g c #d46a6a", "aO c #de0d0d", ".O c #de6e6e", "ar c #de6f6f", "aG c #ded1d1", "ay c #dedede", "#G c #e27171", "a# c #e30000", "aa c #e90000", "#q c #f07878", "aL c #f10e0e", "ao c #f17979", "aD c #f1e3e3", "aw c #f1f1f1", "ai c #f20000", ".6 c #f27979", "ab c #f60000", "aM c #f70f0f", "ap c #f77c7c", "aE c #f7e8e8", "ax c #f7f7f7", "ag c #f80000", "af c #fa0000", "ae c #fc0000", "ah c #fd0000", "ac c #fe0000", "ad c #ff0000", "aN c #ff0f0f", "aq c #ff8080", ".R c #ff8181", "#F c #ff8282", ".v c #ff8383", "#v c #ff8484", "#i c #ff8585", "#9 c #ff8686", "#R c #ff9090", ".8 c #ff9292", "#U c #ff9393", "#N c #ff9696", ".Q c #ff9e9e", "#c c #ff9f9f", "#O c #ffa1a1", ".H c #ffa8a8", ".N c #ffa9a9", ".k c #ffaaaa", "#a c #ffadad", "#Z c #ffaeae", "#y c #ffafaf", "#S c #ffb0b0", "#j c #ffb3b3", ".L c #ffb5b5", "#1 c #ffb8b8", ".z c #ffc1c1", "#B c #ffc2c2", "#k c #ffc3c3", ".0 c #ffc4c4", ".A c #ffc8c8", "#V c #ffcaca", "#p c #ffcdcd", "#0 c #ffcece", "#L c #ffcfcf", ".4 c #ffd0d0", ".o c #ffd4d4", ".l c #ffdbdb", "#8 c #ffdcdc", ".E c #ffdddd", ".D c #ffdede", ".u c #ffe0e0", ".X c #ffe1e1", "#J c #ffe5e5", "#w c #ffe6e6", "#d c #ffe7e7", "#n c #ffeaea", "#M c #ffeeee", "aF c #fff0f0", ".V c #fff1f1", ".U c #fff2f2", ".h c #fff3f3", ".3 c #fff5f5", "#K c #fff6f6", "## c #fff7f7", ".t c #fff8f8", "#m c #fff9f9", ".w c #fffafa", "#h c #fffbfb", ".7 c #fffcfc", "#E c #fffdfd", ".K c #fffefe", ".p c #ffffff", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.#.a.bQtQtQtQtQtQt.c.d.eQt", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.f.g.h.iQtQtQtQtQt.j.k.l.mQt", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.n.o.p.qQtQtQtQt.r.s.t.u.mQt", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.v.p.w.xQtQtQtQt.y.z.p.A.BQt", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.C.D.p.E.FQtQtQtQt.G.t.p.H.IQt", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.J.K.p.L.MQtQtQtQt.N.p.p.O.PQt", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.Q.p.p.R.SQtQtQt.T.U.p.V.WQtQt", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.y.X.p.h.Y.rQtQtQt.Z.p.p.0.1QtQt", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.2.3.p.4.5QtQtQtQt.6.p.7.8.9QtQt", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt#.##.p#a#bQtQtQtQt#c.p#d#e#fQtQt", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt#g.t#h#iQtQtQtQtQt#j.p#k.jQtQtQt", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt#l#m#n#oQtQtQtQt.S#p.7#qQtQtQtQt", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt#r.t.E#sQtQtQtQt#t.X#m#uQtQtQtQt", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt#v.7#w.ZQtQtQt#x#y#h#m#zQtQtQtQt", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQt#A#B.p.7.N#C.##D.N#E#E.7#F#G#HQtQt", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQt#I#J#K#k.w#d#L.h#M#N#O.p.p.p#PQtQt", "QtQtQtQtQtQtQtQtQtQtQtQtQtQt#Q#R.7#S#T#U#V#L#y#W#X#Y#Z#0#1.dQtQt", "QtQtQtQtQtQtQtQtQtQtQtQtQtQt#Y#L.p.G.r#2#3#s.c#4QtQt.j#5#C#6QtQt", "QtQtQtQtQtQtQtQtQtQtQtQtQt.r#7#E#8#QQtQtQtQtQtQtQtQtQtQtQtQtQtQt", "QtQtQtQtQtQtQtQtQtQtQtQtQt.f.N.p#9.fQtQtQtQtQtQtQtQtQtQtQtQtQtQt", "QtQtQtQtQtQtQtQtQtQtQtQtQt.f#i#Ua..rQtQtQtQtQtQtQtQtQtQtQtQtQtQt", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", "a#a#a#a#a#aaabacadadadadadaeafagagafahadadadadadaeaia#ajakalaman", "aoaoaoaoaoapaqaqaqaqaqaqaqaqaqaqaqaqaqaqaqaqaqaqaqaqaoarasatauav", "awawawawawax.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.pawayazaAaBaC", "awawawawawax.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.pawayazaAaBaC", "aDaDaDaDaDaEaFaFaFaFaFaFaFaFaFaFaFaFaFaFaFaFaFaFaFaFaDaGaHaIaJaK", "aLaLaLaLaLaMaNaNaNaNaNaNaNaNaNaNaNaNaNaNaNaNaNaNaNaNaLaOaPaQaRaS", "a#a#a#a#a#aaabacadadadadadaeafagagafahadadadadadaeaia#ajakalaman"}; debian/mu-cade.install0000644000000000000000000000013412164135446012075 0ustar mu-cade usr/games/ debian/*.xpm usr/share/pixmaps/ debian/*.desktop usr/share/applications/ debian/copyright0000644000000000000000000000520612164135446011132 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/mcd_e.html Upstream Author: Kenta Cho Copyright: Copyright 2006 Kenta Cho import/SDL* : Copyright © 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 © 2007, Miriam Ruiz and is licensed under the GPL, see `/usr/share/common-licenses/GPL-3'. debian/README.source0000644000000000000000000000062012164135446011351 0ustar mu-cade ------- This package uses quilt to manage patches to the original sources. To get a fully patched version of the sources, please run debian/rules patch from the top directory. For more detailed information about managing patches with quilt, please take a look at the /usr/share/doc/quilt/README.source file. -- Vincent Fourmond , Thu, 26 Mar 2009 23:43:18 +0100 debian/menu0000644000000000000000000000021712164135446010063 0ustar ?package(mu-cade):needs="X11" section="Games/Action"\ title="Mu-cade" command="/usr/games/mu-cade" \ icon="/usr/share/pixmaps/mu-cade.xpm" debian/changelog0000644000000000000000000000524312164135446011052 0ustar mu-cade (0.11.dfsg1-8) unstable; urgency=low * Added build-depends on libphobos-dev -- Peter De Wachter Sun, 30 Jun 2013 13:09:08 +0200 mu-cade (0.11.dfsg1-7) unstable; urgency=low * Ported to D language version 2 (closes: #707266) * Switch dh-style minimal rules file * Mark -data package as Multi-Arch: foreign * Conforms to standards 3.9.4 -- Peter De Wachter Mon, 20 May 2013 18:57:31 +0200 mu-cade (0.11.dfsg1-6) unstable; urgency=medium * Explicitly build with D version 1 (closes: #653086) * Switch to source format 3.0 and drop quilt build-dep * Provide soon-to-be-required build-arch and build-indep debian/rules targets * Bump to 3.9.2 -- Vincent Fourmond Sat, 07 Jan 2012 10:14:24 +0100 mu-cade (0.11.dfsg1-5) unstable; urgency=low [ Miriam Ruiz ] * Fixed description in man page. Closes: #541950 [ Peter De Wachter ] * Patched for changes in the D language. (Closes: #574325) -- Peter De Wachter Wed, 17 Mar 2010 23:48:39 +0100 mu-cade (0.11.dfsg1-4) unstable; urgency=low * Worked around gdc struct layout problems on i386. (Closes: #521618) * Don't leave link order to chance (see #521387). -- Peter De Wachter Sun, 29 Mar 2009 18:44:29 +0200 mu-cade (0.11.dfsg1-3) unstable; urgency=low [ Miriam Ruiz ] * Removed Homepage from long description. * Replaced XS-DM-Upload-Allowed by DM-Upload-Allowed in debian/control. [ Ansgar Burchardt ] * Remove deprecated Encoding key from .desktop file [ Peter De Wachter ] * Patched to work with ode 2:0.10.1-1. (UNTESTED!) * Fixed Makefile clean target. [ Vincent Fourmond ] * Adding myself to the Uploaders * Checked that it builds and runs fine with libode-dev (closes: #520731) * Added a debian/README.source file to mention the use of quilt as a patch management system. Now conforms to Standards 3.8.1 -- Vincent Fourmond Thu, 26 Mar 2009 23:43:27 +0100 mu-cade (0.11.dfsg1-2) unstable; urgency=low [ Barry deFreese ] * Add watch file * Add myself to uploaders * Remove XS- from VCS fields in control * Add Homepage: field in control [ Peter De Wachter ] * Implement -fullscreen option (Closes: #449449) * Fixed link command, patch from Arthur Loiret. (Closes: #458282, #458638) [ 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 mu-cade (0.11.dfsg1-1) unstable; urgency=low * Initial release (Closes: #439685) -- Miriam Ruiz Sat, 25 Aug 2007 19:58:40 +0000 debian/compat0000644000000000000000000000000212164135446010372 0ustar 9 debian/mu-cade.desktop0000644000000000000000000000023412164135446012101 0ustar [Desktop Entry] Type=Application Name=Mu-cade GenericName= Comment=Kenta Cho's Mu-cade Icon=mu-cade Exec=mu-cade Terminal=false Categories=Game;ArcadeGame; debian/mu-cade.60000644000000000000000000000674412164135446010611 0ustar .\" (c) 2007 Miriam Ruiz .\" (c) 2006 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 "Mu-cade" "6" "" "" "" .SH "NAME" mu\-cade \- chase action game .SH "DESCRIPTION" The Physics Centipede Invasion Smashup waggly shmup, 'Mu\-cade' Mu\-cade is another shoot\-em\-up game by Kenta Cho. In this game Kenta has introduced physics into his formula of hardcore shooting games. Similar in some ways to Asteroids and Nibbles, the playing area is a rectangular arena in which vessel\-snakes have only one idea at the head: expelling the others into the vacuum. You incarnate one of them, and you'll quickly realize the subtlety of the goal: your tail lengthens as you destroy your enemies. .SH "OPTIONS" These command\-line options are available: .TP \fB\-brightness n\fR Set the brightness of the screen. (n = 0 \- 100, default = 100) .TP \fB\-res x y\fR Set the screen resolution to (x, y). (default = 640, 480) .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 mode. .TP \fB\-exchange\fR Exchange a shot key and a cut off key. .TP \fB\-rotatestick2 n\fR Rotate the direction of the stick2 in n degrees. .TP \fB\-reversestick2\fR Reverse the direction of the stick2. .TP \fB\-disablestick2\fR Disable the input of the stick2. .TP \fB\-enableaxis5\fR Use the input of axis 5 to fire shots and axis 3 to cut off the tail. (for Xbox 360 wired controller) .SH "USAGE" Keep your ship from falling down and push enemies out of the way. Controls: .TP \fBMove Arrow / Num / [WASD] / Stick1 (Axis 1, 2)\fR .TP \fBFire shots / Hold direction\fR [Z][L\-Ctrl][R\-Ctrl][.] / Trigger 1, 3, 5, 7, 9, 11 [IJKL] / Stick2 (Axis 3 or 5, 4) Hold a key to open automatic fire and hold the direction of a ship. Tap a key to take a turn while firing. You can also fire shots with the second stick. (If you have a problem with the direction of the stick2, try '\-rotatestick2' and '\-reversestick2' options. e.g. '\-rotatestick2 \-90 \-reversestick2') (If you are using Xbox 360 wired controller, use '\-enableaxis5' option.) .TP \fBCut off the tail [X][L\-Alt][R\-Alt][L\-Shift][R\-Shift] [/][Return][Space] / Trigger 2, 4, 6, 8, 10, 12 Cut off the tail of your ship. This action also wipes out all bullets and you obtain powerful shots for a while. .TP \fBPause\fR [P] .TP \fBExit / Return to the title\fR [ESC] .P Tail multiplier: The tail of your ship becomes longer when you push an enemy out and you get a score multiplier. Extra ship: You earn an extra ship 50,000 and every 200,000 points. .SH "SEE ALSO" You can find more about the game on its homepage: Homepage: http://www.asahi\-net.or.jp/~cs8k\-cyu/windows/mcd_e.html .SH "AUTHOR" Mu\-cade has been written by Kenta Cho debian/watch0000644000000000000000000000023512164135446010225 0ustar version=3 opts="uversionmangle=s/_/\./,dversionmangle=s/[+.]dfsg(.?\d+)?$//" \ http://www.asahi-net.or.jp/~cs8k-cyu/windows/mcd_e.html mcd([\d]_[\d]+)\.zip debian/rules0000755000000000000000000000071612164135446010260 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/mcd0_11.zip unzip mcd0_11.zip rm mcd/*.dll rm mcd/*.exe rm mcd/lib/*.lib rm mcd/resource/*.RES tar cvfz ../mu-cade_0.11.dfsg1.orig.tar.gz mcd rm -rf mcd0_11.zip mcd debian/control0000644000000000000000000000405212164135446010600 0ustar Source: mu-cade Section: games Priority: extra Maintainer: Debian Games Team Uploaders: Miriam Ruiz , Peter De Wachter , Barry deFreese , Vincent Fourmond 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, libode-dev Build-Conflicts: libphobos-4.4-dev Standards-Version: 3.9.4 Homepage: http://www.asahi-net.or.jp/~cs8k-cyu/windows/mcd_e.html Vcs-Svn: svn://anonscm.debian.org/pkg-games/packages/trunk/mu-cade/ Vcs-Browser: http://anonscm.debian.org/viewvc/pkg-games/packages/trunk/mu-cade/ Package: mu-cade Architecture: any Depends: mu-cade-data (= ${source:Version}), ${shlibs:Depends}, ${misc:Depends} Description: physics centipede invasion, smashup waggly shmup Mu-cade is another shoot-em-up game by Kenta Cho. In this game Kenta has introduced physics into his formula of hardcore shooting games. Similar in some ways to Asteroids and Nibbles, the playing area is a rectangular arena in which vessel-snakes have only one idea at the head: expelling the others into the vacuum. You incarnate one of them, and you'll quickly realize the subtlety of the goal: your tail lengthens as you destroy your enemies. Package: mu-cade-data Architecture: all Multi-Arch: foreign Depends: ${shlibs:Depends}, ${misc:Depends} Recommends: mu-cade Description: physics centipede invasion - game data Mu-cade is another shoot-em-up game by Kenta Cho. In this game Kenta has introduced physics into his formula of hardcore shooting games. Similar in some ways to Asteroids and Nibbles, the playing area is a rectangular arena in which vessel-snakes have only one idea at the head: expelling the others into the vacuum. You incarnate one of them, and you'll quickly realize the subtlety of the goal: your tail lengthens as you destroy your enemies. . This package includes the architecture-independent data for the game Mu-cade. debian/patches/0000755000000000000000000000000012164135446010623 5ustar debian/patches/series0000644000000000000000000000025712164135446012044 0ustar imports.patch imports_ode.patch fixes.patch directories.patch windowed.patch dotfile.patch window-resize.patch makefile.patch fullscreen-option.patch ode.patch dlang_v2.patch debian/patches/fullscreen-option.patch0000644000000000000000000000134412164135446015316 0ustar # Copyright (C) 2007 Peter De Wachter # Distributed under the same license as the game. See debian/copyright. Add a "-fullscreen" command line option. Needed because we changed the default to windowed. Index: mu-cade-0.11.dfsg1/src/abagames/mcd/boot.d =================================================================== --- mu-cade-0.11.dfsg1.orig/src/abagames/mcd/boot.d 2007-11-27 00:04:03.000000000 +0100 +++ mu-cade-0.11.dfsg1/src/abagames/mcd/boot.d 2007-11-27 00:04:22.000000000 +0100 @@ -104,6 +104,9 @@ } Screen.brightness = b; break; + case "-fullscreen": + screen.windowMode = false; + break; case "-window": screen.windowMode = true; break; debian/patches/dotfile.patch0000644000000000000000000000537212164135446013301 0ustar # Copyright (C) 2007 Peter De Wachter # Distributed under the same license as the game. See debian/copyright. Index: mu-cade_0.11.dfsg1/src/abagames/mcd/prefmanager.d =================================================================== --- mu-cade_0.11.dfsg1.orig/src/abagames/mcd/prefmanager.d 2007-08-26 23:02:41.000000000 +0200 +++ mu-cade_0.11.dfsg1/src/abagames/mcd/prefmanager.d 2007-08-26 23:11:26.000000000 +0200 @@ -6,6 +6,9 @@ module abagames.mcd.prefmanager; private import std.stream; +private import std.string; +private import std.file; +private import std.c.stdlib; private import abagames.util.prefmanager; /** @@ -21,11 +24,23 @@ _prefData = new PrefData; } + public static char[] pref_dir() { + char * home = getenv("HOME"); + if (home is null) + throw new Error("HOME environment variable undefined"); + char[] dir = std.string.toString(home) ~ "/.mu-cade"; + try { + mkdir(dir); + } catch (FileException e) { + } + return dir; + } + public void load() { auto File fd = new File; try { int ver; - fd.open(PREF_FILE_NAME); + fd.open(pref_dir() ~ "/" ~ PREF_FILE_NAME); fd.read(ver); if (ver != VERSION_NUM) throw new Error("Wrong version num"); @@ -41,7 +56,7 @@ public void save() { auto File fd = new File; - fd.create(PREF_FILE_NAME); + fd.create(pref_dir ~ "/" ~ PREF_FILE_NAME); fd.write(VERSION_NUM); _prefData.save(fd); fd.close(); Index: mu-cade_0.11.dfsg1/src/abagames/mcd/replay.d =================================================================== --- mu-cade_0.11.dfsg1.orig/src/abagames/mcd/replay.d 2007-08-26 23:02:41.000000000 +0200 +++ mu-cade_0.11.dfsg1/src/abagames/mcd/replay.d 2007-08-26 23:02:46.000000000 +0200 @@ -9,13 +9,13 @@ private import abagames.util.sdl.recordableinput; private import abagames.util.sdl.twinstickpad; private import abagames.mcd.gamemanager; +private import abagames.mcd.prefmanager; /** * Save/Load a replay data. */ public class ReplayData { public: - static const char[] dir = "replay"; static const int VERSION_NUM = 10; InputRecord!(TwinStickPadState) twinStickPadInputRecord; long seed; @@ -25,7 +25,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); fd.write(score); @@ -36,7 +36,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/windowed.patch0000644000000000000000000000124312164135446013464 0ustar # Copyright (C) 2007 Miriam Ruiz # Distributed under the same license as the game. See debian/copyright. Index: mu-cade-0.11.dfsg1/src/abagames/util/sdl/screen3d.d =================================================================== --- mu-cade-0.11.dfsg1.orig/src/abagames/util/sdl/screen3d.d 2007-08-26 18:26:00.000000000 +0000 +++ mu-cade-0.11.dfsg1/src/abagames/util/sdl/screen3d.d 2007-08-26 18:26:49.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(); debian/patches/makefile.patch0000644000000000000000000000100512164135446013415 0ustar # Copyright (C) 2007 Marcel Unbehaun # Copyright (C) 2007 Miriam Ruiz # Distributed under the same license as the game. See debian/copyright. --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +GDC=gdc +DSRC=$(shell find import src/abagames -name "*.d" | sort) +EXE=mu-cade + +all: $(EXE) + +$(EXE): $(DSRC) + $(GDC) -o $@ -Iimport -Isrc -Wno-deprecated $(DFLAGS) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(DSRC) -lSDL -lGL -lGLU -lSDL_mixer -lode -lbulletml + +clean: + rm -f $(EXE) debian/patches/window-resize.patch0000644000000000000000000000517012164135446014455 0ustar # Copyright (C) 2007 Miriam Ruiz # Distributed under the same license as the game. See debian/copyright. Index: mu-cade_0.11.dfsg1/src/abagames/util/sdl/screen3d.d =================================================================== --- mu-cade_0.11.dfsg1.orig/src/abagames/util/sdl/screen3d.d 2007-08-29 00:07:03.000000000 +0200 +++ mu-cade_0.11.dfsg1/src/abagames/util/sdl/screen3d.d 2007-08-29 00:07:10.000000000 +0200 @@ -23,6 +23,7 @@ int _width = 640; int _height = 480; bool _windowMode = true; + Uint32 _videoFlags = 0; 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,7 +53,20 @@ // Reset a viewport when the screen is resized. public void screenResized() { - glViewport(0, 0, _width, _height); + int screen_width = _width; + int screen_height = _height; + if (SDL_SetVideoMode(screen_width, screen_height, 0, _videoFlags) == null) { + throw new SDLInitFailedException + ("Unable to resize SDL screen: " ~ std.string.toString(SDL_GetError())); + } + + // adjust width and height to maintain correct aspect ratio + if (screen_width * 480 > screen_height * 640) + _width = screen_height * 640 / 480; + else if (screen_width * 480 < screen_height * 640) + _height = screen_width * 480 / 640; + + glViewport((screen_width - _width) / 2, screen_height - _height, _width, _height); glMatrixMode(GL_PROJECTION); setPerspective(); glMatrixMode(GL_MODELVIEW); Index: mu-cade_0.11.dfsg1/src/abagames/mcd/screen.d =================================================================== --- mu-cade_0.11.dfsg1.orig/src/abagames/mcd/screen.d 2006-02-19 05:57:26.000000000 +0100 +++ mu-cade_0.11.dfsg1/src/abagames/mcd/screen.d 2007-08-29 00:07:10.000000000 +0200 @@ -62,7 +62,6 @@ else if (lw > 4) lw = 4; glLineWidth(lw); - glViewport(0, 0, width, height); if (field) field.setLookAt(); } debian/patches/imports_ode.patch0000644000000000000000000006002312164135446014171 0ustar Description: port import/ode/ code to D language version 2 With this patch the code is accapted by GDC 4.8 without triggering deprecation warnings/errors. It also attempts to make mu-cade compatible with Debian's libode 2:0.10.1-1. Author: Peter De Wachter , # Copyright (C) 2007 Marcel Unbehaun # Distributed under the same license as the game. See debian/copyright. # Copyright (C) 2009 Peter De Wachter # Distributed under the same license as the game. See debian/copyright. --- a/import/ode/collision.d +++ b/import/ode/collision.d @@ -38,12 +38,12 @@ void dGeomSetBody (dGeomID, dBodyID); dBodyID dGeomGetBody (dGeomID); void dGeomSetPosition (dGeomID, dReal x, dReal y, dReal z); -void dGeomSetRotation (dGeomID, dMatrix3 R); -void dGeomSetQuaternion (dGeomID, dQuaternion); +void dGeomSetRotation (dGeomID, ref dMatrix3 R); +void dGeomSetQuaternion (dGeomID, ref dQuaternion); dReal * dGeomGetPosition (dGeomID); dReal * dGeomGetRotation (dGeomID); -void dGeomGetQuaternion (dGeomID, dQuaternion result); -void dGeomGetAABB (dGeomID, dReal aabb[6]); +void dGeomGetQuaternion (dGeomID, ref dQuaternion result); +void dGeomGetAABB (dGeomID, ref dReal aabb[6]); int dGeomIsSpace (dGeomID); dSpaceID dGeomGetSpace (dGeomID); int dGeomGetClass (dGeomID); @@ -61,11 +61,11 @@ int dCollide (dGeomID o1, dGeomID o2, int flags, dContactGeom *contact, int skip); //void dSpaceCollide (dSpaceID space, void *data, dNearCallback *callback); -void dSpaceCollide (dSpaceID space, void *data, void (*fp) (void *data, dGeomID o1, dGeomID o2)); +void dSpaceCollide (dSpaceID space, void *data, void function(void *data, dGeomID o1, dGeomID o2) fp); //void dSpaceCollide2 (dGeomID o1, dGeomID o2, void *data, // dNearCallback *callback); void dSpaceCollide2 (dGeomID o1, dGeomID o2, void *data, - void (*fp) (void *data, dGeomID o1, dGeomID o2)); + void function(void *data, dGeomID o1, dGeomID o2) fp); /* ************************************************************************ */ /* standard classes */ @@ -79,16 +79,19 @@ enum { dSphereClass = 0, dBoxClass, - dCCylinderClass, + dCapsuleClass, dCylinderClass, dPlaneClass, dRayClass, + dConvexClass, dGeomTransformClass, dTriMeshClass, + dHeightfieldClass, dFirstSpaceClass, dSimpleSpaceClass = dFirstSpaceClass, dHashSpaceClass, + dSweepAndPruneSpaceClass, dQuadTreeSpaceClass, dLastSpaceClass = dQuadTreeSpaceClass, @@ -105,12 +108,12 @@ dGeomID dCreateBox (dSpaceID space, dReal lx, dReal ly, dReal lz); void dGeomBoxSetLengths (dGeomID box, dReal lx, dReal ly, dReal lz); -void dGeomBoxGetLengths (dGeomID box, dVector3 result); +void dGeomBoxGetLengths (dGeomID box, ref dVector3 result); dReal dGeomBoxPointDepth (dGeomID box, dReal x, dReal y, dReal z); dGeomID dCreatePlane (dSpaceID space, dReal a, dReal b, dReal c, dReal d); void dGeomPlaneSetParams (dGeomID plane, dReal a, dReal b, dReal c, dReal d); -void dGeomPlaneGetParams (dGeomID plane, dVector4 result); +void dGeomPlaneGetParams (dGeomID plane, ref dVector4 result); dReal dGeomPlanePointDepth (dGeomID plane, dReal x, dReal y, dReal z); dGeomID dCreateCCylinder (dSpaceID space, dReal radius, dReal length); @@ -123,7 +126,7 @@ dReal dGeomRayGetLength (dGeomID ray); void dGeomRaySet (dGeomID ray, dReal px, dReal py, dReal pz, dReal dx, dReal dy, dReal dz); -void dGeomRayGet (dGeomID ray, dVector3 start, dVector3 dir); +void dGeomRayGet (dGeomID ray, ref dVector3 start, ref dVector3 dir); /* * Set/get ray flags that influence ray collision detection. @@ -146,33 +149,33 @@ /* ************************************************************************ */ /* utility functions */ -void dClosestLineSegmentPoints (dVector3 a1, dVector3 a2, - dVector3 b1, dVector3 b2, - dVector3 cp1, dVector3 cp2); - -int dBoxTouchesBox (dVector3 _p1, dMatrix3 R1, - dVector3 side1, dVector3 _p2, - dMatrix3 R2, dVector3 side2); +void dClosestLineSegmentPoints (ref dVector3 a1, ref dVector3 a2, + ref dVector3 b1, ref dVector3 b2, + ref dVector3 cp1, ref dVector3 cp2); + +int dBoxTouchesBox (ref dVector3 _p1, ref dMatrix3 R1, + ref dVector3 side1, ref dVector3 _p2, + ref dMatrix3 R2, ref dVector3 side2); -void dInfiniteAABB (dGeomID geom, dReal aabb[6]); +void dInfiniteAABB (dGeomID geom, ref dReal aabb[6]); +void dInitODE(); void dCloseODE(); /* ************************************************************************ */ /* custom classes */ -typedef void dGetAABBFn (dGeomID, dReal aabb[6]); -typedef int dColliderFn (dGeomID o1, dGeomID o2, - int flags, dContactGeom *contact, int skip); -typedef dColliderFn * dGetColliderFnFn (int num); -typedef void dGeomDtorFn (dGeomID o); -typedef int dAABBTestFn (dGeomID o1, dGeomID o2, dReal aabb[6]); +alias void function(dGeomID, ref dReal aabb[6]) dGetAABBFn; +alias int function(dGeomID o1, dGeomID o2, int flags, dContactGeom *contact, int skip) dColliderFn; +alias dColliderFn function(int num) dGetColliderFnFn; +alias void function(dGeomID o) dGeomDtorFn; +alias int function(dGeomID o1, dGeomID o2, ref dReal aabb[6]) dAABBTestFn; struct dGeomClass { int bytes; - dGetColliderFnFn *collider; - dGetAABBFn *aabb; - dAABBTestFn *aabb_test; - dGeomDtorFn *dtor; + dGetColliderFnFn collider; + dGetAABBFn aabb; + dAABBTestFn aabb_test; + dGeomDtorFn dtor; }; int dCreateGeomClass (dGeomClass *classptr); --- a/import/ode/collision_space.d +++ b/import/ode/collision_space.d @@ -32,7 +32,7 @@ dSpaceID dSimpleSpaceCreate (dSpaceID space); dSpaceID dHashSpaceCreate (dSpaceID space); -dSpaceID dQuadTreeSpaceCreate (dSpaceID space, dVector3 Center, dVector3 Extents, int Depth); +dSpaceID dQuadTreeSpaceCreate (dSpaceID space, ref dVector3 Center, ref dVector3 Extents, int Depth); void dSpaceDestroy (dSpaceID); --- a/import/ode/collision_trimesh.d +++ b/import/ode/collision_trimesh.d @@ -91,7 +91,7 @@ * Per triangle callback. Allows the user to say if he wants a collision with * a particular triangle. */ -typedef int dTriCallback(dGeomID TriMesh, dGeomID RefObject, int TriangleIndex); +alias int dTriCallback(dGeomID TriMesh, dGeomID RefObject, int TriangleIndex); void dGeomTriMeshSetCallback(dGeomID g, dTriCallback* Callback); dTriCallback* dGeomTriMeshGetCallback(dGeomID g); @@ -99,7 +99,7 @@ * Per object callback. Allows the user to get the list of triangles in 1 * shot. Maybe we should remove this one. */ -typedef void dTriArrayCallback(dGeomID TriMesh, dGeomID RefObject, int* TriIndices, int TriCount); +alias void dTriArrayCallback(dGeomID TriMesh, dGeomID RefObject, int* TriIndices, int TriCount); void dGeomTriMeshSetArrayCallback(dGeomID g, dTriArrayCallback* ArrayCallback); dTriArrayCallback* dGeomTriMeshGetArrayCallback(dGeomID g); @@ -109,7 +109,7 @@ * coords. The user can for example sample a texture with alpha transparency * to determine if a collision should occur. */ -typedef int dTriRayCallback(dGeomID TriMesh, dGeomID Ray, int TriangleIndex, dReal u, dReal v); +alias int dTriRayCallback(dGeomID TriMesh, dGeomID Ray, int TriangleIndex, dReal u, dReal v); void dGeomTriMeshSetRayCallback(dGeomID g, dTriRayCallback* Callback); dTriRayCallback* dGeomTriMeshGetRayCallback(dGeomID g); @@ -148,7 +148,7 @@ * Gets the point on the requested triangle and the given barycentric * coordinates. */ -void dGeomTriMeshGetPoint(dGeomID g, int Index, dReal u, dReal v, dVector3 Out); +void dGeomTriMeshGetPoint(dGeomID g, int Index, dReal u, dReal v, ref dVector3 Out); /* --- a/import/ode/common.d +++ b/import/ode/common.d @@ -62,8 +62,8 @@ */ int dIASSERT(int a) { return 0; } -int dUASSERT(int a, char* msg) { return 0; } -int dDEBUGMSG(char* msg) { return 0; } +int dUASSERT(int a, const(char)* msg) { return 0; } +int dDEBUGMSG(const(char)* msg) { return 0; } int dAASSERT(int a) { return 0; } /* floating point data type, vector, matrix and quaternion types */ @@ -103,7 +103,7 @@ /* round something up to be a multiple of the EFFICIENT_ALIGNMENT */ -int dEFFICIENT_SIZE(int x) { return (((x-1)|(EFFICIENT_ALIGNMENT-1))+1); } +size_t dEFFICIENT_SIZE(size_t x) { return (((x-1)|(EFFICIENT_ALIGNMENT-1))+1); } /* alloca aligned to the EFFICIENT_ALIGNMENT. note that this can waste @@ -116,13 +116,13 @@ /* internal object types (all prefixed with `dx') */ -struct dxWorld; /* dynamics world */ -struct dxSpace; /* collision space */ -struct dxBody; /* rigid body (dynamics object) */ -struct dxGeom; /* geometry (collision object) */ -struct dxJoint; -struct dxJointNode; -struct dxJointGroup; +struct dxWorld { }; /* dynamics world */ +struct dxSpace { }; /* collision space */ +struct dxBody { }; /* rigid body (dynamics object) */ +struct dxGeom { }; +struct dxJoint { }; +struct dxJointNode { }; +struct dxJointGroup { }; alias dxWorld *dWorldID; alias dxSpace *dSpaceID; @@ -255,6 +255,7 @@ dParamSuspensionCFM, #define D_ALL_PARAM_NAMES_X(start,x) \ + dParamGroup ## x = start, \ /* parameters for limits and motors */ \ dParamLoStop ## x = start, \ dParamHiStop ## x, \ @@ -271,6 +272,8 @@ enum { D_ALL_PARAM_NAMES(0) + dParamsInGroup, + D_ALL_PARAM_NAMES_X(0x000,1) D_ALL_PARAM_NAMES_X(0x100,2) D_ALL_PARAM_NAMES_X(0x200,3) --- a/import/ode/contact.d +++ b/import/ode/contact.d @@ -33,8 +33,9 @@ dContactSoftCFM = 0x010, dContactMotion1 = 0x020, dContactMotion2 = 0x040, - dContactSlip1 = 0x080, - dContactSlip2 = 0x100, + dContactMotionN = 0x080, + dContactSlip1 = 0x100, + dContactSlip2 = 0x200, dContactApprox0 = 0x0000, dContactApprox1_1 = 0x1000, @@ -42,37 +43,77 @@ dContactApprox1 = 0x3000 }; - -struct dSurfaceParameters { - /* must always be defined */ - int mode; - dReal mu; - - /* only defined if the corresponding flag is set in mode */ - dReal mu2; - dReal bounce; - dReal bounce_vel; - dReal soft_erp; - dReal soft_cfm; - dReal motion1,motion2; - dReal slip1,slip2; -}; - +version(X86) { + // gdc is supposed to use the same struct layout as gcc, but it + // doesn't do that for this struct on i386. (It seems to think + // doubles need an 8 byte alignment.) So we introduce this hack. + align(1) + struct dSurfaceParameters { + /* must always be defined */ + int mode; + dReal mu; + + /* only defined if the corresponding flag is set in mode */ + dReal mu2; + dReal bounce; + dReal bounce_vel; + dReal soft_erp; + dReal soft_cfm; + dReal motion1,motion2,motionN; + dReal slip1,slip2; + }; +} else { + struct dSurfaceParameters { + /* must always be defined */ + int mode; + dReal mu; + + /* only defined if the corresponding flag is set in mode */ + dReal mu2; + dReal bounce; + dReal bounce_vel; + dReal soft_erp; + dReal soft_cfm; + dReal motion1,motion2,motionN; + dReal slip1,slip2; + }; +} /* contact info set by collision functions */ -struct dContactGeom { - dVector3 pos; - dVector3 normal; - dReal depth; - dGeomID g1,g2; -}; +version(X86) { + align(1) + struct dContactGeom { + dVector3 pos; + dVector3 normal; + dReal depth; + dGeomID g1,g2; + int side1,side2; + }; +} else { + struct dContactGeom { + dVector3 pos; + dVector3 normal; + dReal depth; + dGeomID g1,g2; + int side1,side2; + }; +} /* contact info used by contact joint */ -struct dContact { - dSurfaceParameters surface; - dContactGeom geom; - dVector3 fdir1; -}; +version(X86) { + align(1) + struct dContact { + dSurfaceParameters surface; + dContactGeom geom; + dVector3 fdir1; + }; +} else { + struct dContact { + dSurfaceParameters surface; + dContactGeom geom; + dVector3 fdir1; + }; +} --- a/import/ode/error.d +++ b/import/ode/error.d @@ -31,7 +31,7 @@ /* all user defined error functions have this type. error and debug functions * should not return. */ -typedef void dMessageFunction (int errnum, char *msg, va_list ap); +alias void dMessageFunction (int errnum, const(char)* msg, va_list ap); /* set a new error, debug or warning handler. if fn is 0, the default handlers * are used. @@ -48,6 +48,6 @@ dMessageFunction *dGetMessageHandler(); /* generate a fatal error, debug trap or a message. */ -void dError (int num, char *msg, ...); -void dDebug (int num, char *msg, ...); -void dMessage (int num, char *msg, ...); +void dError (int num, const(char)* msg, ...); +void dDebug (int num, const(char)* msg, ...); +void dMessage (int num, const(char)* msg, ...); --- a/import/ode/export_dif.d +++ b/import/ode/export_dif.d @@ -26,4 +26,4 @@ extern(C): -void dWorldExportDIF (dWorldID w, FILE *file, char *world_name); +void dWorldExportDIF (dWorldID w, FILE *file, const(char)* world_name); --- a/import/ode/mass.d +++ b/import/ode/mass.d @@ -54,7 +54,7 @@ void dMassTranslate (dMass *, dReal x, dReal y, dReal z); -void dMassRotate (dMass *, dMatrix3 R); +void dMassRotate (dMass *, ref dMatrix3 R); void dMassAdd (dMass *a, dMass *b); @@ -62,6 +62,6 @@ struct dMass { dReal mass; - dVector4 c; + dVector3 c; dMatrix3 I; }; --- a/import/ode/memory.d +++ b/import/ode/memory.d @@ -28,15 +28,15 @@ extern(C): /* function types to allocate and free memory */ -typedef void * dAllocFunction (size_t size); -typedef void * dReallocFunction (void *ptr, size_t oldsize, size_t newsize); -typedef void dFreeFunction (void *ptr, size_t size); +alias void * function(size_t size) dAllocFunction; +alias void * function(void *ptr, size_t oldsize, size_t newsize) dReallocFunction; +alias void function(void *ptr, size_t size) dFreeFunction; /* set new memory management functions. if fn is 0, the default handlers are * used. */ -void dSetAllocHandler (dAllocFunction *fn); -void dSetReallocHandler (dReallocFunction *fn); -void dSetFreeHandler (dFreeFunction *fn); +void dSetAllocHandler (dAllocFunction fn); +void dSetReallocHandler (dReallocFunction fn); +void dSetFreeHandler (dFreeFunction fn); /* get current memory management functions */ dAllocFunction *dGetAllocHandler (); --- a/import/ode/misc.d +++ b/import/ode/misc.d @@ -49,7 +49,7 @@ dReal dRandReal(); /* print out a matrix */ -void dPrintMatrix (dReal *A, int n, int m, char *fmt, FILE *f); +void dPrintMatrix (dReal *A, int n, int m, const(char)* fmt, FILE *f); /* make a random vector with entries between +/- range. A has n elements. */ void dMakeRandomVector (dReal *A, int n, dReal range); --- a/import/ode/objects.d +++ b/import/ode/objects.d @@ -33,14 +33,14 @@ void dWorldDestroy (dWorldID); void dWorldSetGravity (dWorldID, dReal x, dReal y, dReal z); -void dWorldGetGravity (dWorldID, dVector3 gravity); +void dWorldGetGravity (dWorldID, ref dVector3 gravity); void dWorldSetERP (dWorldID, dReal erp); dReal dWorldGetERP (dWorldID); void dWorldSetCFM (dWorldID, dReal cfm); dReal dWorldGetCFM (dWorldID); void dWorldStep (dWorldID, dReal stepsize); void dWorldImpulseToForce (dWorldID, dReal stepsize, - dReal ix, dReal iy, dReal iz, dVector3 force); + dReal ix, dReal iy, dReal iz, ref dVector3 force); /* World QuickStep functions */ @@ -97,8 +97,8 @@ void *dBodyGetData (dBodyID); void dBodySetPosition (dBodyID, dReal x, dReal y, dReal z); -void dBodySetRotation (dBodyID, dMatrix3 R); -void dBodySetQuaternion (dBodyID, dQuaternion q); +void dBodySetRotation (dBodyID, ref dMatrix3 R); +void dBodySetQuaternion (dBodyID, ref dQuaternion q); void dBodySetLinearVel (dBodyID, dReal x, dReal y, dReal z); void dBodySetAngularVel (dBodyID, dReal x, dReal y, dReal z); dReal * dBodyGetPosition (dBodyID); @@ -129,23 +129,23 @@ void dBodySetTorque (dBodyID b, dReal x, dReal y, dReal z); void dBodyGetRelPointPos (dBodyID, dReal px, dReal py, dReal pz, - dVector3 result); + ref dVector3 result); void dBodyGetRelPointVel (dBodyID, dReal px, dReal py, dReal pz, - dVector3 result); + ref dVector3 result); void dBodyGetPointVel (dBodyID, dReal px, dReal py, dReal pz, - dVector3 result); + ref dVector3 result); void dBodyGetPosRelPoint (dBodyID, dReal px, dReal py, dReal pz, - dVector3 result); + ref dVector3 result); void dBodyVectorToWorld (dBodyID, dReal px, dReal py, dReal pz, - dVector3 result); + ref dVector3 result); void dBodyVectorFromWorld (dBodyID, dReal px, dReal py, dReal pz, - dVector3 result); + ref dVector3 result); void dBodySetFiniteRotationMode (dBodyID, int mode); void dBodySetFiniteRotationAxis (dBodyID, dReal x, dReal y, dReal z); int dBodyGetFiniteRotationMode (dBodyID); -void dBodyGetFiniteRotationAxis (dBodyID, dVector3 result); +void dBodyGetFiniteRotationAxis (dBodyID, ref dVector3 result); int dBodyGetNumJoints (dBodyID b); dJointID dBodyGetJoint (dBodyID, int index); @@ -212,37 +212,37 @@ void dJointSetAMotorMode (dJointID, int mode); void dJointAddAMotorTorques (dJointID, dReal torque1, dReal torque2, dReal torque3); -void dJointGetBallAnchor (dJointID, dVector3 result); -void dJointGetBallAnchor2 (dJointID, dVector3 result); -void dJointGetHingeAnchor (dJointID, dVector3 result); -void dJointGetHingeAnchor2 (dJointID, dVector3 result); -void dJointGetHingeAxis (dJointID, dVector3 result); +void dJointGetBallAnchor (dJointID, ref dVector3 result); +void dJointGetBallAnchor2 (dJointID, ref dVector3 result); +void dJointGetHingeAnchor (dJointID, ref dVector3 result); +void dJointGetHingeAnchor2 (dJointID, ref dVector3 result); +void dJointGetHingeAxis (dJointID, ref dVector3 result); dReal dJointGetHingeParam (dJointID, int parameter); dReal dJointGetHingeAngle (dJointID); dReal dJointGetHingeAngleRate (dJointID); dReal dJointGetSliderPosition (dJointID); dReal dJointGetSliderPositionRate (dJointID); -void dJointGetSliderAxis (dJointID, dVector3 result); +void dJointGetSliderAxis (dJointID, ref dVector3 result); dReal dJointGetSliderParam (dJointID, int parameter); -void dJointGetHinge2Anchor (dJointID, dVector3 result); -void dJointGetHinge2Anchor2 (dJointID, dVector3 result); -void dJointGetHinge2Axis1 (dJointID, dVector3 result); -void dJointGetHinge2Axis2 (dJointID, dVector3 result); +void dJointGetHinge2Anchor (dJointID, ref dVector3 result); +void dJointGetHinge2Anchor2 (dJointID, ref dVector3 result); +void dJointGetHinge2Axis1 (dJointID, ref dVector3 result); +void dJointGetHinge2Axis2 (dJointID, ref dVector3 result); dReal dJointGetHinge2Param (dJointID, int parameter); dReal dJointGetHinge2Angle1 (dJointID); dReal dJointGetHinge2Angle1Rate (dJointID); dReal dJointGetHinge2Angle2Rate (dJointID); -void dJointGetUniversalAnchor (dJointID, dVector3 result); -void dJointGetUniversalAnchor2 (dJointID, dVector3 result); -void dJointGetUniversalAxis1 (dJointID, dVector3 result); -void dJointGetUniversalAxis2 (dJointID, dVector3 result); +void dJointGetUniversalAnchor (dJointID, ref dVector3 result); +void dJointGetUniversalAnchor2 (dJointID, ref dVector3 result); +void dJointGetUniversalAxis1 (dJointID, ref dVector3 result); +void dJointGetUniversalAxis2 (dJointID, ref dVector3 result); dReal dJointGetUniversalParam (dJointID, int parameter); dReal dJointGetUniversalAngle1 (dJointID); dReal dJointGetUniversalAngle2 (dJointID); dReal dJointGetUniversalAngle1Rate (dJointID); dReal dJointGetUniversalAngle2Rate (dJointID); int dJointGetAMotorNumAxes (dJointID); -void dJointGetAMotorAxis (dJointID, int anum, dVector3 result); +void dJointGetAMotorAxis (dJointID, int anum, ref dVector3 result); int dJointGetAMotorAxisRel (dJointID, int anum); dReal dJointGetAMotorAngle (dJointID, int anum); dReal dJointGetAMotorAngleRate (dJointID, int anum); --- a/import/ode/ode.d +++ b/import/ode/ode.d @@ -23,21 +23,21 @@ /* include *everything* here */ -import ode.config; -import ode.compatibility; -import ode.common; -import ode.contact; -import ode.error; -import ode.memory; -import ode.odemath; -import ode.matrix; -import ode.timer; -import ode.rotation; -import ode.mass; -import ode.misc; -import ode.objects; -//import ode.odecpp; -import ode.collision_space; -import ode.collision; -//import ode.odecpp_collision; -import ode.export_dif; +public import ode.config; +public import ode.compatibility; +public import ode.common; +public import ode.contact; +public import ode.error; +public import ode.memory; +public import ode.odemath; +public import ode.matrix; +public import ode.timer; +public import ode.rotation; +public import ode.mass; +public import ode.misc; +public import ode.objects; +//public import ode.odecpp; +public import ode.collision_space; +public import ode.collision; +//public import ode.odecpp_collision; +public import ode.export_dif; --- a/import/ode/odemath.d +++ b/import/ode/odemath.d @@ -165,8 +165,8 @@ /* * normalize 3x1 and 4x1 vectors (i.e. scale them to unit length) */ -void dNormalize3 (dVector3 a); -void dNormalize4 (dVector4 a); +void dNormalize3 (ref dVector3 a); +void dNormalize4 (ref dVector4 a); /* @@ -177,4 +177,4 @@ * q wont be. */ -void dPlaneSpace (dVector3 n, dVector3 p, dVector3 q); +void dPlaneSpace (ref dVector3 n, ref dVector3 p, ref dVector3 q); --- a/import/ode/rotation.d +++ b/import/ode/rotation.d @@ -27,33 +27,33 @@ extern(C): -void dRSetIdentity (dMatrix3 R); +void dRSetIdentity (ref dMatrix3 R); -void dRFromAxisAndAngle (dMatrix3 R, dReal ax, dReal ay, dReal az, +void dRFromAxisAndAngle (ref dMatrix3 R, dReal ax, dReal ay, dReal az, dReal angle); -void dRFromEulerAngles (dMatrix3 R, dReal phi, dReal theta, dReal psi); +void dRFromEulerAngles (ref dMatrix3 R, dReal phi, dReal theta, dReal psi); -void dRFrom2Axes (dMatrix3 R, dReal ax, dReal ay, dReal az, +void dRFrom2Axes (ref dMatrix3 R, dReal ax, dReal ay, dReal az, dReal bx, dReal by, dReal bz); -void dRFromZAxis (dMatrix3 R, dReal ax, dReal ay, dReal az); +void dRFromZAxis (ref dMatrix3 R, dReal ax, dReal ay, dReal az); -void dQSetIdentity (dQuaternion q); +void dQSetIdentity (ref dQuaternion q); -void dQFromAxisAndAngle (dQuaternion q, dReal ax, dReal ay, dReal az, +void dQFromAxisAndAngle (ref dQuaternion q, dReal ax, dReal ay, dReal az, dReal angle); /* Quaternion multiplication, analogous to the matrix multiplication routines. */ /* qa = rotate by qc, then qb */ -void dQMultiply0 (dQuaternion qa, dQuaternion qb, dQuaternion qc); +void dQMultiply0 (ref dQuaternion qa, ref dQuaternion qb, ref dQuaternion qc); /* qa = rotate by qc, then by inverse of qb */ -void dQMultiply1 (dQuaternion qa, dQuaternion qb, dQuaternion qc); +void dQMultiply1 (ref dQuaternion qa, ref dQuaternion qb, ref dQuaternion qc); /* qa = rotate by inverse of qc, then by qb */ -void dQMultiply2 (dQuaternion qa, dQuaternion qb, dQuaternion qc); +void dQMultiply2 (ref dQuaternion qa, ref dQuaternion qb, ref dQuaternion qc); /* qa = rotate by inverse of qc, then by inverse of qb */ -void dQMultiply3 (dQuaternion qa, dQuaternion qb, dQuaternion qc); +void dQMultiply3 (ref dQuaternion qa, ref dQuaternion qb, ref dQuaternion qc); -void dRfromQ (dMatrix3 R, dQuaternion q); -void dQfromR (dQuaternion q, dMatrix3 R); -void dDQfromW (dReal dq[4], dVector3 w, dQuaternion q); +void dRfromQ (ref dMatrix3 R, ref dQuaternion q); +void dQfromR (ref dQuaternion q, ref dMatrix3 R); +void dDQfromW (ref dReal dq[4], ref dVector3 w, ref dQuaternion q); --- a/import/ode/timer.d +++ b/import/ode/timer.d @@ -41,8 +41,8 @@ /* code timers */ -void dTimerStart (char *description); /* pass a static string here */ -void dTimerNow (char *description); /* pass a static string here */ +void dTimerStart (const(char)* description); /* pass a static string here */ +void dTimerNow (const(char)* description); /* pass a static string here */ void dTimerEnd(); /* print out a timer report. if `average' is nonzero, print out the average debian/patches/ode.patch0000644000000000000000000000103512164135446012412 0ustar # Copyright (C) 2009 Peter De Wachter # Distributed under the same license as the game. See debian/copyright. This is an attempt to make mu-cade compatible with libode 2:0.10.1-1 --- a/src/abagames/util/ode/world.d +++ b/src/abagames/util/ode/world.d @@ -28,6 +28,7 @@ bool initialized = false; public void init() { + dInitODE(); world = dWorldCreate(); dWorldSetContactMaxCorrectingVel(world, CONTACT_MAX_CORRECTING_VEL); dWorldSetContactSurfaceLayer (world, CONTACT_SURFACE_LAYER); debian/patches/directories.patch0000644000000000000000000000406312164135446014163 0ustar # Copyright (C) 2007 Miriam Ruiz # Distributed under the same license as the game. See debian/copyright. Index: mu-cade-0.11.dfsg1/src/abagames/mcd/barrage.d =================================================================== --- mu-cade-0.11.dfsg1.orig/src/abagames/mcd/barrage.d 2007-08-26 18:23:18.000000000 +0000 +++ mu-cade-0.11.dfsg1/src/abagames/mcd/barrage.d 2007-08-26 18:23:41.000000000 +0000 @@ -58,7 +58,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/mu-cade/barrage"; public static void load() { char[][] dirs = listdir(BARRAGE_DIR_NAME); Index: mu-cade-0.11.dfsg1/src/abagames/util/sdl/sound.d =================================================================== --- mu-cade-0.11.dfsg1.orig/src/abagames/util/sdl/sound.d 2007-08-26 18:23:54.000000000 +0000 +++ mu-cade-0.11.dfsg1/src/abagames/util/sdl/sound.d 2007-08-26 18:24:23.000000000 +0000 @@ -67,7 +67,7 @@ public class Music: Sound { public: static int fadeOutSpeed = 1280; - static char[] dir = "sounds/musics"; + static char[] dir = "/usr/share/games/mu-cade/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/mu-cade/sounds/chunks"; private: Mix_Chunk* chunk; int chunkChannel; Index: mu-cade-0.11.dfsg1/src/abagames/util/sdl/texture.d =================================================================== --- mu-cade-0.11.dfsg1.orig/src/abagames/util/sdl/texture.d 2007-08-26 18:21:57.000000000 +0000 +++ mu-cade-0.11.dfsg1/src/abagames/util/sdl/texture.d 2007-08-26 18:22:46.000000000 +0000 @@ -16,7 +16,7 @@ */ public class Texture { public: - static char[] imagesDir = "images/"; + static char[] imagesDir = "/usr/share/games/mu-cade/images/"; static SDL_Surface*[char[]] surface; private: GLuint num, maskNum; debian/patches/dlang_v2.patch0000644000000000000000000015750512164135446013355 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/mcd/barrage.d +++ b/src/abagames/mcd/barrage.d @@ -33,7 +33,7 @@ parserParam ~= new ParserParam(p, rank, speed); } - public void addBml(char[] bmlDirName, char[] bmlFileName, float rank, float speed) { + public void addBml(string bmlDirName, string bmlFileName, float rank, float speed) { BulletMLParser *p = BarrageManager.getInstance(bmlDirName, bmlFileName); if (!p) throw new Error("File not found: " ~ bmlDirName ~ "/" ~ bmlFileName); @@ -57,24 +57,26 @@ */ public class BarrageManager { private: - static BulletMLParserTinyXML *parser[char[]][char[]]; - static const char[] BARRAGE_DIR_NAME = "/usr/share/games/mu-cade/barrage"; + static BulletMLParserTinyXML *parser[string][string]; + static const string BARRAGE_DIR_NAME = "/usr/share/games/mu-cade/barrage"; public static void load() { - char[][] dirs = listdir(BARRAGE_DIR_NAME); - foreach (char[] dirName; dirs) { + auto dirs = dirEntries(BARRAGE_DIR_NAME, SpanMode.shallow); + foreach (string fullDirName; dirs) { + string dirName = baseName(fullDirName); parser[dirName] = null; - char[][] files = listdir(BARRAGE_DIR_NAME ~ "/" ~ dirName); - foreach (char[] fileName; files) { - if (getExt(fileName) != "xml") + auto files = dirEntries(fullDirName, SpanMode.shallow); + foreach (string fullFileName; files) { + string fileName = baseName(fullFileName); + if (extension(fileName) != ".xml") continue; parser[dirName][fileName] = loadInstance(dirName, fileName); } } } - private static BulletMLParserTinyXML* loadInstance(char[] dirName, char[] fileName) { - char[] barrageName = dirName ~ "/" ~ fileName; + private static BulletMLParserTinyXML* loadInstance(string dirName, string fileName) { + string barrageName = dirName ~ "/" ~ fileName; Logger.info("Load BulletML: " ~ barrageName); parser[dirName][fileName] = BulletMLParserTinyXML_new(std.string.toStringz(BARRAGE_DIR_NAME ~ "/" ~ barrageName)); @@ -82,11 +84,11 @@ return parser[dirName][fileName]; } - public static BulletMLParserTinyXML* getInstance(char[] dirName, char[] fileName) { + public static BulletMLParserTinyXML* getInstance(string dirName, string fileName) { 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; @@ -95,7 +97,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/mcd/boot.d +++ b/src/abagames/mcd/boot.d @@ -6,6 +6,7 @@ module abagames.mcd.boot; private import std.string; +private import std.conv; private import std.stream; private import std.math; private import std.c.stdlib; @@ -52,10 +53,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; } @@ -64,12 +65,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) { screen = new Screen; input = new RecordableTwinStickPad; gameManager = new GameManager; @@ -84,11 +85,11 @@ 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": @@ -97,7 +98,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"); @@ -116,9 +117,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; @@ -135,7 +136,7 @@ throw new Exception("Invalid options"); } i++; - TwinStickPad.rotate = cast(float) std.string.atoi(args[i]) * PI / 180.0f; + TwinStickPad.rotate = cast(float) to!int(args[i]) * PI / 180.0f; break; case "-reversestick2": case "-reverserightstick": @@ -157,17 +158,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] [-res x y] [-brightness [0-100]] [-nosound] [-exchange] [-rotatestick2 deg] [-reversestick2] [-disablestick2] [-enableaxis5]"); } --- a/src/abagames/mcd/bullet.d +++ b/src/abagames/mcd/bullet.d @@ -52,7 +52,7 @@ ShapeGroup shape; LinePoint linePoint; - invariant { + invariant() { if (bullet && bullet.pos) { assert(bullet.pos.x <>= 0); assert(bullet.pos.y <>= 0); @@ -184,7 +184,7 @@ removeForced(); } - public void draw() { + public override void draw() { } public void slowdown() { @@ -215,7 +215,7 @@ LinePoint linePoint; int cnt; - invariant { + invariant() { if (pos) { assert(pos.x <>= 0); assert(pos.y <>= 0); @@ -296,7 +296,7 @@ } } - public override void collide(OdeActor actor, inout bool hasCollision, inout bool checkFeedback) { + public override void collide(OdeActor actor, ref bool hasCollision, ref bool checkFeedback) { hasCollision = checkFeedback = false; Enemy e = cast(Enemy) actor; if (cast(Ship) actor || cast(ShipTail) actor || (e && e.collideBullet)) { @@ -351,7 +351,7 @@ shape.drawShadow(linePoint); } - public void draw() { + public override void draw() { if (removeCnt > 0) return; linePoint.draw(); --- a/src/abagames/mcd/bulletimpl.d +++ b/src/abagames/mcd/bulletimpl.d @@ -89,7 +89,7 @@ float rank; float speed; - invariant { + invariant() { assert(rank >= 0 && rank <= 1); assert(speed > 0 && speed < 10); } --- a/src/abagames/mcd/enemy.d +++ b/src/abagames/mcd/enemy.d @@ -43,7 +43,7 @@ EnemyState state; Vector3 lastForce; - invariant { + invariant() { if (state && state.pos) { assert(state.pos.x <>= 0); assert(state.pos.y <>= 0); @@ -64,7 +64,7 @@ rand.setSeed(seed); } - public void init(Object[] args) { + public override void init(Object[] args) { super.init(true); field = cast(Field) args[0]; particles = cast(ParticlePool) args[1]; @@ -126,7 +126,7 @@ state.joints = joints; } - public void move() { + public override void move() { if (checkDestroyed()) return; updateState(); @@ -143,7 +143,7 @@ spec.recordLinePoints(state, state.linePoint); } - public void remove() { + public override void remove() { removeCleaning(); super.remove(); } @@ -202,7 +202,7 @@ } } - public override void collide(OdeActor actor, inout bool hasCollision, inout bool checkFeedback) { + public override void collide(OdeActor actor, ref bool hasCollision, ref bool checkFeedback) { hasCollision = checkFeedback = false; if (!exists) return; @@ -311,7 +311,7 @@ spec.drawShadow(state.linePoint); } - public void draw() { + public override void draw() { state.linePoint.draw(); spec.drawSubShape(state); } @@ -422,7 +422,7 @@ static const int MAX_LINE_POINT_NUM = 24; Field field; - invariant { + invariant() { assert(pos.x <>= 0); assert(pos.y <>= 0); assert(pos.z <>= 0); @@ -537,7 +537,7 @@ public void recordLinePoints(EnemyState state, LinePoint lp) { glPushMatrix(); Screen.glTranslate(state.pos); - glMultMatrixd(state.rot); + glMultMatrixd(state.rot.ptr); glScalef(state.sizeScale.x, state.sizeScale.y, state.sizeScale.z); lp.beginRecord(); shape.recordLinePoints(lp); --- a/src/abagames/mcd/field.d +++ b/src/abagames/mcd/field.d @@ -42,7 +42,7 @@ Texture _titleTexture; int cnt; - invariant { + invariant() { if(eyePos) { assert(eyePos.x < 100 && eyePos.x > -100); assert(eyePos.y < 100 && eyePos.y > -100); @@ -294,7 +294,7 @@ return (_size.contains(p.x, p.y) && fabs(p.z) < 1); } - public Vector size() { + public const(Vector) size() const { return _size; } --- a/src/abagames/mcd/gamemanager.d +++ b/src/abagames/mcd/gamemanager.d @@ -38,7 +38,7 @@ */ public class GameManager: abagames.util.sdl.gamemanager.GameManager { private: - static const char[] LAST_REPLAY_FILE_NAME = "last.rpl"; + static const string LAST_REPLAY_FILE_NAME = "last.rpl"; static const int RANK_DOWN_INTERVAL = 60 * 1000; static const int BGM_CHANGE_INTERVAL = 2 * 60 * 1000; static const enum GameState { @@ -227,7 +227,7 @@ ship.clearContactJoint(); enemies.move(); bullets.move(); - switch (state) { + switch (state) { default: break; case GameState.IN_GAME: case GameState.REPLAY: ship.move(); @@ -404,7 +404,7 @@ public void drawState() { Letter.drawNum(score, 120, 21, 6); Letter.drawTime(time, 610, 30, 6); - switch (state) { + switch (state) { default: break; case GameState.IN_GAME: case GameState.REPLAY: if (left > 0) { @@ -442,22 +442,22 @@ private void saveLastReplay() { try { saveReplay(LAST_REPLAY_FILE_NAME); - } catch (Object o) {} + } catch (Throwable o) {} } private void loadLastReplay() { try { loadReplay(LAST_REPLAY_FILE_NAME); - } catch (Object o) { + } catch (Throwable o) { resetReplay(); } } - private void saveReplay(char[] fileName) { + private void saveReplay(string fileName) { _replayData.save(fileName); } - private void loadReplay(char[] fileName) { + private void loadReplay(string fileName) { _replayData = new ReplayData; _replayData.load(fileName); } --- a/src/abagames/mcd/letter.d +++ b/src/abagames/mcd/letter.d @@ -107,7 +107,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, bool rev = false, float od = 0) { lx += LETTER_WIDTH * s / 2; @@ -115,7 +115,7 @@ float x = lx; int idx; float ld; - switch (d) { + switch (d) { default: break; case Direction.TO_RIGHT: ld = 0; break; @@ -139,7 +139,7 @@ drawLetter(idx, x, y, s, ld); } if (od == 0) { - switch(d) { + switch(d) { default: break; case Direction.TO_RIGHT: x += s * LETTER_WIDTH; break; --- a/src/abagames/mcd/particle.d +++ b/src/abagames/mcd/particle.d @@ -35,7 +35,7 @@ float decayRatio; LinePoint linePoint; - invariant { + invariant() { if (pos) { assert(pos.x <>= 0); assert(pos.y <>= 0); @@ -171,7 +171,7 @@ ConnectedParticle prevParticle; LinePoint linePoint; - invariant { + invariant() { if (_pos) { assert(_pos.x <>= 0); assert(_pos.y <>= 0); @@ -286,7 +286,7 @@ glPushMatrix(); Screen.glTranslate(_pos); if (enableRotate) - glMultMatrixd(rot); + glMultMatrixd(rot.ptr); linePoint.beginRecord(); linePoint.record(0, 0, 0); linePoint.record((prevParticle.pos.x - _pos.x) * 2, @@ -358,7 +358,7 @@ ShapeGroup shape; LinePoint linePoint; - invariant { + invariant() { if (pos) { assert(pos.x <>= 0); assert(pos.y <>= 0); @@ -483,7 +483,7 @@ float size; int cnt; - invariant { + invariant() { if (pos) { assert(pos.x <>= 0); assert(pos.y <>= 0); @@ -542,7 +542,7 @@ int cnt; int num1, num2; - invariant { + invariant() { if (pos) { assert(pos.x <>= 0); assert(pos.y <>= 0); --- a/src/abagames/mcd/prefmanager.d +++ b/src/abagames/mcd/prefmanager.d @@ -7,6 +7,7 @@ private import std.stream; private import std.string; +private import std.conv; private import std.file; private import std.c.stdlib; private import abagames.util.prefmanager; @@ -17,18 +18,18 @@ public class PrefManager: abagames.util.prefmanager.PrefManager { private: static const int VERSION_NUM = 10; - static const char[] PREF_FILE_NAME = "mcd.prf"; + static const string PREF_FILE_NAME = "mcd.prf"; PrefData _prefData; public this() { _prefData = new PrefData; } - public static char[] pref_dir() { - char * home = getenv("HOME"); + public static string pref_dir() { + const(char)* home = getenv("HOME"); if (home is null) throw new Error("HOME environment variable undefined"); - char[] dir = std.string.toString(home) ~ "/.mu-cade"; + string dir = to!string(home) ~ "/.mu-cade"; try { mkdir(dir); } catch (FileException e) { @@ -37,7 +38,7 @@ } public void load() { - auto File fd = new File; + scope File fd = new File; try { int ver; fd.open(pref_dir() ~ "/" ~ PREF_FILE_NAME); @@ -46,7 +47,7 @@ throw new Error("Wrong version num"); else _prefData.load(fd); - } catch (Object e) { + } catch (Throwable e) { _prefData.init(); } finally { if (fd.isOpen()) @@ -55,7 +56,7 @@ } public void save() { - auto File fd = new File; + scope File fd = new File; fd.create(pref_dir ~ "/" ~ PREF_FILE_NAME); fd.write(VERSION_NUM); _prefData.save(fd); --- a/src/abagames/mcd/replay.d +++ b/src/abagames/mcd/replay.d @@ -23,8 +23,8 @@ int time = 0; 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); @@ -34,8 +34,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/mcd/screen.d +++ b/src/abagames/mcd/screen.d @@ -15,10 +15,10 @@ */ public class Screen: Screen3D { private: - const char[] CAPTION = "Mu-cade"; + const string CAPTION = "Mu-cade"; Field field; - protected void init() { + protected override void init() { setCaption(CAPTION); glLineWidth(1); glBlendFunc(GL_SRC_ALPHA, GL_ONE); @@ -37,7 +37,7 @@ screenResized(); } - protected void close() {} + protected override void close() {} public static void drawLine(float x1, float y1, float z1, float x2, float y2, float z2, float a = 1) { --- a/src/abagames/mcd/shape.d +++ b/src/abagames/mcd/shape.d @@ -74,7 +74,7 @@ float mass = 1; float shapeBoxScale = 1; - invariant { + invariant() { if (pos) { assert(pos.x <>= 0); assert(pos.y <>= 0); @@ -158,7 +158,7 @@ size = new Vector3(sx, sy, sz); } - public void recordLinePoints(LinePoint lp) { + public override void recordLinePoints(LinePoint lp) { lp.setPos(pos); lp.setSize(size); lp.record(-1, -1, 0); @@ -171,7 +171,7 @@ lp.record(-1, -1, 0); } - public void drawShadow(LinePoint lp) { + public override void drawShadow(LinePoint lp) { lp.setPos(pos); lp.setSize(size); if (!lp.setShadowColor()) @@ -224,7 +224,7 @@ } } - public void recordLinePoints(LinePoint lp) { + public override void recordLinePoints(LinePoint lp) { lp.setPos(pos); lp.setSize(size); lp.record(-1, -1, 0); @@ -237,7 +237,7 @@ lp.record(-1, -1, 0); } - public void drawShadow(LinePoint lp) { + public override void drawShadow(LinePoint lp) { lp.setPos(pos); lp.setSize(size); if (!lp.setShadowColor()) @@ -262,7 +262,7 @@ shapeBoxScale = 1; } - public void recordLinePoints(LinePoint lp) { + public override void recordLinePoints(LinePoint lp) { lp.setPos(pos); lp.setSize(size); lp.record( 0, 1, 0); @@ -273,7 +273,7 @@ lp.record( 0, 1, 0); } - public void drawShadow(LinePoint lp) { + public override void drawShadow(LinePoint lp) { lp.setPos(pos); lp.setSize(size); if (!lp.setShadowColor()) @@ -296,7 +296,7 @@ size = new Vector3(sx, sy, sz); } - public void recordLinePoints(LinePoint lp) { + public override void recordLinePoints(LinePoint lp) { lp.setPos(pos); lp.setSize(size); lp.record(-1, -1, -1); @@ -327,7 +327,7 @@ lp.record(-1, 1, -1); } - public void drawShadow(LinePoint lp) { + public override void drawShadow(LinePoint lp) { lp.setPos(pos); lp.setSize(size); if (!lp.setShadowColor()) @@ -382,7 +382,7 @@ float _alpha, _alphaTrg; bool _enableSpectrumColor; - invariant { + invariant() { if (pos) { assert(posIdx >= 0); assert(histIdx >= 0 && histIdx < HISTORY_MAX); @@ -407,11 +407,11 @@ pos = new Vector3[pointMax]; posHist = new Vector3[][HISTORY_MAX]; this.field = field; - foreach (inout Vector3 p; pos) + foreach (ref Vector3 p; pos) p = new Vector3; - foreach (inout Vector3[] pp; posHist) { + foreach (ref Vector3[] pp; posHist) { pp = new Vector3[pointMax]; - foreach (inout Vector3 p; pp) + foreach (ref Vector3 p; pp) p = new Vector3; } spectrumColorRTrg = spectrumColorGTrg = spectrumColorBTrg = 0; @@ -512,7 +512,7 @@ glVertex3f(tx, ty, tz); } - private void calcTranslatedPos(inout float tx, inout float ty, inout float tz, + private void calcTranslatedPos(ref float tx, ref float ty, ref float tz, float ox, float oy, float oz) { float x = basePos.x + baseSize.x / 2 * ox; float y = basePos.y + baseSize.y / 2 * oy; --- a/src/abagames/mcd/ship.d +++ b/src/abagames/mcd/ship.d @@ -78,7 +78,7 @@ int titleCnt; bool _replayMode; - invariant { + invariant() { if (_pos && field) { assert(_pos.x > -field.size.x * 100); assert(_pos.x < field.size.x * 100); @@ -127,7 +127,7 @@ linePoint = new LinePoint(field); linePoint.setSpectrumParams(0, 1.0f, 0, 1.0f); subShape = new CenterShape; - foreach (inout ShipTail t; tails) + foreach (ref ShipTail t; tails) t = new ShipTail(world, field, this, particles, connectedParticles); super.init(); } @@ -183,7 +183,7 @@ remove(); } - public void move() { + public override void move() { TwinStickPadState input; if (!_replayMode) { input = pad.getState(); @@ -347,7 +347,7 @@ } } - public override void collide(OdeActor actor, inout bool hasCollision, inout bool checkFeedback) { + public override void collide(OdeActor actor, ref bool hasCollision, ref bool checkFeedback) { hasCollision = checkFeedback = false; if (cast(Wall) actor) hasCollision = true; @@ -432,14 +432,14 @@ public void recordLinePoints() { glPushMatrix(); Screen.glTranslate(_pos); - glMultMatrixd(rot); + glMultMatrixd(rot.ptr); linePoint.beginRecord(); shape.recordLinePoints(linePoint); linePoint.endRecord(); glPopMatrix(); } - public void draw() { + public override void draw() { shots.draw(); enhancedShots.draw(); if (restartCnt > 0) @@ -453,7 +453,7 @@ linePoint.draw(); glPushMatrix(); Screen.glTranslate(_pos); - glMultMatrixd(rot); + glMultMatrixd(rot.ptr); subShape.draw(); glPopMatrix(); } @@ -525,7 +525,7 @@ LinePoint linePoint; dJointID joint; - invariant { + invariant() { if (_pos) { assert(_pos.x <>= 0); assert(_pos.y <>= 0); @@ -593,7 +593,7 @@ linePoint.init(); } - public void move() { + public override void move() { dReal *p = dBodyGetPosition(_bodyId); _pos.x = p[0]; _pos.y = p[1]; @@ -622,7 +622,7 @@ super.remove(); } - public override void collide(OdeActor actor, inout bool hasCollision, inout bool checkFeedback) { + public override void collide(OdeActor actor, ref bool hasCollision, ref bool checkFeedback) { hasCollision = checkFeedback = false; if (cast(Wall) actor || cast(ShipTail) actor || cast(Ship) actor) hasCollision = true; @@ -643,7 +643,7 @@ public void recordLinePoints() { glPushMatrix(); Screen.glTranslate(_pos); - glMultMatrixd(rot); + glMultMatrixd(rot.ptr); glScalef(size.x, size.y, size.z); linePoint.beginRecord(); shape.recordLinePoints(linePoint); @@ -651,7 +651,7 @@ glPopMatrix(); } - public void draw() { + public override void draw() { linePoint.drawSpectrum(); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); shape.drawShadow(linePoint); --- a/src/abagames/mcd/shot.d +++ b/src/abagames/mcd/shot.d @@ -37,7 +37,7 @@ ShapeGroup shape; LinePoint linePoint; - invariant { + invariant() { if (pos) { assert(pos.x <>= 0); assert(pos.y <>= 0); @@ -82,7 +82,7 @@ doCollide(); } - public override void collide(OdeActor actor, inout bool hasCollision, inout bool checkFeedback) { + public override void collide(OdeActor actor, ref bool hasCollision, ref bool checkFeedback) { hasCollision = checkFeedback = false; Enemy e = cast(Enemy) actor; if (e) { --- a/src/abagames/mcd/soundmanager.d +++ b/src/abagames/mcd/soundmanager.d @@ -16,17 +16,17 @@ */ public class SoundManager: abagames.util.sdl.sound.SoundManager { private static: - char[][] seFileName = + string[] seFileName = ["shot.wav", "hit.wav", "bullethit.wav", "destroyed.wav", "addtail.wav", "breaktail.wav", "enhancedshot.wav", "shipdestroyed.wav", "extend.wav"]; int[] seChannel = [0, 1, 2, 3, 4, 5, 0, 6, 7]; - Music[char[]] bgm; - Chunk[char[]] se; - bool[char[]] seMark; + Music[string] bgm; + Chunk[string] se; + bool[string] seMark; Rand rand; - char[][] bgmFileName; - char[] currentBgm; + string[] bgmFileName; + string currentBgm; int prevBgmIdx; int nextIdxMv; bool bgmDisabled = false; @@ -43,11 +43,12 @@ } private static void loadMusics() { - Music[char[]] musics; - char[][] files = listdir(Music.dir); - foreach (char[] fileName; files) { - char[] ext = getExt(fileName); - if (ext != "ogg" && ext != "wav") + 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); @@ -59,7 +60,7 @@ private static void loadChunks() { int i = 0; - foreach (char[] fileName; seFileName) { + foreach (string fileName; seFileName) { Chunk chunk = new Chunk(); chunk.load(fileName, seChannel[i]); se[fileName] = chunk; @@ -69,7 +70,7 @@ } } - public static void playBgm(char[] name) { + public static void playBgm(string name) { currentBgm = name; if (bgmDisabled) return; @@ -78,7 +79,7 @@ } public static void playBgm() { - int bgmIdx = rand.nextInt(bgm.length); + int bgmIdx = rand.nextInt(cast(int)bgm.length); nextIdxMv = rand.nextInt(2) * 2 - 1; prevBgmIdx = bgmIdx; playBgm(bgmFileName[bgmIdx]); @@ -87,7 +88,7 @@ public static void nextBgm() { int bgmIdx = prevBgmIdx + nextIdxMv; if (bgmIdx < 0) - bgmIdx = bgm.length - 1; + bgmIdx = cast(int)bgm.length - 1; else if (bgmIdx >= bgm.length) bgmIdx = 0; prevBgmIdx = bgmIdx; @@ -106,15 +107,15 @@ Music.haltMusic(); } - public static void playSe(char[] name) { + public static void playSe(string name) { if (seDisabled) return; seMark[name] = true; } public static void playMarkedSes() { - char[][] keys = seMark.keys; - foreach (char[] key; keys) { + string[] keys = seMark.keys; + foreach (string key; keys) { if (seMark[key]) { se[key].play(); seMark[key] = false; @@ -123,8 +124,8 @@ } public static void clearMarkedSes() { - char[][] keys = seMark.keys; - foreach (char[] key; keys) + string[] keys = seMark.keys; + foreach (string key; keys) seMark[key] = false; } --- a/src/abagames/mcd/spec.d +++ b/src/abagames/mcd/spec.d @@ -53,7 +53,7 @@ if (state.topBullet) state.topBullet.activated = true; state.linePoint.enableSpectrumColor = true; - switch (state.type) { + switch (state.type) { default: break; case CentType.TO_AND_FROM: enemy.slowLinearVel(CentHead.SLOW_VELOCITY_RATIO * state.slowVelocityRatio * (1 + (state.turnCnt * 0.1f))); @@ -79,7 +79,7 @@ state.turnCnt--; float ad; float angularForce = ANGULAR_FORCE_BASE; - switch (state.type) { + switch (state.type) { default: break; case CentType.TO_AND_FROM: int ti = -1; if (state.pos.x > field.size.x * 0.5f) @@ -210,7 +210,7 @@ if (state.isHead) { glPushMatrix(); Screen.glTranslate(state.pos); - glMultMatrixd(state.rot); + glMultMatrixd(state.rot.ptr); glScalef(state.sizeScale.x, state.sizeScale.y, state.sizeScale.z); subShape.draw(); glPopMatrix(); @@ -229,20 +229,20 @@ BasicBarrageType type; float speedRank; int interval; - char[] wayMorphBml; + string wayMorphBml; float wayMorphRank; - char[] barMorphBml; + string barMorphBml; float barMorphRank; private: - invariant { + invariant() { assert(speedRank > 0 && speedRank < 10); assert(interval > 0); } public void set(BulletPool bullets, Ship ship, EnemyState state, float orderRatio = 0) { state.barrage.clear(); - switch (type) { + switch (type) { default: break; case BasicBarrageType.AIM: case BasicBarrageType.FRONT: case BasicBarrageType.PLUMB: @@ -268,7 +268,7 @@ if (!state.topBullet) return; state.topBullet.activated = false; - switch (type) { + switch (type) { default: break; case BasicBarrageType.AIM: case BasicBarrageType.AIM_IN_ORDER: break; @@ -289,7 +289,7 @@ public template CentHeadInitImpl() { protected void initLengthAndSize(int size) { float ss; - switch (size) { + switch (size) { default: break; case 0: bodyLength = 4 + rand.nextInt(4); ss = 0.9f + rand.nextFloat(0.3f); @@ -316,7 +316,7 @@ } protected void calcBarrageSpeedAndInterval( - inout float rank, float br, out float speed, out int interval, + ref float rank, float br, out float speed, out int interval, float minInterval = 20, float maxInterval = 120) { float sr = br * (0.5f + rand.nextSignedFloat(0.2f)); float ir = br - sr; @@ -335,7 +335,7 @@ } protected void calcForwardForceAndSlowVelocity( - inout float rank, int size, + ref float rank, int size, out float forwardForceScale, out float slowVelocityRatio) { forwardForceScale = 1; if (rand.nextInt(5) == 0) { @@ -367,7 +367,7 @@ static const float COLOR_G = 0.25f; static const float COLOR_B = 1.0f; private: - static const char[][] BAR_MORPH_BML = [ + static const string[] BAR_MORPH_BML = [ "baraccel.xml", "whip.xml", "slidebar.xml", "slidebaraccel.xml", "slidewhip.xml"]; public this(Field field, Ship ship, BulletPool bullets, World world, float rank, int size) { @@ -388,7 +388,7 @@ float br = rk * (0.1f * size + rand.nextFloat(0.1f)); float brv = calcBarrageRank(br); if (brv >= 0.1f) { - bodyBarrage.barMorphBml = BAR_MORPH_BML[rand.nextInt(BAR_MORPH_BML.length)]; + bodyBarrage.barMorphBml = BAR_MORPH_BML[rand.nextInt(cast(int)BAR_MORPH_BML.length)]; bodyBarrage.barMorphRank = brv; rk -= br * 2; } else { @@ -406,7 +406,7 @@ float br = rk * (0.1f * size + rand.nextFloat(0.3f)); float brv = calcBarrageRank(br); if (brv >= 0.1f) { - headBarrage.barMorphBml = BAR_MORPH_BML[rand.nextInt(BAR_MORPH_BML.length)]; + headBarrage.barMorphBml = BAR_MORPH_BML[rand.nextInt(cast(int)BAR_MORPH_BML.length)]; headBarrage.barMorphRank = brv; rk -= br * 2; } else { @@ -418,7 +418,7 @@ slowVelocityRatio = svr; float sp; int iv; - switch (size) { + switch (size) { default: break; case 0: calcBarrageSpeedAndInterval(rk, rk, sp, iv); break; @@ -450,9 +450,9 @@ static const float COLOR_G = 0.25f; static const float COLOR_B = 0.75f; private: - static const char[][] WAY_MORPH_BML = [ + static const string[] WAY_MORPH_BML = [ "accnway.xml", "decnway.xml", "nway.xml"]; - static const char[][] BAR_MORPH_BML = [ + static const string[] BAR_MORPH_BML = [ "bar.xml", "baraccel.xml", "whip.xml"]; public this(Field field, Ship ship, BulletPool bullets, World world, float rank, int size) { @@ -470,7 +470,7 @@ float br = rk * (0.1f + rand.nextFloat(0.1f)); float brv = calcBarrageRank(br); if (brv >= 0.1f) { - bodyBarrage.barMorphBml = BAR_MORPH_BML[rand.nextInt(BAR_MORPH_BML.length)]; + bodyBarrage.barMorphBml = BAR_MORPH_BML[rand.nextInt(cast(int)BAR_MORPH_BML.length)]; bodyBarrage.barMorphRank = brv; rk -= br * 2; } else { @@ -485,7 +485,7 @@ headBarrage = new CentBarrage; headBarrage.type = CentBarrage.BasicBarrageType.FRONT; float wr; - switch (size) { + switch (size) { default: break; case 0: wr = 0; break; @@ -500,14 +500,14 @@ float wrv = calcBarrageRank(wr); float brv = calcBarrageRank(br); if (wrv >= 0.2f) { - headBarrage.wayMorphBml = WAY_MORPH_BML[rand.nextInt(WAY_MORPH_BML.length)]; + headBarrage.wayMorphBml = WAY_MORPH_BML[rand.nextInt(cast(int)WAY_MORPH_BML.length)]; headBarrage.wayMorphRank = wrv; rk -= wr * 2; } else { headBarrage.wayMorphBml = null; } if (brv >= 0.1f) { - headBarrage.barMorphBml = BAR_MORPH_BML[rand.nextInt(BAR_MORPH_BML.length)]; + headBarrage.barMorphBml = BAR_MORPH_BML[rand.nextInt(cast(int)BAR_MORPH_BML.length)]; headBarrage.barMorphRank = brv; rk -= br * 2; } else { @@ -544,9 +544,9 @@ static const float COLOR_G = 0.75f; static const float COLOR_B = 0.75f; private: - static const char[][] WAY_MORPH_BML = [ + static const string[] WAY_MORPH_BML = [ "nway.xml", "round.xml"]; - static const char[][] BAR_MORPH_BML = [ + static const string[] BAR_MORPH_BML = [ "bar.xml", "baraccel.xml", "whip.xml", "slidebar.xml", "slidebaraccel.xml", "slidewhip.xml"]; @@ -563,7 +563,7 @@ float br = rk * (0.1f * size + rand.nextFloat(0.1f)); float brv = calcBarrageRank(br); if (brv >= 0.1f) { - bodyBarrage.barMorphBml = BAR_MORPH_BML[rand.nextInt(BAR_MORPH_BML.length)]; + bodyBarrage.barMorphBml = BAR_MORPH_BML[rand.nextInt(cast(int)BAR_MORPH_BML.length)]; bodyBarrage.barMorphRank = brv; rk -= br * 2; } else { @@ -571,7 +571,7 @@ } float sp; int iv; - switch (size) { + switch (size) { default: break; case 0: calcBarrageSpeedAndInterval(rk, rk * 0.5f, sp, iv, 10, 60); break; @@ -594,20 +594,20 @@ headBarrage = new CentBarrage; headBarrage.type = CentBarrage.BasicBarrageType.FRONT; float wr = rk * (size * 0.2f + rand.nextFloat(0.2f)); - float br = rk * rand.nextFloat(0.2f); + float br_ = rk * rand.nextFloat(0.2f); float wrv = calcBarrageRank(wr); - float brv = calcBarrageRank(br); + float brv_ = calcBarrageRank(br_); if (wrv >= 0.2f) { - headBarrage.wayMorphBml = WAY_MORPH_BML[rand.nextInt(WAY_MORPH_BML.length)]; + headBarrage.wayMorphBml = WAY_MORPH_BML[rand.nextInt(cast(int)WAY_MORPH_BML.length)]; headBarrage.wayMorphRank = wrv; rk -= wr * 2; } else { headBarrage.wayMorphBml = null; } - if (brv >= 0.1f) { - headBarrage.barMorphBml = BAR_MORPH_BML[rand.nextInt(BAR_MORPH_BML.length)]; - headBarrage.barMorphRank = brv; - rk -= br * 2; + if (brv_ >= 0.1f) { + headBarrage.barMorphBml = BAR_MORPH_BML[rand.nextInt(cast(int)BAR_MORPH_BML.length)]; + headBarrage.barMorphRank = brv_; + rk -= br_ * 2; } else { headBarrage.barMorphBml = null; } @@ -615,11 +615,11 @@ calcForwardForceAndSlowVelocity(rk, size, ffs, svr); forwardForceScale = ffs; slowVelocityRatio = svr; - float sp; - int iv; - calcBarrageSpeedAndInterval(rk, rk, sp, iv, 10, 60); - headBarrage.speedRank = sp; - headBarrage.interval = iv; + float sp_; + int iv_; + calcBarrageSpeedAndInterval(rk, rk, sp_, iv_, 10, 60); + headBarrage.speedRank = sp_; + headBarrage.interval = iv_; } _colorR = COLOR_R; _colorG = COLOR_G; @@ -644,7 +644,7 @@ CentBarrage headBarrage, bodyBarrage; private: - invariant { + invariant() { if (sizeScale) { assert(sizeScale.x > 0); assert(sizeScale.y > 0); --- a/src/abagames/mcd/stagemanager.d +++ b/src/abagames/mcd/stagemanager.d @@ -48,7 +48,7 @@ this.bullets = bullets; this.enemies = enemies; rand = new Rand; - foreach (inout Appearance a; appearances) + foreach (ref Appearance a; appearances) a = new Appearance(field, ship, bullets, world, this); _blockSpec = new Block(field, ship, bullets, world); } @@ -68,7 +68,7 @@ TailParticle.setRandSeed(randSeed); Field.setRandSeed(randSeed); SoundManager.setRandSeed(randSeed); - dRandSetSeed(randSeed); + dRandSetSeed(cast(int)randSeed); clearAppearances(); cnt = 0; rankDownCnt = 0; @@ -99,7 +99,7 @@ if (atypeMax > 16) atypeMax = 16; int atype = rand.nextInt(atypeMax); - switch (atype) { + switch (atype) { default: break; case 0: addAppearance(rank, Appearance.EnemyType.CHASE, 0, 3, 500); addAppearance(0, Appearance.EnemyType.BLOCK, 0, 6, 250); @@ -285,7 +285,7 @@ public void set(float rank, int type, int size, int num, int interval) { appType = AppearanceType.NORMAL; - switch (type) { + switch (type) { default: break; case EnemyType.TO_AND_FROM: spec = new CentHeadToAndFrom(field, ship, bullets, world, rank, size); break; @@ -317,7 +317,7 @@ cnt -= cntInc; if (cnt < 0) { cnt = interval; - switch (appType) { + switch (appType) { default: break; case AppearanceType.NORMAL: stageManager.set(spec, rand.nextSignedFloat(field.size.x * 0.5f), @@ -329,7 +329,7 @@ float ys = 1 + rand.nextFloat(1); float zs = 1 + rand.nextFloat(1); if (rand.nextInt(3) == 0) { - switch (rand.nextInt(3)) { + switch (rand.nextInt(3)) { default: break; case 0: xs *= (2 + rand.nextFloat(2)); break; --- a/src/abagames/mcd/title.d +++ b/src/abagames/mcd/title.d @@ -6,6 +6,7 @@ module abagames.mcd.title; private import std.string; +private import std.conv; private import opengl; private import abagames.mcd.screen; private import abagames.mcd.field; @@ -70,7 +71,7 @@ rn = PrefData.RANKING_NUM; float y = 120; for (int i = 0; i < rn; i++) { - char[] rstr; + string rstr; switch (i) { case 0: rstr = "1ST"; @@ -82,7 +83,7 @@ rstr = "3RD"; break; default: - rstr = std.string.toString(i + 1) ~ "TH"; + rstr = to!string(i + 1) ~ "TH"; break; } if (i < 9) --- a/src/abagames/util/actor.d +++ b/src/abagames/util/actor.d @@ -33,7 +33,7 @@ public: T[] actor; protected: - int actorIdx = 0; + ptrdiff_t actorIdx = 0; private: public this() {} @@ -44,7 +44,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,10 +35,10 @@ } } -alias ArrayIterator!(char[]) StringIterator; +alias ArrayIterator!(string) StringIterator; public class NoMoreItemsException: Exception { - public this(char[] msg) { + public this(string msg) { super(msg); } } --- 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) std.cstream.derr.writeLine(msg); @@ -28,24 +29,20 @@ public static void info(double n, bool nline = true) { /*if (nline) - std.cstream.derr.writeLine(std.string.toString(n)); + std.cstream.derr.writeLine(to!string(n)); else - std.cstream.derr.writeString(std.string.toString(n) ~ " ");*/ + std.cstream.derr.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) std.cstream.derr.writeLine(msg); else @@ -63,20 +60,16 @@ public static void info(double n, bool nline = true) { if (nline) - std.cstream.derr.writeLine(std.string.toString(n)); + std.cstream.derr.writeLine(to!string(n)); else - std.cstream.derr.writeString(std.string.toString(n) ~ " "); + std.cstream.derr.writeString(to!string(n) ~ " "); } - public static void error(char[] msg) { + public static void error(string msg) { std.cstream.derr.writeLine("Error: " ~ msg); } - public static void error(Exception e) { - std.cstream.derr.writeLine("Error: " ~ e.toString()); - } - - public static void error(Error e) { + public static void error(Throwable e) { std.cstream.derr.writeLine("Error: " ~ e.toString()); if (e.next) error(e.next); --- a/src/abagames/util/math.d +++ b/src/abagames/util/math.d @@ -14,13 +14,13 @@ 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; } - public static void normalizeDeg360(inout float d) { + public static void normalizeDeg360(ref float d) { if (d < -180) d = 360 - (-d % 360); d = (d + 180) % 360 - 180; --- a/src/abagames/util/ode/odeactor.d +++ b/src/abagames/util/ode/odeactor.d @@ -54,7 +54,7 @@ transformedGeomId = new dGeomID[GEOM_NUM]; if (checkFeedback) { contactJoint = new ContactJoint[CONTACT_JOINT_NUM]; - foreach (inout ContactJoint cj; contactJoint) { + foreach (ref ContactJoint cj; contactJoint) { cj.pos = new Vector3; cj.feedbackForce = new Vector3; } @@ -309,7 +309,7 @@ dBodySetRotation(_bodyId, matrix); } - public void collide(OdeActor actor, inout bool hasCollision, inout bool checkFeedback) { + public void collide(OdeActor actor, ref bool hasCollision, ref bool checkFeedback) { hasCollision = checkFeedback = false; } --- 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/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); @@ -57,7 +58,7 @@ int screen_height = _height; if (SDL_SetVideoMode(screen_width, screen_height, 0, _videoFlags) == null) { throw new SDLInitFailedException - ("Unable to resize SDL screen: " ~ std.string.toString(SDL_GetError())); + ("Unable to resize SDL screen: " ~ to!string(SDL_GetError())); } // adjust width and height to maintain correct aspect ratio @@ -107,10 +108,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/mu-cade/sounds/musics"; + static string dir = "/usr/share/games/mu-cade/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/mu-cade/sounds/chunks"; + static string dir = "/usr/share/games/mu-cade/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/mu-cade/images/"; - static SDL_Surface*[char[]] surface; + static string imagesDir = "/usr/share/games/mu-cade/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) { 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; --- a/src/abagames/util/sdl/twinstickpad.d +++ b/src/abagames/util/sdl/twinstickpad.d @@ -65,7 +65,7 @@ state.right.x = state.right.y = 0; } else { ry = -ry; - float rd = atan2(rx, ry) * reverse + rotate; + float rd = atan2(cast(float)rx, cast(float)ry) * reverse + rotate; assert(rd <>= 0); float rl = sqrt(cast(float) rx * rx + cast(float) ry * ry); assert(rl <>= 0); @@ -162,7 +162,7 @@ int button; private: - invariant { + invariant() { assert(left.x >= -1 && left.x <= 1); assert(left.y >= -1 && left.y <= 1); assert(right.x >= -1 && right.x <= 1); @@ -227,7 +227,11 @@ mixin RecordableInput!(TwinStickPadState); private: - public TwinStickPadState getState(bool doRecord = true) { + public override TwinStickPadState getState() { + return getState(true); + } + + public TwinStickPadState getState(bool doRecord) { TwinStickPadState s = super.getState(); if (doRecord) record(s); --- 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 = std.string.split(line, separator); - foreach (char[] s; spl) { - char[] r = strip(s); + string[] spl = std.string.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. @@ -219,8 +220,8 @@ x = tx; } - public char[] toString() { - return "(" ~ std.string.toString(x) ~ ", " ~ std.string.toString(y) ~ ")"; + public override string toString() { + return "(" ~ to!string(x) ~ ", " ~ to!string(y) ~ ")"; } } @@ -336,7 +337,7 @@ z /= a; } - public char[] toString() { - return "(" ~ std.string.toString(x) ~ ", " ~ std.string.toString(y) ~ ", " ~ std.string.toString(z) ~ ")"; + public override string toString() { + return "(" ~ to!string(x) ~ ", " ~ to!string(y) ~ ", " ~ to!string(z) ~ ")"; } } --- a/src/abagames/util/sdl/mainloop.d +++ b/src/abagames/util/sdl/mainloop.d @@ -93,7 +93,7 @@ frame = cast(int) (nowTick - prvTickCount) / itv; if (frame <= 0) { frame = 1; - SDL_Delay(prvTickCount + itv - nowTick); + SDL_Delay(cast(uint)(prvTickCount + itv - nowTick)); if (accframe) { prvTickCount = SDL_GetTicks(); } else { --- a/src/abagames/util/ode/world.d +++ b/src/abagames/util/ode/world.d @@ -27,6 +27,8 @@ dSpaceID _space; bool initialized = false; + private TypeInfo hack1() { return typeid(actor); } //workaround for compiler/linker bug in gdc-4.6 0.29.1-4.6.4-3 + public void init() { dInitODE(); world = dWorldCreate(); debian/patches/imports.patch0000644000000000000000000013763412164135446013357 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 2006/02/19 04:57:25 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.patch0000644000000000000000000000576012164135446012772 0ustar # Copyright (C) 2007 Marcel Unbehaun # Distributed under the same license as the game. See debian/copyright. --- a/src/abagames/mcd/barrage.d +++ b/src/abagames/mcd/barrage.d @@ -62,7 +62,8 @@ public static void load() { char[][] dirs = listdir(BARRAGE_DIR_NAME); - foreach (char[] dirName; dirs) { + foreach (char[] dirName; dirs) { + parser[dirName] = null; char[][] files = listdir(BARRAGE_DIR_NAME ~ "/" ~ dirName); foreach (char[] fileName; files) { if (getExt(fileName) != "xml") --- a/src/abagames/mcd/shape.d +++ b/src/abagames/mcd/shape.d @@ -34,7 +34,7 @@ } public void setMass(OdeActor oa, Vector3 sizeScale = null, float massScale = 1) { - dMass m; + dMass m = void; dMassSetZero(&m); addMass(&m, sizeScale, massScale); oa.setMass(m); @@ -87,7 +87,7 @@ } public void addMass(dMass* m, Vector3 sizeScale = null, float massScale = 1) { - dMass sm; + dMass sm = void; if (sizeScale) { dMassSetBox(&sm, 1, size.x * sizeScale.x, size.y * sizeScale.y, size.z * sizeScale.z); dMassTranslate(&sm, pos.x * sizeScale.x, pos.y * sizeScale.y, pos.z * sizeScale.z); @@ -436,7 +436,7 @@ public void beginRecord() { posIdx = 0; - glGetFloatv(GL_MODELVIEW_MATRIX, m); + glGetFloatv(GL_MODELVIEW_MATRIX, m.ptr); } public void setPos(Vector3 p) { --- a/src/abagames/mcd/ship.d +++ b/src/abagames/mcd/ship.d @@ -520,7 +520,7 @@ Ship ship; ParticlePool particles; ConnectedParticlePool connectedParticles; - dMass m; + dMass m = void; Shape shape; LinePoint linePoint; dJointID joint; --- a/src/abagames/util/sdl/texture.d +++ b/src/abagames/util/sdl/texture.d @@ -103,13 +103,13 @@ } glBindTexture(GL_TEXTURE_2D, num + ti); gluBuild2DMipmaps(GL_TEXTURE_2D, 4, panelWidth, panelHeight, - GL_RGBA, GL_UNSIGNED_BYTE, pixels); + GL_RGBA, GL_UNSIGNED_BYTE, 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_BYTE, maskPixels); + GL_RGBA, GL_UNSIGNED_BYTE, 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/sdl/twinstickpad.d +++ b/src/abagames/util/sdl/twinstickpad.d @@ -9,6 +9,7 @@ private import std.stream; private import std.math; private import SDL; +private import SDL_keyboard; private import abagames.util.vector; private import abagames.util.sdl.input; private import abagames.util.sdl.recordableinput;