debian/0000755000000000000000000000000012164040414007162 5ustar debian/source/0000755000000000000000000000000012164040414010462 5ustar debian/source/format0000644000000000000000000000001412164040414011670 0ustar 3.0 (quilt) debian/docs0000644000000000000000000000001312164040414010027 0ustar readme.txt debian/tatan.manpages0000644000000000000000000000001712164040414012004 0ustar debian/tatan.6 debian/README.Debian0000644000000000000000000000121612164040414011223 0ustar Tatan for Debian ---------------- The original music and sound has been removed because its license had non-DFSG-free clauses. The files that have been removed are: . |-- music | |-- cyrf_ogg_difficulties.ogg | `-- cyrf_ogg_proving_area.ogg | `--se |-- cursor18.wav |-- don18_d.wav |-- don20.wav `-- power34.wav And were copyrighted by: Music: 3104 types (http://www.geocities.jp/cyber_rainforce/): http://www.geocities.jp/cyber_rainforce/siyoukiyaku.html Sound: The Match-Makers (http://osabisi.sakura.ne.jp/m2/): http://879.hanac200x.jp/se/index.html -- Miriam Ruiz Sat, 25 Aug 2007 19:58:40 +0000 debian/tatan.xpm0000644000000000000000000000744512164040414011031 0ustar /* XPM */ static char * tatan_xpm[] = { "32 32 103 2", " c None", ". c #FFFF00", "+ c #BFFF40", "@ c #FCFF10", "# c #72FFAF", "$ c #00FFFF", "% c #6CFFBF", "& c #47FFBF", "* c #28FFFF", "= c #61FFBF", "- c #1CFFFF", "; c #6AFFBF", "> c #E0FF30", ", c #4BFFBF", "' c #4EFFBF", ") c #80FF80", "! c #37FFDF", "~ c #0EFFFF", "{ c #7EFF8F", "] c #40FFBF", "^ c #72FF9F", "/ c #F9FF10", "( c #C8FF50", "_ c #77FF8F", ": c #70FF8F", "< c #CAFF50", "[ c #73FFBF", "} c #B4FF80", "| c #E9FF30", "1 c #46FFCF", "2 c #F6FF10", "3 c #B2FF70", "4 c #07FFFF", "5 c #3EFFCF", "6 c #EBFF20", "7 c #E4FF30", "8 c #23FFEF", "9 c #1FFFEF", "0 c #7BFF8F", "a c #99FF80", "b c #EEFF20", "c c #5CFFCF", "d c #FBFF30", "e c #FBFF10", "f c #33FFEF", "g c #82FF9F", "h c #FEFF10", "i c #B1FF80", "j c #D9FF50", "k c #7DFF9F", "l c #F7FF40", "m c #92FF9F", "n c #7BFFAF", "o c #85FF8F", "p c #87FF80", "q c #F3FF40", "r c #27FFEF", "s c #1CFFEF", "t c #76FFBF", "u c #9CFF80", "v c #EEFF40", "w c #7EFF9F", "x c #79FFBF", "y c #A6FF80", "z c #E8FF40", "A c #C6FF40", "B c #AFFF80", "C c #ACFF80", "D c #E1FF40", "E c #DCFF40", "F c #E3FF40", "G c #9EFF80", "H c #B6FF80", "I c #FBFF20", "J c #60FFCF", "K c #D7FF40", "L c #DFFF40", "M c #BEFF50", "N c #4EFFDF", "O c #0AFFFF", "P c #CCFF40", "Q c #57FFCF", "R c #92FF8F", "S c #B0FF80", "T c #BDFF60", "U c #C1FF60", "V c #0CFFFF", "W c #69FF9F", "X c #1AFFEF", "Y c #2FFFEF", "Z c #AEFF80", "` c #EAFF40", " . c #97FF8F", ".. c #1DFFEF", "+. c #49FFDF", "@. c #CEFF60", "#. c #59FFAF", "$. c #83FF8F", "%. c #DEFF30", "&. c #67FF9F", "*. c #ADFF60", "=. c #65FFBF", "-. c #E2FF40", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . . + @ . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . # $ % . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . & $ * . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . = $ - . . . . . . . . . . . . . . . . . . . . . . ", ". . . . . . . ; $ - . . . . . . . . . . . . . . . . . . . . . . ", ". . . > , ' ) ! $ ~ { ] ] ^ / . . . . . ( _ ] ] : < . . . . . . ", ". . . [ $ $ $ $ $ $ $ $ $ $ } . . . | 1 $ $ $ $ $ $ 1 2 . . . . ", ". . . 3 4 $ $ $ $ $ $ 5 ] , 6 . . 7 8 $ $ 9 : 0 9 $ $ a . . . . ", ". . . . . b + c $ $ d . . . . . e f $ $ g h . . i $ $ j . . . . ", ". . . . . . . k $ $ l . . . . . m $ $ n . . . . o $ $ l . . . . ", ". . . . . . . p $ $ q . . . . . r $ s e . . . . t $ $ . . . . . ", ". . . . . . . u $ $ v . . . . v $ $ w . . . . . x $ - . . . . . ", ". . . . . . . y $ $ z . . . . A $ $ B . . . . . o $ - . . . . . ", ". . . . . . . C $ $ D . . . . A $ $ } . . . . . y $ - . . . . . ", ". . . . . . . i $ $ E . . . . F $ $ G . . . . . H $ 4 h . . . . ", ". . . . . . . } $ $ + . . . . I 4 $ J . . . . . K $ $ L . . . . ", ". . . . . . . } $ $ M . . . . . N $ O P . . . 2 Q $ $ R . . . . ", ". . . . . . . S $ $ T . . . . . U $ $ V W ) W X $ $ $ Y . . . . ", ". . . . . . . Z $ $ ` . . . . . . .4 $ $ $ $ $ ..+.$ $ @.. . . ", ". . . . . . . b #.$.. . . . . . . . %.p ] ] &.*.. @ =.X -.. . . ", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "}; debian/copyright0000644000000000000000000001313712164040414011122 0ustar This package was debianized by Miriam Ruiz . It was downloaded from http://hizuoka.web.fc2.com/game/tatan/index_en.html Upstream Author: HIZ Copyright: Copyright (C) 2007, HIZ import/SDL*: Copyright (C) 1997, 1998, 1999, 2000, 2001, Sam Lantinga import/bulletml.d: Copyright (C) 2004, Kenta Cho import/smpeg.d: import/MPEGfilter.d: Copyright (C) 1999 Loki Entertainment Software src/util/rand.d: Copyright (C) 2004, Kenta Cho Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, Copyright (C) 2003, Andrew C. Edwards License, converted from the original sjis encoding to utf8: 免責・著作・配布 柔かいコト  本ゲームは「みんなで楽しく」やわらかいです。  本ゲームを改造したりイジったバージョンを配布しても、何らOKです。改造たのしーい!  改造したところや改造した人の名前を、分かりやすいところに書いておくと  いいかもしれません。  ナイスな改造が出来たら メールなどで教えて。俺にも遊ばせてください。  改造とか一切してないものは好きにコピーして配布しちゃって結構結構。 Translation: This game is under the "Yawaraka(flexible)" license. You can freely modify and redistribute it. Conversions are really Fun! You should write the changes and the person who did them in the readme file or in a place that was obvious to find. If you could make a cool modification, please tell me via mail or by any other means. Let me enjoy your changes too. If you have not done any modifications, you can freely distribute without problems. According to the author of the game: "Their licenses are permitting everything if you write my name anywhere on the readme." "Sending E-mails is not a duty. This license has no duty. It says, 'You can do you likes.' It's not a strict license, it's like the word of 'game hell'(game creater's community I belong to). Please feel free to modify and distribute." 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 version 2 can be found in `/usr/share/common-licenses/LGPL-2'. import/smpeg.d: import/MPEGfilter.d: 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 General Pubic License version 2 can be found in `/usr/share/common-licenses/GPL-2'. src/util/rand.d: 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. 3. The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT OWNER 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. The Debian packaging is Copyright (C) 2007, Miriam Ruiz and is licensed under the GPL, see `/usr/share/common-licenses/GPL-3'. debian/menu0000644000000000000000000000020712164040414010050 0ustar ?package(tatan):needs="X11" section="Games/Action"\ title="Tatan" command="/usr/games/tatan" \ icon="/usr/share/pixmaps/tatan.xpm" debian/tatan.60000644000000000000000000000263312164040414010364 0ustar .\" (c) 2007 Miriam Ruiz .\" (c) 2007 HIZ .\" .\" 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 "Tatan" "6" "" "" "" .SH "NAME" tatan \- pointing STG shooter game .SH "DESCRIPTION" Tatan is a shooter game with simplified controls: use the mouse to aim and shoot, and the space bar to toggle your position. You have to collect the yellow stars (or shoot the white ones circumscribed in spheres) for power ups. The game is played in some sort of quantum universe, and you are either positioned on the left or the right. .SH "SEE ALSO" You can find more about the game on its homepage: http://hizuoka.web.fc2.com/game/tatan/index_en.html .SH "AUTHOR" This game has been written by HIZ debian/changelog0000644000000000000000000000265612164040414011045 0ustar tatan (1.0.dfsg1-4) unstable; urgency=low * Ported to D language version 2 (closes: #707270) * Added build-depends on libphobos-dev * Updated upstream homepage * Switch dh-style minimal rules file * Conforms to standards 3.9.4 -- Peter De Wachter Sun, 30 Jun 2013 13:09:09 +0200 tatan (1.0.dfsg1-3) unstable; urgency=low * Team upload. * Explicitly build with D version 1 (closes: #653090) * Switch to format 3.0 (quilt) and drop build-dep on quilt * Provide build-arch and build-indep targets * Conforms to standards 3.9.2 -- Vincent Fourmond Sat, 07 Jan 2012 16:23:42 +0100 tatan (1.0.dfsg1-2) unstable; urgency=low [ Ansgar Burchardt ] * Remove deprecated Encoding key from .desktop file * debian/control: Change XS-Vcs-* to Vcs-* [ Peter De Wachter ] * Patched for changes in the D language. (Closes: #574315) -- Peter De Wachter Wed, 17 Mar 2010 23:47:52 +0100 tatan (1.0.dfsg1-1) unstable; urgency=low [ Miriam Ruiz ] * Initial release (Closes: #440923) * Thanks to Junichi Uekawa and to 角田慎一 for their help translating the license text. * Added DM-Upload-Allowed tag to control to allow uploads from Debian Maintainers. [ Jon Dowland ] * Added Homepage: control field to source stanza -- Miriam Ruiz Fri, 04 Jan 2008 16:16:00 +0000 debian/compat0000644000000000000000000000000212164040414010360 0ustar 9 debian/tatan.desktop0000644000000000000000000000021612164040414011663 0ustar [Desktop Entry] Type=Application Name=Tatan GenericName= Comment=HIZ's Tatan Icon=tatan Exec=tatan Terminal=false Categories=Game;ArcadeGame; debian/rules0000755000000000000000000000101112164040414010233 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://hizuoka.web.fc2.com/game/tatan/tatan.zip unzip tatan.zip rm tatan/*.dll rm tatan/*.exe rm tatan/lib/*.lib rm tatan/resource/*.RES rm `find tatan -name "*.obj"` rm tatan/music/* rm tatan/se/* tar cvfz ../tatan_1.0.dfsg1.orig.tar.gz tatan rm -rf tatan.zip tatan debian/control0000644000000000000000000000207712164040414010573 0ustar Source: tatan Section: games Priority: extra Maintainer: Debian Games Team Uploaders: Miriam Ruiz , Peter De Wachter Build-Depends: debhelper (>= 9), gdc (>= 4.8.1), libphobos-dev, libglu1-mesa-dev | libglu-dev, libgl1-mesa-dev | libgl-dev, libsdl1.2-dev, libsdl-mixer1.2-dev Build-Conflicts: libphobos-4.4-dev Standards-Version: 3.9.4 Homepage: http://hiz.fool.jp/hp/game/tatan/index_en.html Vcs-Svn: svn://anonscm.debian.org/pkg-games/packages/trunk/tatan/ Vcs-Browser: http://anonscm.debian.org/viewvc/pkg-games/packages/trunk/tatan/ Package: tatan Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: pointing STG shooter game Tatan is a shooter game with simplified controls: use the mouse to aim and shoot, and the space bar to toggle your position. You have to collect the yellow stars (or shoot the white ones circumscribed in spheres) for power-ups. . The game is played in some sort of quantum universe, and you are either positioned on the left or the right. debian/tatan-data.install0000644000000000000000000000023012164040414012563 0ustar #image usr/share/games/tatan/ music usr/share/games/tatan/ se usr/share/games/tatan/ voice usr/share/games/tatan/ #resource/font usr/share/games/tatan/ debian/patches/0000755000000000000000000000000012164040414010611 5ustar debian/patches/series0000644000000000000000000000011212164040414012020 0ustar imports.patch fixes.patch makefile.patch directories.patch dlang_v2.patch debian/patches/makefile.patch0000644000000000000000000000102612164040414013406 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 -name "*.d" -not -iname '*mpeg*' -not -iname 'sdl_ttf.d' | sort) +EXE=tatan + +all: $(EXE) + +$(EXE): $(DSRC) + $(GDC) -o $@ -Iimport -Isrc -Wno-deprecated $(DFLAGS) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(DSRC) -lSDL -lGLU -lGL -lSDL_mixer + +clean: + rm -f $(EXE) debian/patches/directories.patch0000644000000000000000000001301412164040414014145 0ustar # Copyright (C) 2007 Miriam Ruiz # Distributed under the same license as the game. See debian/copyright. Index: tatan-1.0/src/br/gamemanager.d =================================================================== --- tatan-1.0.orig/src/br/gamemanager.d 2007-09-05 14:30:40.000000000 +0000 +++ tatan-1.0/src/br/gamemanager.d 2007-09-05 14:30:45.000000000 +0000 @@ -142,7 +142,7 @@ collisionManager = new CollisionManager(1024); collisionManager.clear(); - Hell_loadTexture("back", "image/back.bmp"); + Hell_loadTexture("back", "/usr/share/games/tatan/image/back.bmp"); Hell_loadFont(); Sound_init(); @@ -453,7 +453,7 @@ public void start(){ count = 0; - back = SDL_LoadBMP( "image/back.bmp" ); + back = SDL_LoadBMP( "/usr/share/games/tatan/image/back.bmp" ); Sound_FadeOutMusic(1000); Index: tatan-1.0/src/br/screen.d =================================================================== --- tatan-1.0.orig/src/br/screen.d 2007-09-05 14:30:40.000000000 +0000 +++ tatan-1.0/src/br/screen.d 2007-09-05 14:30:45.000000000 +0000 @@ -185,7 +185,7 @@ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - Hell_loadTexture("back", "image/back.bmp"); + Hell_loadTexture("back", "/usr/share/games/tatan/image/back.bmp"); Hell_loadFont(); } public void saveBMP(char[] name){ Index: tatan-1.0/src/br/sound.d =================================================================== --- tatan-1.0.orig/src/br/sound.d 2007-09-05 14:30:40.000000000 +0000 +++ tatan-1.0/src/br/sound.d 2007-09-05 14:30:45.000000000 +0000 @@ -59,36 +59,36 @@ return ; } Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels); - chunk_star = Mix_LoadWAV("se/cursor18.wav"); - chunk_don = Mix_LoadWAV("se/don18_d.wav"); + chunk_star = Mix_LoadWAV("/usr/share/games/tatan/se/cursor18.wav"); + chunk_don = Mix_LoadWAV("/usr/share/games/tatan/se/don18_d.wav"); - chunk_miss = Mix_LoadWAV("se/don20.wav"); - chunk_speedup = Mix_LoadWAV("se/power34.wav"); - chunk_bomb = Mix_LoadWAV("se/bom13_c.wav"); - chunk_beep = Mix_LoadWAV("se/beep00.wav"); - chunk_warning = Mix_LoadWAV("se/emergency.wav"); - chunk_reverse = Mix_LoadWAV("se/hit_s03_a.wav"); - voice_0 = Mix_LoadWAV("voice/FREQ_A500_0.wav"); - voice_1 = Mix_LoadWAV("voice/FREQ_A500_1.wav"); - voice_2 = Mix_LoadWAV("voice/FREQ_A500_2.wav"); - voice_3 = Mix_LoadWAV("voice/FREQ_A500_3.wav"); - voice_4 = Mix_LoadWAV("voice/FREQ_A500_4.wav"); - voice_5 = Mix_LoadWAV("voice/FREQ_A500_5.wav"); - voice_6 = Mix_LoadWAV("voice/FREQ_A500_6.wav"); - voice_7 = Mix_LoadWAV("voice/FREQ_A500_7.wav"); - voice_8 = Mix_LoadWAV("voice/FREQ_A500_8.wav"); - voice_9 = Mix_LoadWAV("voice/FREQ_A500_9.wav"); - - - music1 = Mix_LoadMUS("music/cyrf_ogg_difficulties.ogg"); - music2 = Mix_LoadMUS("music/cyrf_ogg_proving_area.ogg"); - music3 = Mix_LoadMUS("music/FREQ_loop002.ogg"); - music4 = Mix_LoadMUS("music/mix_loop004_3.ogg"); - music5 = Mix_LoadMUS("music/division_bell.ogg"); - music6 = Mix_LoadMUS("music/untitled.ogg"); - music7 = Mix_LoadMUS("music/splash_intro.ogg"); - music8 = Mix_LoadMUS("music/splash_main.ogg"); - music9 = Mix_LoadMUS("music/transmigration.ogg"); + chunk_miss = Mix_LoadWAV("/usr/share/games/tatan/se/don20.wav"); + chunk_speedup = Mix_LoadWAV("/usr/share/games/tatan/se/power34.wav"); + chunk_bomb = Mix_LoadWAV("/usr/share/games/tatan/se/bom13_c.wav"); + chunk_beep = Mix_LoadWAV("/usr/share/games/tatan/se/beep00.wav"); + chunk_warning = Mix_LoadWAV("/usr/share/games/tatan/se/emergency.wav"); + chunk_reverse = Mix_LoadWAV("/usr/share/games/tatan/se/hit_s03_a.wav"); + voice_0 = Mix_LoadWAV("/usr/share/games/tatan/voice/FREQ_A500_0.wav"); + voice_1 = Mix_LoadWAV("/usr/share/games/tatan/voice/FREQ_A500_1.wav"); + voice_2 = Mix_LoadWAV("/usr/share/games/tatan/voice/FREQ_A500_2.wav"); + voice_3 = Mix_LoadWAV("/usr/share/games/tatan/voice/FREQ_A500_3.wav"); + voice_4 = Mix_LoadWAV("/usr/share/games/tatan/voice/FREQ_A500_4.wav"); + voice_5 = Mix_LoadWAV("/usr/share/games/tatan/voice/FREQ_A500_5.wav"); + voice_6 = Mix_LoadWAV("/usr/share/games/tatan/voice/FREQ_A500_6.wav"); + voice_7 = Mix_LoadWAV("/usr/share/games/tatan/voice/FREQ_A500_7.wav"); + voice_8 = Mix_LoadWAV("/usr/share/games/tatan/voice/FREQ_A500_8.wav"); + voice_9 = Mix_LoadWAV("/usr/share/games/tatan/voice/FREQ_A500_9.wav"); + + + music1 = Mix_LoadMUS("/usr/share/games/tatan/music/cyrf_ogg_difficulties.ogg"); + music2 = Mix_LoadMUS("/usr/share/games/tatan/music/cyrf_ogg_proving_area.ogg"); + music3 = Mix_LoadMUS("/usr/share/games/tatan/music/FREQ_loop002.ogg"); + music4 = Mix_LoadMUS("/usr/share/games/tatan/music/mix_loop004_3.ogg"); + music5 = Mix_LoadMUS("/usr/share/games/tatan/music/division_bell.ogg"); + music6 = Mix_LoadMUS("/usr/share/games/tatan/music/untitled.ogg"); + music7 = Mix_LoadMUS("/usr/share/games/tatan/music/splash_intro.ogg"); + music8 = Mix_LoadMUS("/usr/share/games/tatan/music/splash_main.ogg"); + music9 = Mix_LoadMUS("/usr/share/games/tatan/music/transmigration.ogg"); _Sound_PlayingMusic = -1; } Index: tatan-1.0/import/hell2.d =================================================================== --- tatan-1.0.orig/import/hell2.d 2007-09-05 14:31:43.000000000 +0000 +++ tatan-1.0/import/hell2.d 2007-09-05 14:32:30.000000000 +0000 @@ -68,7 +68,7 @@ static bool[] g_joyButton; static SDL_Joystick* g_joy; static int g_joyButtonNum; -static char[] FONT_PATH = "resource/font/font.bmp"; +static char[] FONT_PATH = "/usr/share/games/tatan/font/font.bmp"; static int fps_cnt; static int fps_view; debian/patches/dlang_v2.patch0000644000000000000000000024705512164040414013343 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/import/hell2.d +++ b/import/hell2.d @@ -1,15 +1,16 @@ -module util.hell2; +module hell2; private import std.string; +private import std.conv; private import std.file; private import std.path; private import std.cstream; -private import std.ctype; +private import std.ascii; private import std.math; -private import std.math2; private import std.c.stdio; private import std.format; private import std.utf; private import std.random; +private import std.algorithm; private import SDL; private import SDL_mixer; private import opengl; @@ -21,9 +22,9 @@ static int g_videoBpp; static int g_videoFlags; static SDL_Surface* g_screen; -static Texture [char[]] g_poolTexture; +static Texture [string] g_poolTexture; static Texture g_fontTexture; -static Mix_Chunk* [char[]] g_poolChunk; +static Mix_Chunk* [string] g_poolChunk; static Mix_Music* g_music = null; static SDL_Surface* [int] g_poolFont; static bool g_quit = false; @@ -32,7 +33,7 @@ static ubyte g_pressMouseButton = 0; static bool[SDLK_LAST] g_pressKeyButtonPrev; static bool[SDLK_LAST] g_pressKeyButton; -static const char[] g_logname = "run.log"; +static const string g_logname = "run.log"; // OpenGL //static GLUquadricObj* g_quadricObj; // 2次曲面オブジェクト @@ -68,7 +69,7 @@ static bool[] g_joyButton; static SDL_Joystick* g_joy; static int g_joyButtonNum; -static char[] FONT_PATH = "/usr/share/games/tatan/font/font.bmp"; +static string FONT_PATH = "/usr/share/games/tatan/font/font.bmp"; static int fps_cnt; static int fps_view; @@ -141,7 +142,7 @@ Hell_loadFont(); foreach(key; g_poolTexture.keys) { - char[] path = g_poolTexture[key].getPath(); + string path = g_poolTexture[key].getPath(); int mask[] = g_poolTexture[key].getMaskInfo(); Hell_loadTexture(key, path, [mask[0], mask[1], mask[2]]); } @@ -152,7 +153,7 @@ */ void _saveBmp() { - auto line = g_width*3; // スキャンライン + scope line = g_width*3; // スキャンライン // メモリ確保 scope pixels = new GLubyte[g_width*line]; // データ格納のサイズを設定 @@ -165,17 +166,19 @@ { for(int i = 0; i < line; i++) { - auto ptr1 = line*j + i; - auto ptr2 = line*(g_height-1-j) + i; - auto tmp = pixels[ptr1]; + scope ptr1 = line*j + i; + scope ptr2 = line*(g_height-1-j) + i; + scope tmp = pixels[ptr1]; pixels[ptr1] = pixels[ptr2]; pixels[ptr2] = tmp; } } - if(auto surface = SDL_CreateRGBSurfaceFrom( + + scope surface = SDL_CreateRGBSurfaceFrom( pixels.ptr, g_width, g_height, 24, line, - 0x000000ff, 0x0000ff00, 0x00ff0000, 0x00000000)) + 0x000000ff, 0x0000ff00, 0x00ff0000, 0x00000000); + if (surface) { SDL_SaveBMP(surface, "hellshot.bmp"); SDL_FreeSurface(surface); @@ -185,7 +188,7 @@ /** * SDL初期化 */ -void Hell_init(char[] caption, int width=640, int height=480, bool fullscreen=false) +void Hell_init(string caption, int width=640, int height=480, bool fullscreen=false) { if(g_init) return; g_width = width; @@ -222,7 +225,7 @@ // if(Mix_OpenAudio(44100, AUDIO_S16, 2, 8192) < 0) if(Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 2, 1024) < 0) { - throw new Error("Hell_init: " ~ toString(SDL_GetError())); + throw new Error("Hell_init: " ~ to!string(SDL_GetError())); } // ログ初期化 @@ -233,7 +236,7 @@ g_joy = SDL_JoystickOpen(0); if(!g_joy) { - throw new Error(toString(SDL_GetError())); + throw new Error(to!string(SDL_GetError())); } g_joyButtonNum = SDL_JoystickNumButtons(g_joy); g_joyButtonPrev = new bool[g_joyButtonNum]; @@ -284,10 +287,10 @@ */ void Hell_setCaption(...) { - char[] _caption = ""; + string _caption = ""; void _putc(dchar c) { - auto tmp = [c]; + scope tmp = [c]; _caption ~= toUTF8(tmp); } doFormat(&_putc, _arguments, _argptr); @@ -303,7 +306,7 @@ void _putc(dchar c) { fputc(c, stdout); - auto tmp = [c]; + scope tmp = [c]; append(g_logname, toUTF8(tmp)); } doFormat(&_putc, _arguments, _argptr); @@ -526,7 +529,7 @@ * @param key キー * @param path サウンドファイルのパス */ -void Hell_loadWAV(char[] key, char[] path) +void Hell_loadWAV(string key, string path) { if(key in g_poolChunk) { @@ -543,7 +546,7 @@ * @param loops ループ回数(-1で無限ループ) * @param channel チャンネル番号(-1であいているチャンネルを自動で使う) */ -void Hell_playWAV(char[] key, int loops=0, int channel=-1) +void Hell_playWAV(string key, int loops=0, int channel=-1) { if(!(key in g_poolChunk)) { throw new Error("Hell_playWAV: Has not exist key: " ~ key); } Mix_PlayChannel(channel, g_poolChunk[key], loops); @@ -562,7 +565,7 @@ * SEを破棄 * @param key キー(nullで全て破棄) */ -void Hell_disposeWAV(char[] key=null) +void Hell_disposeWAV(string key=null) { if(key is null) { @@ -585,30 +588,30 @@ * @param loops ループ回数(-1で無限ループ) * @param ms フェードイン時間(ms) */ -void Hell_playBgm(char[] path, int loops=-1, int ms=0) +void Hell_playBgm(string path, int loops=-1, int ms=0) { if(g_music) { Mix_HaltMusic(); Mix_FreeMusic(g_music); } - g_music = Mix_LoadMUS(cast(char*)(path ~ "\0")); + g_music = Mix_LoadMUS(cast(const(char)* )(path ~ "\0")); if(!g_music) { - throw new Error("Hell_playBgm: " ~ toString(SDL_GetError())); + throw new Error("Hell_playBgm: " ~ to!string(SDL_GetError())); } if(ms <= 0) { if(Mix_PlayMusic(g_music, loops) != 0) { - throw new Error("Hell_playBgm: " ~ toString(SDL_GetError())); + throw new Error("Hell_playBgm: " ~ to!string(SDL_GetError())); } } else { if(Mix_FadeInMusic(g_music, loops, ms) != 0) { - throw new Error("Hell_playBgm: " ~ toString(SDL_GetError())); + throw new Error("Hell_playBgm: " ~ to!string(SDL_GetError())); } } } @@ -830,7 +833,7 @@ * @param b マスク色(青) */ void Hell_drawTexture( - char[] key, + string key, float x, float y, int ox=0, int oy=0, int ow=0, int oh=0, float dx=1.0f, float dy=1.0f, @@ -879,7 +882,7 @@ /** * 中心座標を指定して描画 */ -void Hell_drawTextureEx(char[] key, float cx, float cy, int ox=0, int oy=0, int ow=0, int oh=0, float dx=1.0f, float dy=1.0f, float rot=0, ubyte r=255, ubyte g=255, ubyte b=255) +void Hell_drawTextureEx(string key, float cx, float cy, int ox=0, int oy=0, int ow=0, int oh=0, float dx=1.0f, float dy=1.0f, float rot=0, ubyte r=255, ubyte g=255, ubyte b=255) { if(!(key in g_poolTexture)) { throw new Error("Hell_drawTexture: Has not exist key: " ~ key); } Texture tex = g_poolTexture[key]; @@ -904,12 +907,12 @@ * @param b B成分 * @param a A成分 */ -void Hell_drawFont(char[] msg, int x, int y, float zoom=1.0f, ubyte r=0xff, ubyte g=0xff, ubyte b=0xff, ubyte a=0xff) +void Hell_drawFont(string msg, int x, int y, float zoom=1.0f, ubyte r=0xff, ubyte g=0xff, ubyte b=0xff, ubyte a=0xff) { const int WIDTH = 32; // フォントの幅 const int HEIGHT = 48; // フォントの高さ const int COLUMN = 16; // フォントテクスチャの一行の文字数 - char decoder[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.()[]#$%&'\"!?^+-*/=;:"; + string decoder = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.()[]#$%&'\"!?^+-*/=;:"; Texture tex = g_fontTexture; tex.bind(); glColor4ub(r, g, b, a); @@ -920,9 +923,9 @@ float h = HEIGHT * zoom; // 実際の高さ foreach(c; msg) { - if(!isascii(c)) continue; // ascii文字じゃないです - int idx = find(decoder, c); // 文字のインデックスを取得 - if(c == ' ' | idx < 0) + if(!isASCII(c)) continue; // ascii文字じゃないです + ptrdiff_t idx = countUntil(decoder, c); // 文字のインデックスを取得 + if((c == ' ') | (idx < 0)) { x += cast(int)(WIDTH * zoom); // スペース continue; @@ -951,10 +954,10 @@ void Hell_drawFontEx(int x, int y, float zoom=1.0f, ubyte r=0xff, ubyte g=0xff, ubyte b=0xff, ubyte a=0xff, ...) { - char[] _tmpString = ""; + string _tmpString = ""; void _putc(dchar c) { - auto tmp = [c]; + scope tmp = [c]; _tmpString ~= toUTF8(tmp); } doFormat(&_putc, _arguments, _argptr); @@ -1019,7 +1022,7 @@ x = 10; y = g_height - 48; // フォントの高さ } - Hell_drawFont("FPS:" ~ toString(Hell_getFPS()), x, y); + Hell_drawFont("FPS:" ~ to!string(Hell_getFPS()), x, y); } @@ -1029,7 +1032,7 @@ * @param filepath ファイルパス * @param mask 抜き色(mask[0]に「-1」で抜き色なし。「-2」で座標指定) */ -void Hell_loadTexture(char[] key, char[] filepath, int[3] mask=[-1, 0, 0]) +void Hell_loadTexture(string key, string filepath, int[3] mask=[-1, 0, 0]) { //if(key in g_poolTexture) { throw new Error("Hell_loadTexture: Has exist key: " ~ key); } if(key in g_poolTexture) @@ -1037,7 +1040,6 @@ // 同じキーがある場合、そのテクスチャを破棄 Hell_disposeTexture(key); } - if(mask is null) { throw new Error("Hell_loadTexture: PARAMETER 'mask' is null"); } if(mask[0] >= 0) { // 抜き色指定 @@ -1063,7 +1065,7 @@ * テクスチャの破棄 * @param key キー(Hell_loadTextureで指定したもの)「null」で全て破棄 */ -public void Hell_disposeTexture(char[] key=null) +public void Hell_disposeTexture(string key=null) { if(key is null) { @@ -1104,7 +1106,7 @@ /** * パス */ - char[] _path; + string _path; /** * マスク情報 */ @@ -1116,7 +1118,7 @@ * @param filename ファイルパス * @param maskColor 抜き色 */ - this(char[] filename) + this(string filename) { _maskInfo = [-1, 0, 0]; SDL_Surface* s = loadBMP(filename); @@ -1127,7 +1129,7 @@ * @param filename ファイルパス * @param maskColor 抜き色 */ - this(char[] filename, int r, int g, int b) + this(string filename, int r, int g, int b) { _maskInfo = [r, g, b]; SDL_Surface* s = loadBMP(filename); @@ -1140,7 +1142,7 @@ * @param filename ファイルパス * @param maskColor 抜き色 */ - this(char[] filename, int x, int y) + this(string filename, int x, int y) { _maskInfo = [-2, x, y]; SDL_Surface* s = loadBMP(filename); @@ -1155,7 +1157,7 @@ } create(s); } - char[] getPath() { return _path; } + string getPath() { return _path; } int[] getMaskInfo() { return _maskInfo; } /** * 生成 @@ -1204,7 +1206,7 @@ /** * BMP読み込み */ - SDL_Surface* loadBMP(char[] filename) + SDL_Surface* loadBMP(string filename) { // ファイルパス _path = filename; @@ -1254,11 +1256,11 @@ float Hell_sin(float rad) { return sin(rad); } float Hell_cos(float rad) { return cos(rad); } float Hell_atan2(float y, float x) { return atan2(y, x); } -float Hell_sinEx(float deg) { return sin(deg2rad(deg)); } -float Hell_cosEx(float deg) { return cos(deg2rad(deg)); } -float Hell_atan2Ex(float y, float x) { return rad2deg(atan2(y, x)); } -float Hell_deg2rad(float deg) { return deg2rad(deg); } -float Hell_rad2deg(float rad) { return rad2deg(rad); } +float Hell_sinEx(float deg) { return sin(deg/180*PI); } +float Hell_cosEx(float deg) { return cos(deg/180*PI); } +float Hell_atan2Ex(float y, float x) { return atan2(y, x)/PI*180; } +float Hell_deg2rad(float deg) { return deg/180*PI; } +float Hell_rad2deg(float rad) { return rad/PI*180; } // 乱数 /** * 乱数の初期化 @@ -1269,18 +1271,18 @@ * @param seed 種 * @param index 次の乱数インデックスへの増分 */ -void Hell_randSeed(uint seed, uint index) -{ - rand_seed(seed, index); -} +//void Hell_randSeed(uint seed, uint index) +//{ +// rand_seed(seed, index); +//} /** * begin <= x < endの範囲で乱数を生成 * @param begin 開始値 * @param end 終了値 */ -int Hell_randInt(int begin, int end) -{ - auto range = end - begin; - if(range < 1) return -1; - return begin + rand()%range; -} +//int Hell_randInt(int begin, int end) +//{ +// scope range = end - begin; +// if(range < 1) return -1; +// return begin + rand()%range; +//} --- a/src/br/background.d +++ b/src/br/background.d @@ -3,6 +3,7 @@ private import opengl; private import std.math; private import std.string; +private import std.conv; private import util.vector; private import util.parts; private import br.screen; @@ -50,7 +51,7 @@ G=177.0f/255.0f; B=205.0f/255.0f; } - public void set(){ + public override void set(){ for(float z = -400;-1200= divsp(100)){ for(float z = -400;-1200= divsp(33)){ for(float z = -400;-1200ship.rpos.y-20.0){ @@ -287,4 +287,4 @@ -} \ No newline at end of file +} --- a/src/br/enemy.d +++ b/src/br/enemy.d @@ -18,7 +18,7 @@ private import br.sound; -public Enemy makeEnemy(char[] type ,Vector3 pos ,Vector3 vel ,Object par){ +public Enemy makeEnemy(string type ,Vector3 pos ,Vector3 vel ,Object par){ Enemy e = null; switch(type){ @@ -71,7 +71,7 @@ dam = 0; } - public void move(){ + public override void move(){ super.move(); if(border && (rpos.y+size < screen.GAME_DOWN || screen.GAME_UP < rpos.y-size || screen.GAME_RIGHT < rpos.x-size || rpos.x+size < screen.GAME_LEFT || @@ -110,7 +110,7 @@ } - public void attack(char[] type){} + public void attack(string type){} public void damage(float d){ double dd; dd = 1.0; @@ -127,7 +127,7 @@ dam = fmin(3.0 ,dam+dd); } - public void destroy(){ + public override void destroy(){ super.destroy(); destroyImpl(); @@ -146,11 +146,11 @@ public void setBossColor(){ R = 1.0;G =1.0;B = 1.0;alpha = 1.0; } - public void size(double s){ + public override void size(double s){ super.size(s); collisionRange = size / 2.0f; } - public double size(){ + public override double size(){ return super.size(); } } @@ -178,7 +178,7 @@ this.vc = vc; } - public void move(){ + public override void move(){ @@ -197,7 +197,7 @@ if(vanishCount < 0)destroy(); } } - public void damage(float d){ + public override void damage(float d){ if(vincible){ hp -= d; if(hp <= 0)destroy(); @@ -205,7 +205,7 @@ (cast(Enemy)parent).damage(d); } } - public void destroy(){ + public override void destroy(){ super.destroy(); // makeParticle(shape, size ,WIRE ,rpos ,new Vector3() ,rpose ,R ,G ,B ,alpha); } @@ -219,7 +219,7 @@ pre = new Vector3(); rpos = new Vector3(); } - public void move(){ + public override void move(){ pre = cast(Vector3)rpos.clone(); super.move(); if(rpos.dist(pre) > 10.0f){ @@ -232,7 +232,7 @@ public this(Shape shape ,double size ,float hp = -1 ,double R = 1.0,double G = 1.0 ,double B = 1.0,double alpha = -1.0){ super(shape,size,hp,R,G,B,alpha); } - public void attack(char[] type){ + public override void attack(string type){ switch(type){ case "a": double rad = poseDirection(); @@ -251,7 +251,7 @@ public this(Shape shape ,double size ,float hp = -1 ,double R = 1.0,double G = 1.0 ,double B = 1.0,double alpha = -1.0){ super(shape,size,hp,R,G,B,alpha); } - public void attack(char[] type){ + public override void attack(string type){ switch(type){ case "laser": Vector3 aim = new Vector3(0.0f ,-100.0f ,-800.0f)-rpos; @@ -328,7 +328,7 @@ setFlyColor(); } - public void move(){ + public override void move(){ super.move(); /* if(cnt == 60){ @@ -348,7 +348,7 @@ // poseY += mulsp(1f); } - public void attack(char[] type){ + public override void attack(string type){ // Vector3 v = vec3Normalize(ship.rpos -rpos) * 1.0f; // new Bullet(rpos ,v); } @@ -368,7 +368,7 @@ protected static Shape setShape(){ return new SH_Sphere(6); } - public void move(){ + public override void move(){ super.move(); poseY += mulsp(1f); poseX += mulsp(2f); @@ -386,7 +386,7 @@ super(pos ,vel ,hp ,size); shape = getShape();//Cube.getShape(); } - public void move(){ + public override void move(){ super.move(); poseX += mulsp(2f); } @@ -406,7 +406,7 @@ super(pos ,vel ,hp); shape = getShape();//Cube.getShape(); } - public void move(){ + public override void move(){ super.move(); vel *= 1.0f + mulsp(0.02f); poseX += mulsp(2f); @@ -449,7 +449,7 @@ super(pos ,vel ,hp); shape = getShape(); } - public void move(){ + public override void move(){ super.move(); poseZ += mulsp(1f); // poseX += 1.0f; @@ -465,7 +465,7 @@ super(pos ,vel ,hp); shape = getShape(); } - public void move(){ + public override void move(){ super.move(); poseZ += mulsp(1f); vel *= 1.0f + mulsp(0.02f); @@ -479,7 +479,7 @@ super(pos ,vel ,hp ,size); shape = getShape(); } - public void move(){ + public override void move(){ super.move(); poseZ += mulsp(1f); vel *= 1.0f - mulsp(0.02f); @@ -490,7 +490,7 @@ // poseX += 1.0f; // vel *= 1.0f + mulsp(0.02f); } - public void attack(char[] type){ + public override void attack(string type){ Vector3 vel = vec3Normalize(ship.rpos-rpos); new AccBullet(rpos ,new Vector3(),vel*0.03); @@ -515,7 +515,7 @@ this.aimBin = aim; maxhp = hp; } - public void move(){ + public override void move(){ super.move(); // poseZ += mulsp(1f); // vel *= 1.0f - mulsp(0.02f); @@ -530,7 +530,7 @@ // poseX += 1.0f; // vel *= 1.0f + mulsp(0.02f); } - public void attack(char[] type){ + public override void attack(string type){ if(num > 0){ child = new MylmidonCell(new Vector3(),0.0,aimBin,num-1,hp,size); if(!par){ @@ -567,7 +567,7 @@ setFlyColor(); } - public void move(){ + public override void move(){ super.move(); if(cnt == divsp(60)){ attack("a"); @@ -579,7 +579,7 @@ poseX += mulsp(2f); // poseY += 1f; } - public void attack(char[] type){ + public override void attack(string type){ // Vector3 v = vec3Normalize(ship.rpos -rpos) * 1.0f; // new Bullet(rpos ,v); } @@ -607,16 +607,16 @@ R = 1.0;G =1.0;B = 0.8;alpha = 1.0; } - public void move(){ + public override void move(){ super.move(); pos += mulsp(vel); poseZ += mulsp(3f); } - public void attack(char[] type){ + public override void attack(string type){ } - public void destroy(){ + public override void destroy(){ new Star2(rpos ,new Vector3()); super.destroy(); @@ -646,7 +646,7 @@ setFlyColor(); } - public void move(){ + public override void move(){ super.move(); pos += mulsp(vel); vel += mulsp(acc); @@ -654,7 +654,7 @@ poseX += mulsp(2f); poseY += mulsp(1f); } - public void attack(char[] type){ + public override void attack(string type){ } @@ -681,7 +681,7 @@ setFlyColor(); } - public void move(){ + public override void move(){ super.move(); if(cnt % divsp(60)==0)attack("a"); @@ -691,7 +691,7 @@ poseX += mulsp(2f); poseY += mulsp(1f); } - public void attack(char[] type){ + public override void attack(string type){ Vector3 v = new Vector3(0.0f ,-3.0f ,0.0f);//new Vector3(cos(rad)*6.0f ,-4.0f ,0.0f);//sin(rad)*6.0f,0.0f);; for(double y=0.0;y<100.0f;y+=30.0f){ @@ -735,7 +735,7 @@ setFlyColor(); } - public void move(){ + public override void move(){ super.move(); pos += mulsp(vel); @@ -744,7 +744,7 @@ poseX += mulsp(2f); // poseY += mulsp(1f); } - public void attack(char[] type){ + public override void attack(string type){ /* Vector3 v = new Vector3(0.0f ,-3.0f ,0.0f);//new Vector3(cos(rad)*6.0f ,-4.0f ,0.0f);//sin(rad)*6.0f,0.0f);; for(double y=0.0;y<100.0f;y+=30.0f){ @@ -791,7 +791,7 @@ stop = 0; stopped = false; } - public void move(){ + public override void move(){ super.move(); if(stop<=0){ @@ -811,7 +811,7 @@ // poseY += mulsp(2f); // poseY += mulsp(1f); } - public void attack(char[] type){ + public override void attack(string type){ double rad = (-90.0 + (rand.nextFloat(20)-10.0))/180.0*PI; Vector3 v = new Vector3(cos(rad) ,sin(rad) ,0.0f);//new Vector3(cos(rad)*6.0f ,-4.0f ,0.0f);//sin(rad)*6.0f,0.0f);; @@ -843,7 +843,7 @@ setFlyColor(); } - public void move(){ + public override void move(){ super.move(); if(cnt == divsp(45))attack("a"); @@ -853,7 +853,7 @@ poseX += mulsp(2f); poseY += mulsp(1f); } - public void attack(char[] type){ + public override void attack(string type){ Vector3 v = vec3Normalize(ship.rpos-rpos); for(double y=0.0;y<50.0f;y+=20.0f){ @@ -885,7 +885,7 @@ setFlyColor(); } - public void move(){ + public override void move(){ super.move(); if(cnt == divsp(60))attack("a"); @@ -896,7 +896,7 @@ poseX += mulsp(2f); poseY += mulsp(1f); } - public void attack(char[] type){ + public override void attack(string type){ new AccBullet(rpos ,new Vector3(),vec3Normalize(ship.rpos - rpos) * 0.05f); @@ -932,7 +932,7 @@ setFlyColor(); } - public void move(){ + public override void move(){ super.move(); /* if(cnt == divsp(120)){ @@ -947,11 +947,11 @@ poseZ += mulsp(2f); // poseY += mulsp(1f); } - public void destroy(){ + public override void destroy(){ super.destroy(); attack("a"); } - public void attack(char[] type){ + public override void attack(string type){ new AccBullet(rpos ,new Vector3(0.0f ,0.0f ,0.0f),new Vector3(0.0f,-0.1f,0.0f)); } @@ -990,7 +990,7 @@ setMiddleColor(); } - public void move(){ + public override void move(){ super.move(); if(cnt % divsp(20) == 0 && cnt < divsp(80)){ attack("a"); @@ -1001,7 +1001,7 @@ poseX += mulsp(2f); // poseY += mulsp(1f); } - public void attack(char[] type){ + public override void attack(string type){ Vector3 v;//vec3Normalize(ship.rpos -rpos) * 1.0f; for(double rad=-PI/2.0-PI/12.0;rad<=-PI/2.0+PI/11.0;rad+=PI/12.0){ v = new Vector3(cos(rad) ,sin(rad) ,0.0f)*2.0f; @@ -1044,7 +1044,7 @@ setMiddleColor(); } - public void move(){ + public override void move(){ super.move(); if(cnt % divsp(3) == 0){ attack("a"); @@ -1058,7 +1058,7 @@ // poseY += mulsp(1f); } - public void attack(char[] type){ + public override void attack(string type){ double rad; if(rpos.x<0)rad = -cast(double)cnt /720.0 * PI; else rad = PI + cast(double)cnt /720.0 * PI; @@ -1101,7 +1101,7 @@ } - public void move(){ + public override void move(){ super.move(); if(rpos.y < 0)pos += mulsp(vel/2.0); else pos += mulsp(vel*(rpos.y+screen.GAME_UP)/(screen.GAME_UP*2.0)); @@ -1110,7 +1110,7 @@ // poseY += mulsp(1f); } - public void attack(char[] type){ + public override void attack(string type){ } --- a/src/br/gamemanager.d +++ b/src/br/gamemanager.d @@ -185,7 +185,7 @@ setNextState("game"); } - public void setNextState(char[] name){ + public void setNextState(string name){ switch(name){ case "game":nextState = inGameState;break; case "title":nextState = inTitleState;break; @@ -262,7 +262,7 @@ public void move(); public void draw(); // public bool end(); - public char[] name(); + public string name(); } public class InGameState:GameState{ @@ -272,11 +272,11 @@ int endCount; bool endFlag; - const char[] _name = "gameState"; + const string _name = "gameState"; public this(){ } - public void start(){ + public override void start(){ count = 0; endCount = -1; @@ -288,7 +288,7 @@ // _end = false; } - public void move(){ + public override void move(){ if(!endFlag){ if(stage.complete){ stagenum = stagenum + 1; @@ -345,7 +345,7 @@ } - public void draw(){ + public override void draw(){ screen.setModelView(); screen.clear(); glLoadIdentity(); @@ -436,7 +436,7 @@ return _end; } */ - public char[] name(){ + public override string name(){ return _name; } } @@ -446,11 +446,11 @@ int count; SDL_Surface *back; - const char[] _name = "titleState"; + const string _name = "titleState"; public this(){ } - public void start(){ + public override void start(){ count = 0; back = SDL_LoadBMP( "/usr/share/games/tatan/image/back.bmp" ); @@ -461,7 +461,7 @@ // _end = false; } - public void move(){ + public override void move(){ /* if(stage.complete){ stagenum = stagenum + 1; @@ -500,7 +500,7 @@ } - public void draw(){ + public override void draw(){ @@ -586,7 +586,7 @@ return _end; } */ - public char[] name(){ + public override string name(){ return _name; } } @@ -626,7 +626,7 @@ // _gameSpeed = 1.0f; /* - switch(rank){ + switch(rank){ default: break; case 0:_gameSpeed = 0.8;break; case 1:_gameSpeed = 1.0;break; case 2:_gameSpeed = 1.2;break; @@ -695,4 +695,4 @@ public int stagenum(){ return _stagenum; -} \ No newline at end of file +} --- a/src/br/mainloop.d +++ b/src/br/mainloop.d @@ -188,4 +188,4 @@ } } - \ No newline at end of file + --- a/src/br/particleImpl.d +++ b/src/br/particleImpl.d @@ -11,7 +11,7 @@ private import util.log; public class ParticleImpl:Particle{ - public void draw(){ + public override void draw(){ // glDisable(GL_BLEND); //glLoadIdentity(); @@ -147,7 +147,7 @@ average = average / cast(double)v.length; - foreach(inout Vector3 vec;v){ + foreach(ref Vector3 vec;v){ vec = vec - average; } @@ -228,7 +228,7 @@ public this() { maxParticle = 16; particles.length = maxParticle; - foreach(inout ParticleImpl p;particles){ + foreach(ref ParticleImpl p;particles){ p = new ParticleImpl(); } //parts = new List!(Parts)(); @@ -238,7 +238,7 @@ public this(int n) { maxParticle = n; particles.length = maxParticle; - foreach(inout ParticleImpl p;particles){ + foreach(ref ParticleImpl p;particles){ p = new ParticleImpl(); } //parts = new List!(Parts)(); @@ -291,7 +291,7 @@ public void clear() { - foreach(inout ParticleImpl a;particles){ + foreach(ref ParticleImpl a;particles){ if(a !is null && a.exists){ a.vanish(); } @@ -299,4 +299,4 @@ //parts.length = 0; particleIdx = 0; } -} \ No newline at end of file +} --- a/src/br/screen.d +++ b/src/br/screen.d @@ -4,6 +4,7 @@ private import SDL; private import hell2; private import std.string; +private import std.conv; private import std.c.stdlib; private import br.mainloop; @@ -42,7 +43,7 @@ if(SDL_Init( SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0 ) { throw new Exception( - "Unable to init SDL video: " ~ std.string.toString(SDL_GetError())); + "Unable to init SDL video: " ~ to!string(SDL_GetError())); } //info = SDL_GetVideoInfo( ); @@ -147,7 +148,7 @@ if (error == GL_NO_ERROR) return; closeSDL(); - throw new Exception("OpenGL error(" ~ std.string.toString(error) ~ ")"); + throw new Exception("OpenGL error(" ~ to!string(error) ~ ")"); } public void closeSDL() { close(); @@ -188,7 +189,7 @@ Hell_loadTexture("back", "/usr/share/games/tatan/image/back.bmp"); Hell_loadFont(); } - public void saveBMP(char[] name){ + public void saveBMP(string name){ SDL_SaveBMP(gScreenSurface, "screenshot.bmp"); } -} \ No newline at end of file +} --- a/src/br/ship.d +++ b/src/br/ship.d @@ -130,11 +130,11 @@ else screen.setClearColor(0.04 ,0.06 ,0.09 ,1.0); */ } - public void addChild(inout Parts child,char[] name, double dist = 0.1, int childKind = NORMAL, Matrix link = null ,Matrix pose = null){ + public override void addChild(ref Parts child,string name, double dist = 0.1, int childKind = NORMAL, Matrix link = null ,Matrix pose = null){ super.addChild(child ,name ,dist ,childKind ,link ,pose); } - public void move(){ + public override void move(){ super.move(); double speed; @@ -257,7 +257,7 @@ new Shot(rpos+vel * 70.0f ,vel * 30.0f ,deg);//deg); } } - public void draw(){ + public override void draw(){ if((invincible > 0) && (cnt % 20 < 10))drawing = WIRE; else drawing = WIRE | POLYGON; super.draw(); @@ -278,7 +278,7 @@ } */ - public void reportCollision(int kind ,Parts p){ + public override void reportCollision(int kind ,Parts p){ switch(kind){ case CollisionManager.kind.STAR: // if(R <= 0.9f)R += 0.1f; @@ -306,7 +306,7 @@ } - public void destroy(){ + public override void destroy(){ super.destroy(); miss = true; makeParticle(shape, size ,WIRE | POLYGON ,rpos ,new Vector3() ,rpose ,R ,G ,B ,wR,wG,wB,alpha); @@ -349,4 +349,4 @@ poseZ = rposeZ = 90.0; } -} \ No newline at end of file +} --- a/src/br/sound.d +++ b/src/br/sound.d @@ -213,4 +213,4 @@ public int Sound_PlayingMusic(){ if(Mix_PlayingMusic() == 0)_Sound_PlayingMusic = -1; return _Sound_PlayingMusic; -} \ No newline at end of file +} --- a/src/br/stage.d +++ b/src/br/stage.d @@ -65,8 +65,8 @@ Sound_FadeOutMusic(1000); }else Sound_FadeInMusic(music, 2000); } - public void addEnemyData(int time ,char[] type ,float posx ,float posy ,float v ,double angle ,Object par = null ,bool target=false){ - ObjectData e = new ObjectData(time ,type.dup ,new Vector3(posx ,posy ,-800) + public void addEnemyData(int time ,string type ,float posx ,float posy ,float v ,double angle ,Object par = null ,bool target=false){ + ObjectData e = new ObjectData(time ,type ,new Vector3(posx ,posy ,-800) ,new Vector3(v*cos(angle*PI/180.0) ,v*sin(angle*PI/180.0) ,0.0f) ,par ,target); if(enemyNum < enemyData.length)enemyData[enemyNum] = e; else{ @@ -75,8 +75,8 @@ } enemyNum ++; } - public void addWallData(int time ,char[] type ,float posx ,float posy ,float v ,double angle = -90.0 ,Object par = null){ - ObjectData w = new ObjectData(time ,type.dup ,new Vector3(posx ,posy ,-800) + public void addWallData(int time ,string type ,float posx ,float posy ,float v ,double angle = -90.0 ,Object par = null){ + ObjectData w = new ObjectData(time ,type ,new Vector3(posx ,posy ,-800) ,new Vector3(v*cos(angle*PI/180.0) ,v*sin(angle*PI/180.0) ,0.0f) ,par); if(wallNum < wallData.length)wallData[wallNum] = w; else{ @@ -229,15 +229,15 @@ } public class ObjectData{ public int time; - public char[] type; + public string type; public Vector3 pos; public Vector3 vel; public Object par; public bool target; public bool made; - public this(int time ,char[] type ,Vector3 pos ,Vector3 vel ,Object par = null ,bool target = false){ + public this(int time ,string type ,Vector3 pos ,Vector3 vel ,Object par = null ,bool target = false){ this.time = time; - this.type = type.dup; + this.type = type; this.pos = cast(Vector3)pos.clone(); this.vel = cast(Vector3)vel.clone(); this.par =par; @@ -262,10 +262,10 @@ bg = new Back1(); } - void setSound(){ + override void setSound(){ music = music_kind.MUSIC1; } - void setEnemies(){ + override void setEnemies(){ // addEnemyData(30 ,"laser" ,0 ,240 ,1.0 ,-90); @@ -316,7 +316,7 @@ } - void setWalls(){ + override void setWalls(){ /* for(int i=0;i<1200;i+=240){ addWallData(i ,"1" ,rand.nextFloat(Screen.GAME_RIGHT - Screen.GAME_LEFT) + Screen.GAME_LEFT ,240 ,3 ); @@ -324,7 +324,7 @@ */ } - void setStars(){ + override void setStars(){ for(int i=0;i<300;i+=60){ addStarData(60 ,(i/60)%2); } @@ -353,10 +353,10 @@ bg = new Back2(); } - void setSound(){ + override void setSound(){ music = music_kind.MUSIC1; } - void setEnemies(){ + override void setEnemies(){ @@ -476,7 +476,7 @@ } - void setWalls(){ + override void setWalls(){ addWallData(260,null,0,0,0); makeCource(true ,100 ,160 ,3.0f ,1 ,2); addWallData(30,null,0,0,0); @@ -504,7 +504,7 @@ */ } - void setStars(){ + override void setStars(){ for(int i=0;i<160;i+=60){ addStarData(60 ,(i/60)%2); } @@ -587,21 +587,21 @@ bg = new Back3(); } - void setSound(){ + override void setSound(){ music = music_kind.MUSIC2; } - void setEnemies(){ + override void setEnemies(){ addEnemyData(210 ,"boss3" ,0 ,160 ,0 ,0 ,null ,true); } - void setWalls(){ + override void setWalls(){ } - void setStars(){ + override void setStars(){ } @@ -614,19 +614,19 @@ bg = new Back2(); } - void setSound(){ + override void setSound(){ music = -1; } - void setEnemies(){ + override void setEnemies(){ } - void setWalls(){ + override void setWalls(){ } - void setStars(){ + override void setStars(){ } --- a/src/br/wall.d +++ b/src/br/wall.d @@ -8,7 +8,7 @@ private import br.mainloop; private import br.gamemanager; -public void makeWall(char[] type ,Vector3 pos ,Vector3 vel ,Object par = null){ +public void makeWall(string type ,Vector3 pos ,Vector3 vel ,Object par = null){ switch(type){ case "1" : new Wall1(pos ,vel); @@ -38,7 +38,7 @@ // hp = 3; } - public void move(){ + public override void move(){ super.move(); if((rpos.y+size < screen.GAME_DOWN || screen.GAME_UP < rpos.y-size || screen.GAME_RIGHT < rpos.x-size || rpos.x+size < screen.GAME_LEFT || @@ -58,7 +58,7 @@ } } - public void destroy(){ + public override void destroy(){ super.destroy(); // makeParticle(shape, size ,WIRE ,rpos ,new Vector3() ,rpose ,R ,G ,B ,alpha); @@ -81,7 +81,7 @@ poseZ = atan2(vel.y,vel.x)*180.0/PI; } - public void move(){ + public override void move(){ super.move(); pos += mulsp(vel); @@ -89,4 +89,4 @@ poseX += mulsp(2f); } -} \ No newline at end of file +} --- a/src/util/actor.d +++ b/src/util/actor.d @@ -1,3 +1,4 @@ +module util.actor; private import opengl; public abstract class Actor{ private bool _exists; @@ -18,7 +19,7 @@ public: Actor[] actor; protected: - int actorIdx = 0; + ptrdiff_t actorIdx = 0; const int maxActor; public this() { maxActor = 16; @@ -74,7 +75,7 @@ } /* public void allDestroy() { - foreach(inout Actor a;actor){ + foreach(ref Actor a;actor){ if(a !is null && a.exists){ a.destroy(); } @@ -84,7 +85,7 @@ } */ public void clear(){ - foreach(inout Actor a;actor){ + foreach(ref Actor a;actor){ if(a !is null && a.exists){ a.vanish(); } @@ -93,4 +94,4 @@ actorIdx = 0; } -} \ No newline at end of file +} --- a/src/util/animation.d +++ b/src/util/animation.d @@ -113,7 +113,7 @@ public void clear() { - foreach(inout Animation a;animes){ + foreach(ref Animation a;animes){ if(a !is null && a.exists){ a.vanish(); } --- a/src/util/ascii.d +++ b/src/util/ascii.d @@ -29,15 +29,15 @@ } private: const int[] bar_a = [0 ,2 ,3 ,4 ,5 ,6]; -const int[] bar_b = [ ,1 ,3 ,4 ,5 ,6]; +const int[] bar_b = [ 1 ,3 ,4 ,5 ,6]; const int[] bar_c = [0 ,1 ,4 ,6]; const int[] bar_d = [ 2 ,3 ,4 ,5 ,6]; const int[] bar_e = [0 ,1 ,2 ,3 ,4 ,6]; const int[] bar_f = [0 ,1 ,3 ,4 ]; const int[] bar_g = [0 ,1 ,2 ,3 ,5 ,6]; const int[] bar_h = [ 1 ,3 ,4 ,5 ]; -const int[] bar_i = [ ,2 ,5 ]; -const int[] bar_j = [ ,2 ,5 ,6]; +const int[] bar_i = [ 2 ,5 ]; +const int[] bar_j = [ 2 ,5 ,6]; const int[] bar_k = [ 1 ,3 ,4 ,6]; const int[] bar_l = [ 1 ,4 ,6]; const int[] bar_m = [0 ,1 ,3 ,4 ,6]; @@ -45,17 +45,17 @@ const int[] bar_o = [0 ,1 ,2 ,4 ,5 ,6]; const int[] bar_p = [0 ,1 ,2 ,3 ,4 ]; const int[] bar_q = [0 ,1 ,2 ,3 ,5 ]; -const int[] bar_r = [ ,3 ,4 ]; +const int[] bar_r = [ 3 ,4 ]; const int[] bar_s = [0 ,1 ,3 ,5 ,6]; const int[] bar_t = [0 ,1 ,4 ]; const int[] bar_u = [ 1 ,2 ,4 ,5 ,6]; -const int[] bar_v = [ ,4 ,5 ,6]; +const int[] bar_v = [ 4 ,5 ,6]; const int[] bar_w = [0 ,2 ,3 ,5 ,6]; const int[] bar_x = [ 1 ,2 ,3 ,4 ,5 ]; const int[] bar_y = [ 1 ,2 ,3 ,5 ,6]; const int[] bar_z = [0 ,2 ,3 ,4 ,6]; const int[] bar__ = [ 6]; -const int[] bar_exc = [ ,1 ,6]; +const int[] bar_exc = [ 1 ,6]; const int[] bar_0 = [0 ,1 ,2 ,4 ,5 ,6]; const int[] bar_1 = [ 2 ,5 ]; const int[] bar_2 = [0 ,2 ,3 ,4 ,6]; @@ -69,10 +69,10 @@ public void drawAlphabet(char c ,float x,float y ,float scale = 1.0){ bool[7] bar; - foreach(inout b;bar){ + foreach(ref b;bar){ b = false; } - int[] bars; + const(int)[] bars; switch(c){ case 'a':case 'A':bars = bar_a;break; case 'b':case 'B':bars = bar_b;break; @@ -145,7 +145,7 @@ */ } -public void drawString(char[] s ,float x ,float y ,float scale = 1.0){ +public void drawString(string s ,float x ,float y ,float scale = 1.0){ int dx = 0; foreach(char c;s){ drawAlphabet(c ,x + dx ,y ,scale); @@ -153,16 +153,16 @@ } } -public void drawStringCenter(char[] s ,float y ,float scale = 1.0){ +public void drawStringCenter(string s ,float y ,float scale = 1.0){ int dx = 0; - int x = (s.length - 1) * 30 / 2 * -1; + int x = cast(int)(s.length - 1) * 30 / 2 * -1; foreach(char c;s){ drawAlphabet(c ,x + dx ,y ,scale); dx += scale * 30.0; } } -public void drawString(char[] s ,float x ,float y ,int start ,int end ,float scale = 1.0){ +public void drawString(string s ,float x ,float y ,int start ,int end ,float scale = 1.0){ // if(end < start || start >= s.length || end < 0)return; int dx = 0; for(int i=0;i 3){ @@ -129,7 +129,7 @@ if(alpha < 0.1)vanish(); } - public void draw(){ + public override void draw(){ // glDisable(GL_BLEND); //glLoadIdentity(); @@ -233,10 +233,10 @@ // drawn = true; } - public void vanish(){ + public override void vanish(){ _exists = false; } - public bool exists(){ + public override bool exists(){ return _exists; } @@ -258,7 +258,7 @@ public this() { maxParticle = 16; particles.length = maxParticle; - foreach(inout Particle p;particles){ + foreach(ref Particle p;particles){ p = new Particle(); } //parts = new List!(Parts)(); @@ -268,7 +268,7 @@ public this(int n) { maxParticle = n; particles.length = maxParticle; - foreach(inout Particle p;particles){ + foreach(ref Particle p;particles){ p = new Particle(); } //parts = new List!(Parts)(); @@ -322,7 +322,7 @@ public void clear() { - foreach(inout Particle a;particles){ + foreach(ref Particle a;particles){ if(a !is null && a.exists){ a.vanish(); } @@ -331,4 +331,4 @@ particleIdx = 0; } -} \ No newline at end of file +} --- a/src/util/parts.d +++ b/src/util/parts.d @@ -36,8 +36,8 @@ Shape shape; Parts parent; Parts[] childs; - Parts[char[]] childHash; - Animation[char[]] animes; + Parts[string] childHash; + Animation[string] animes; Matrix poseBase; Matrix linkBase; bool linkBased; @@ -134,7 +134,7 @@ setPoseBase(poseBase); } */ - public bool addAnimation(Animation anime ,char[] name){ + public bool addAnimation(Animation anime ,string name){ //if(name in animes)return false; animes[name] = anime; @@ -142,7 +142,7 @@ return true; } - public void deleteAnimation(char[] name){ + public void deleteAnimation(string name){ animes[name] = null; } public bool inAnimation(){ @@ -152,7 +152,7 @@ } return inanime; } - public bool inAnimation(char[] name){ + public bool inAnimation(string name){ if(name in animes){ return animes[name].active; }else return false; @@ -185,7 +185,7 @@ } } } - public void addChild(inout Parts child,char[] name, double dist = 0.1, int childKind = NORMAL, Matrix link = null ,Matrix pose = null){ + public void addChild(ref Parts child,string name, double dist = 0.1, int childKind = NORMAL, Matrix link = null ,Matrix pose = null){ childs.length = childs.length + 1; childs[childs.length - 1] = child; addChildHash(child ,name); @@ -215,7 +215,7 @@ } */ - public void addChildHash(Parts child ,char[] name){ + public void addChildHash(Parts child ,string name){ childHash[name] = child; if(parent !is null)parent.addChildHash(child ,name); } @@ -226,8 +226,8 @@ */ public override void move(){ cnt ++; - char[][] names = animes.keys; - foreach(char[] name;names){ + string[] names = animes.keys; + foreach(string name;names){ Animation an = animes[name]; if (an !is null && an.exists && an.active){ @@ -758,7 +758,7 @@ // destroyImpl(); } // public void destroyImpl(){} - public void vanish(){ + public override void vanish(){ super.vanish(); if(parent !is null){ Parts c; @@ -894,7 +894,7 @@ } +/ public void allDestroy() { - foreach(inout Actor p;actor){ + foreach(ref Actor p;actor){ if(p !is null && p.exists){ (cast(Parts)p).destroy(); } @@ -904,7 +904,7 @@ } /* public void clear(){ - foreach(inout Parts p;parts){ + foreach(ref Parts p;parts){ if(p !is null && p.exists){ p.vanish(); } @@ -914,7 +914,7 @@ } */ public void allParentsDestroy(){ - foreach(inout Actor p;actor){ + foreach(ref Actor p;actor){ if(p !is null && p.exists && (cast(Parts)p).parent is null){ (cast(Parts)p).destroy(); } @@ -972,4 +972,4 @@ } */ } -+/ \ No newline at end of file ++/ --- a/src/util/rand.d +++ b/src/util/rand.d @@ -6,7 +6,7 @@ module util.rand; private import std.stream; -private import std.date; +private import std.datetime; /** * Random number generator. @@ -14,7 +14,7 @@ public class Rand { public this() { - d_time timer = getUTCtime(); + long timer = Clock.currStdTime(); init_genrand(cast(uint)timer); } @@ -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() or init_by_array(init_key, key_length). Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, @@ -122,7 +122,7 @@ { state[0]= cast(uint)(s & 0xffffffffUL); for (int j=1; j> 30)) + j); + state[j] = cast(uint)(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] = cast(uint)(state[i] ^ ((state[i-1] ^ (state[i-1] >> 30)) * 1664525UL)) + state[i] = cast(uint)(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] = cast(uint)(state[i] ^ ((state[i-1] ^ (state[i-1] >> 30)) * 1566083941UL)) + state[i] = cast(uint)(state[i] ^ ((state[i-1] ^ (state[i-1] >> 30)) * 1566083941U)) - i; /* non linear */ state[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */ i++; @@ -169,7 +169,7 @@ /* if init_genrand() 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 = cast(uint*)state; --- a/src/util/record.d +++ b/src/util/record.d @@ -10,48 +10,48 @@ public this(int stage ,int rank){ lapTime.length = stage; totalTime.length = stage; - foreach(inout int[] lap;lapTime){ + foreach(ref int[] lap;lapTime){ lap.length = rank; } - foreach(inout int[] total;totalTime){ + foreach(ref int[] total;totalTime){ total.length = rank; } start(); } public void start(){ - foreach(inout int[] lap;lapTime){ - foreach(inout int l;lap){ + foreach(ref int[] lap;lapTime){ + foreach(ref int l;lap){ l = 359999; } } - foreach(inout int[] total;totalTime){ - foreach(inout int t;total){ + foreach(ref int[] total;totalTime){ + foreach(ref int t;total){ t = 359999; } } } public void load(File fd){ - foreach(inout int[] lap;lapTime){ - foreach(inout int l;lap){ + foreach(ref int[] lap;lapTime){ + foreach(ref int l;lap){ fd.read(l); } } - foreach(inout int[] total;totalTime){ - foreach(inout int t;total){ + foreach(ref int[] total;totalTime){ + foreach(ref int t;total){ fd.read(t); } } } public void save(File fd){ - foreach(inout int[] lap;lapTime){ - foreach(inout int l;lap){ + foreach(ref int[] lap;lapTime){ + foreach(ref int l;lap){ fd.write(l); } } - foreach(inout int[] total;totalTime){ - foreach(inout int t;total){ + foreach(ref int[] total;totalTime){ + foreach(ref int t;total){ fd.write(t); } } @@ -62,7 +62,7 @@ for(int i=0;i (1e-6)){ dDeg =(targetDeg - *parts.pDeg(degType)) / cast(double)(divsp(span) - count + 1); } } - public void run(){ + public override void run(){ super.run(); if(parts !is null && parts.exists){ parts.rotate(degType ,dDeg , alpha); @@ -65,7 +65,7 @@ super(span ,repeat); this.tdist = tdist; } - public void run(){ + public override void run(){ super.run(); if(parts !is null && parts.exists){ if(count <= divsp(span)){ @@ -97,7 +97,7 @@ this.tlinkx = tdegx;this.tlinky = tdegy;this.tlinkz = tdegz; this.tposex = tdegx2;this.tposey = tdegy2;this.tposez = tdegz2; } - public void set(Parts parts){ + public override void set(Parts parts){ super.set(parts); /* if(abs(span - count) > (1e-6)){ @@ -105,7 +105,7 @@ } */ } - public void run(){ + public override void run(){ super.run(); if(parts !is null && parts.exists){ if(count <= divsp(span)){ @@ -147,7 +147,7 @@ this.dDeg = dDeg; this.alpha = alpha; } - public void run(){ + public override void run(){ super.run(); if(parts !is null && parts.exists){ parts.rotate(degType ,mulsp(dDeg) , alpha); @@ -161,7 +161,7 @@ super(span ,repeat); this.d = cast(Matrix)d.clone(); } - public void run(){ + public override void run(){ super.run(); if(parts !is null && parts.exists){ parts.rotateAll(d); @@ -180,13 +180,13 @@ this.dDist = 0; this.alpha = alpha; } - public void set(Parts parts){ + public override void set(Parts parts){ super.set(parts); if(abs(span - count) > (1e-6)){ dDist = (targetDist - parts.dist) / cast(double)(span - count); } } - public void run(){ + public override void run(){ super.run(); if(parts !is null && parts.exists){ parts.dist += dDist; @@ -205,11 +205,11 @@ this.targetSize = targetSize; } - public void set(Parts parts){ + public override void set(Parts parts){ super.set(parts); } - public void run(){ + public override void run(){ super.run(); if(parts !is null && parts.exists){ if(count <= divsp(span)){ @@ -230,11 +230,11 @@ this.dSize = dSize; } - public void set(Parts parts){ + public override void set(Parts parts){ super.set(parts); } - public void run(){ + public override void run(){ super.run(); if(parts !is null && parts.exists){ parts.size = parts.size + dSize * sin(cast(double)count/cast(double)span*PI + PI/2.0); @@ -243,4 +243,4 @@ } -} \ No newline at end of file +} --- a/src/util/laser.d +++ b/src/util/laser.d @@ -8,10 +8,10 @@ public this(Vector3 pos = new Vector3() ,Matrix poseBase = new Matrix()){ super(pos ,poseBase); } - public void move(){ + public override void move(){ super.move(); laseraim = poseVector(); } -} \ No newline at end of file +} debian/patches/imports.patch0000644000000000000000000006610612164040414013340 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 +++ 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 --- a/import/SDL_mixer.d +++ b/import/SDL_mixer.d @@ -22,7 +22,7 @@ // convert to D by shinichiro.h -/* $Id: SDL_mixer.h,v 1.24 2002/05/21 05:45:59 slouken 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_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_version_.d +++ b/import/SDL_version_.d @@ -63,7 +63,7 @@ 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) +bool SDL_VERSION_ATLEAST(Uint8 X, Uint8 Y, Uint8 Z) { return (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)); } --- 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, @@ -89,7 +84,7 @@ GLenum type, void *data); -public int gluBuild2DMipmaps ( +int gluBuild2DMipmaps ( GLenum target, GLint components, GLint width, @@ -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 ****/ --- a/import/MPEGfilter.d +++ b/import/MPEGfilter.d @@ -36,8 +36,8 @@ } /* Callback functions for the filter */ - typedef void (* SMPEG_FilterCallback)( SDL_Overlay * dest, SDL_Overlay * source, SDL_Rect * region, SMPEG_FilterInfo * filter_info, void * data ); - typedef void (* SMPEG_FilterDestroy)( SMPEG_Filter * filter ); + alias void function( SDL_Overlay * dest, SDL_Overlay * source, SDL_Rect * region, SMPEG_FilterInfo * filter_info, void * data ) SMPEG_FilterCallback; + alias void function( SMPEG_Filter * filter ) SMPEG_FilterDestroy; /* The filter definition itself */ struct SMPEG_Filter { --- a/import/smpeg.d +++ b/import/smpeg.d @@ -75,8 +75,8 @@ /* Matches the declaration of SDL_UpdateRect() */ - typedef void(*SMPEG_DisplayCallback)(SDL_Surface* dst, int x, int y, - uint w, uint h); + alias void function(SDL_Surface* dst, int x, int y, + uint w, uint h) SMPEG_DisplayCallback; /* Create a new SMPEG object from an MPEG file. On return, if 'info' is not NULL, it will be filled with information @@ -135,7 +135,7 @@ void SMPEG_scaleXY( SMPEG* mpeg, int width, int height ); void SMPEG_scale( SMPEG* mpeg, int scale ); /* */ - void SMPEG_double(SMPEG* mpeg, bit on) { + void SMPEG_double(SMPEG* mpeg, bool on) { SMPEG_scale(mpeg, (on) ? 2 : 1); } debian/patches/fixes.patch0000644000000000000000000000101712164040414012747 0ustar # Copyright (C) 2007 Marcel Unbehaun # Distributed under the same license as the game. See debian/copyright. --- a/src/br/boot.d +++ b/src/br/boot.d @@ -7,6 +7,8 @@ private Key key; private Mouse mouse; +version (Win32_release) { + private: import std.c.windows.windows; @@ -38,6 +40,12 @@ gc_term(); return result; } +} else { + // Boot as the general executable. + public int main(char[][] args) { + return user_start(); + } +} int user_start(){ double d; debian/tatan.install0000644000000000000000000000023512164040414011661 0ustar tatan usr/games/ debian/*.xpm usr/share/pixmaps/ debian/*.desktop usr/share/applications/ image usr/share/games/tatan/ resource/font usr/share/games/tatan/