Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Repository created.

  • Loading branch information...
commit 2700bd0743cb3d885550d1c29d8adae8afbebba6 0 parents
Dave Wilkinson II wilkie authored

Showing 126 changed files with 27,342 additions and 0 deletions. Show diff stats Hide diff stats

  1. +21 0 README
  2. +99 0 audio.d
  3. +28 0 bin/README
  4. BIN  bin/archive1.dll
  5. BIN  bin/bsdtar.exe
  6. BIN  bin/bzip2.dll
  7. BIN  bin/curl.exe
  8. BIN  bin/dsss.exe
  9. BIN  bin/intl3_svn.dll
  10. BIN  bin/libapr.dll
  11. BIN  bin/libapriconv.dll
  12. BIN  bin/libaprutil.dll
  13. BIN  bin/libcharset1.dll
  14. BIN  bin/libdb44.dll
  15. BIN  bin/libeay32.dll
  16. BIN  bin/libiconv2.dll
  17. BIN  bin/libintl-2.dll
  18. BIN  bin/libintl3.dll
  19. BIN  bin/libssl32.dll
  20. BIN  bin/patch.exe
  21. BIN  bin/popt1.dll
  22. BIN  bin/rebuild.exe
  23. BIN  bin/rebuild_choosedc.exe
  24. BIN  bin/ssleay32.dll
  25. BIN  bin/svn.exe
  26. BIN  bin/unix2dos.exe
  27. BIN  bin/zlib1.dll
  28. +18 0 dsss.conf
  29. +18 0 dsss.last
  30. BIN  dsss_objs/G/_audio.o
  31. BIN  dsss_objs/G/_font.o
  32. BIN  dsss_objs/G/_main.o
  33. BIN  dsss_objs/G/_shape.o
  34. BIN  dsss_objs/G/_timer.o
  35. BIN  dsss_objs/G/_video.o
  36. BIN  dsss_objs/G/nmd_gcstats.o
  37. +2 0  etc/dsss/list.list
  38. +1 0  etc/rebuild/default
  39. +66 0 etc/rebuild/dmd-posix
  40. +67 0 etc/rebuild/dmd-posix-tango
  41. +71 0 etc/rebuild/dmd-win
  42. +72 0 etc/rebuild/dmd-win-tango
  43. +76 0 etc/rebuild/gdc-posix
  44. +77 0 etc/rebuild/gdc-posix-tango
  45. +69 0 etc/rebuild/gdc-win
  46. +70 0 etc/rebuild/gdc-win-tango
  47. +1 0  etc/rebuild/native
  48. +1 0  etc/rebuild/phobos
  49. +1 0  etc/rebuild/tango
  50. +64 0 font.d
  51. BIN  font.ttf
  52. BIN  graphics/ENDSHAPE.png
  53. BIN  graphics/LINE.png
  54. BIN  graphics/LLSHAPE.png
  55. BIN  graphics/LSHAPE.png
  56. BIN  graphics/LZSHAPE.png
  57. BIN  graphics/SQUARE.png
  58. BIN  graphics/TSHAPE.png
  59. BIN  graphics/ZSHAPE.png
  60. BIN  graphics/endScreen.png
  61. BIN  graphics/level1.png
  62. BIN  graphics/level10.png
  63. BIN  graphics/level11.png
  64. BIN  graphics/level12.png
  65. BIN  graphics/level2.png
  66. BIN  graphics/level3.png
  67. BIN  graphics/level4.png
  68. BIN  graphics/level5.png
  69. BIN  graphics/level6.png
  70. BIN  graphics/level7.png
  71. BIN  graphics/level8.png
  72. BIN  graphics/level9.png
  73. BIN  graphics/startScreen.png
  74. BIN  graphics/winScreen.png
  75. +12,534 0 include/d/bcd/windows/windows.d
  76. +73 0 include/d/hcf/env.d
  77. +242 0 include/d/hcf/path.d
  78. +340 0 include/d/hcf/process.d
  79. +461 0 include/d/sss/build.d
  80. +173 0 include/d/sss/clean.d
  81. +1,351 0 include/d/sss/conf.d
  82. +43 0 include/d/sss/genconfig.d
  83. +260 0 include/d/sss/install.d
  84. +683 0 include/d/sss/net.d
  85. +41 0 include/d/sss/platform.d
  86. 0  include/d/sss/stub.d
  87. +69 0 include/d/sss/system.d
  88. +96 0 include/d/sss/uninstall.d
  89. +485 0 include/d/util/booltype.d
  90. +490 0 include/d/util/fdt.d
  91. +80 0 include/d/util/file2.d
  92. +391 0 include/d/util/fileex.d
  93. +309 0 include/d/util/linetoken.d
  94. +528 0 include/d/util/pathex.d
  95. +59 0 include/d/util/series.d
  96. +1,458 0 include/d/util/str.d
  97. BIN  level1.png
  98. BIN  main
  99. +186 0 main.d
  100. +475 0 shape.d
  101. +9 0 share/doc/dsss/README
  102. +71 0 share/doc/dsss/README.overview
  103. +474 0 share/doc/dsss/README.software_engineers
  104. +151 0 share/doc/dsss/README.technical
  105. +75 0 share/doc/dsss/README.use
  106. BIN  share/dsss/candydoc.tar.gz
  107. +46 0 share/dsss/dsss_lib_test.d
  108. +89 0 share/dsss/manifest/dsss.manifest
  109. 0  share/dsss/sources/EMPTY
  110. +1 0  share/dsss/sources/mirror
  111. +1 0  share/dsss/sources/mirrors.list
  112. +4,292 0 share/dsss/sources/pkgs.list
  113. +98 0 share/dsss/sources/source.list
  114. +48 0 share/man/man1/dsss.1
  115. +107 0 share/man/man1/rebuild.1
  116. +4 0 share/rebuild/testtango.d
  117. BIN  sounds/boom.wav
  118. BIN  sounds/boop.wav
  119. BIN  sounds/ghosts.ogg
  120. BIN  sounds/itsover.wav
  121. BIN  sounds/line.wav
  122. BIN  sounds/rotate.wav
  123. BIN  sounds/tetris.wav
  124. +117 0 timer.d
  125. +4 0 tmp/DSSS_derelict/trunk/DerelictGL/files.tmp
  126. +106 0 video.d
21 README
... ... @@ -0,0 +1,21 @@
  1 +Tetris - OSGCC2
  2 +Steve Klabnik, Chuck Davis, Marylou Kunkle
  3 +
  4 +Requirements for building:
  5 +
  6 +DSSS (http://www.dsource.org/projects/dsss)
  7 +DMD (http://www.digitalmars.com/d/download.html)
  8 +SDL, SDL_Mixer, SDL_Image, SDL_ttf
  9 +
  10 +To build: (all in the root directory)
  11 +
  12 +- First install derelict using dsss
  13 +dsss net install derelict
  14 +
  15 +- Build using dsss
  16 +dsss build
  17 +
  18 +To Run:
  19 +
  20 +./main (linux, osx)
  21 +main.exe (windows)
99 audio.d
... ... @@ -0,0 +1,99 @@
  1 +module audio;
  2 +
  3 +import derelict.sdl.mixer;
  4 +import derelict.sdl.sdl;
  5 +import std.stdio;
  6 +import std.string;
  7 +
  8 +class Audio{
  9 +Mix_Music *music;
  10 +Mix_Chunk *effect1;
  11 +Mix_Chunk *effect2;
  12 +Mix_Chunk *effect3;
  13 +Mix_Chunk *effect4;
  14 +Mix_Chunk *effect5;
  15 +Mix_Chunk *effect6;
  16 +
  17 +this(){
  18 + music = null;
  19 +}
  20 +
  21 +public void lowerMusicVolume(){Mix_VolumeMusic(MIX_MAX_VOLUME/8);}
  22 +
  23 +public void init(){
  24 + DerelictSDLMixer.load();
  25 + DerelictSDL.load();
  26 + Mix_OpenAudio(22050, MIX_DEFAULT_FORMAT, 2, 4096);
  27 +}
  28 +
  29 +public void loadMusic(char* filename){
  30 + music = Mix_LoadMUS(filename);
  31 +}
  32 +
  33 +public void playMusic(){
  34 + if(Mix_PlayingMusic() == 0){
  35 + Mix_PlayMusic(music, -1);
  36 + }
  37 +}
  38 +
  39 +public void pauseMusic(){
  40 + if(Mix_PlayingMusic() == 1){
  41 + Mix_PauseMusic();
  42 + }
  43 +}
  44 +
  45 +public void unpauseMusic(){
  46 + if(Mix_PausedMusic() == 1){
  47 + Mix_ResumeMusic();
  48 + }
  49 +}
  50 +
  51 +public void stopMusic(){
  52 + Mix_HaltMusic();
  53 +}
  54 +
  55 +public void playBoom(){
  56 + Mix_PlayChannel(-1, effect1, 0);
  57 +}
  58 +
  59 +public void playBoop(){
  60 + Mix_PlayChannel(-1, effect2, 0);
  61 +}
  62 +
  63 +public void playLine(){
  64 + Mix_PlayChannel(-1, effect3, 0);
  65 +}
  66 +
  67 +public void playRotate(){
  68 + Mix_PlayChannel(-1, effect4, 0);
  69 +}
  70 +
  71 +public void playTetris(){
  72 + Mix_PlayChannel(-1, effect5, 0);
  73 +}
  74 +
  75 +public void playItsOver(){
  76 + Mix_PlayChannel(-1, effect6, 0);
  77 +}
  78 +
  79 +public void loadEffects(){
  80 + effect1 = Mix_LoadWAV("sounds/boom.wav");
  81 + effect2 = Mix_LoadWAV("sounds/boop.wav");
  82 + effect3 = Mix_LoadWAV("sounds/line.wav");
  83 + effect4 = Mix_LoadWAV("sounds/rotate.wav");
  84 + effect5 = Mix_LoadWAV("sounds/tetris.wav");
  85 + effect6 = Mix_LoadWAV("sounds/itsover.wav");
  86 +}
  87 +
  88 +public void cleanUp(){
  89 + Mix_FreeChunk(effect1);
  90 + Mix_FreeChunk(effect2);
  91 + Mix_FreeChunk(effect3);
  92 + Mix_FreeChunk(effect4);
  93 + Mix_FreeChunk(effect5);
  94 + Mix_FreeChunk(effect6);
  95 + Mix_FreeMusic(music);
  96 + Mix_CloseAudio();
  97 +}
  98 +
  99 +}
28 bin/README
... ... @@ -0,0 +1,28 @@
  1 +These are binaries required for Windows, not necessary on other systems.
  2 +
  3 +Most of these are from http://gnuwin32.sourceforge.net/, namely these packages:
  4 +
  5 +bsdtar-1.2.38-bin.zip
  6 +bzip2-1.0.3-1-bin.zip
  7 +cygutils-1.2.9-bin.zip [just unix2dos.exe]
  8 +libarchive-1.2.38-bin.zip
  9 +libiconv-1.9.2-1-bin.zip
  10 +libintl-0.11.5-2-bin.zip
  11 +libintl-0.14.4-bin.zip
  12 +openssl-0.9.7c-bin.zip
  13 +patch-2.5.9-6-bin.zip
  14 +popt-1.8-1-bin.zip
  15 +zlib-1.2.3-bin.zip
  16 +
  17 +
  18 +The sources are available from the same site.
  19 +
  20 +
  21 +Also included is curl.exe and its dependencies, from:
  22 +
  23 +http://curl.haxx.se/download/curl-7.16.0-win32-ssl.zip
  24 +
  25 +
  26 +Also included is svn.exe and dependencies, from:
  27 +
  28 +http://subversion.tigris.org/downloads/svn-win32-1.4.0.zip
BIN  bin/archive1.dll
Binary file not shown
BIN  bin/bsdtar.exe
Binary file not shown
BIN  bin/bzip2.dll
Binary file not shown
BIN  bin/curl.exe
Binary file not shown
BIN  bin/dsss.exe
Binary file not shown
BIN  bin/intl3_svn.dll
Binary file not shown
BIN  bin/libapr.dll
Binary file not shown
BIN  bin/libapriconv.dll
Binary file not shown
BIN  bin/libaprutil.dll
Binary file not shown
BIN  bin/libcharset1.dll
Binary file not shown
BIN  bin/libdb44.dll
Binary file not shown
BIN  bin/libeay32.dll
Binary file not shown
BIN  bin/libiconv2.dll
Binary file not shown
BIN  bin/libintl-2.dll
Binary file not shown
BIN  bin/libintl3.dll
Binary file not shown
BIN  bin/libssl32.dll
Binary file not shown
BIN  bin/patch.exe
Binary file not shown
BIN  bin/popt1.dll
Binary file not shown
BIN  bin/rebuild.exe
Binary file not shown
BIN  bin/rebuild_choosedc.exe
Binary file not shown
BIN  bin/ssleay32.dll
Binary file not shown
BIN  bin/svn.exe
Binary file not shown
BIN  bin/unix2dos.exe
Binary file not shown
BIN  bin/zlib1.dll
Binary file not shown
18 dsss.conf
... ... @@ -0,0 +1,18 @@
  1 +[main.d]
  2 +target=main
  3 +buildflags=-full -lldl
  4 +
  5 +[video.d]
  6 +buildflags=-full -lldl -c
  7 +
  8 +[audio.d]
  9 +buildflags=-full -lldl -c
  10 +
  11 +[shape.d]
  12 +buildflags=-full -lldl -c
  13 +
  14 +[font.d]
  15 +buildflags=-full -lldl -c
  16 +
  17 +[timer.d]
  18 +buildflags=-full -lldl -c
18 dsss.last
... ... @@ -0,0 +1,18 @@
  1 +[main.d]
  2 +target=main
  3 +buildflags=-full -lldl
  4 +
  5 +[video.d]
  6 +buildflags=-full -lldl -c
  7 +
  8 +[audio.d]
  9 +buildflags=-full -lldl -c
  10 +
  11 +[shape.d]
  12 +buildflags=-full -lldl -c
  13 +
  14 +[font.d]
  15 +buildflags=-full -lldl -c
  16 +
  17 +[timer.d]
  18 +buildflags=-full -lldl -c
BIN  dsss_objs/G/_audio.o
Binary file not shown
BIN  dsss_objs/G/_font.o
Binary file not shown
BIN  dsss_objs/G/_main.o
Binary file not shown
BIN  dsss_objs/G/_shape.o
Binary file not shown
BIN  dsss_objs/G/_timer.o
Binary file not shown
BIN  dsss_objs/G/_video.o
Binary file not shown
BIN  dsss_objs/G/nmd_gcstats.o
Binary file not shown
2  etc/dsss/list.list
... ... @@ -0,0 +1,2 @@
  1 +http://svn.dsource.org/projects/dsss/sources
  2 +http://dsss.brainsware.org/sources
1  etc/rebuild/default
... ... @@ -0,0 +1 @@
  1 +profile=dmd-win
66 etc/rebuild/dmd-posix
... ... @@ -0,0 +1,66 @@
  1 +profile=phobos
  2 +
  3 +compiler=dmd
  4 +inifile=dmd.conf
  5 +
  6 +exeext=
  7 +objext=o
  8 +
  9 +
  10 +version=DigitalMars
  11 +noversion=GNU
  12 +version=linux
  13 +noversion=Unix
  14 +version=Posix
  15 +noversion=Windows
  16 +noversion=Win32
  17 +noversion=Win64
  18 +version=X86
  19 +noversion=PPC
  20 +noversion=X86_64
  21 +version=D_InlineAsm
  22 +version=D_InlineAsm_X86
  23 +noversion=D_InlineAsm_PPC
  24 +noversion=D_InlineAsm_X86_64
  25 +version=LittleEndian
  26 +noversion=BigEndian
  27 +
  28 +
  29 +[compile]
  30 +cmd=dmd -version=Posix -c $i
  31 +
  32 +flag=$i
  33 +incdir=-I$i
  34 +libdir=-L-L$i
  35 +optimize=-O
  36 +version=-version=$i
  37 +
  38 +
  39 +[link]
  40 +oneatatime=yes
  41 +cmd=dmd -L--start-group -L-lphobos $i -of$o
  42 +
  43 +libdir=-L-L$i
  44 +lib=-L-l$i
  45 +flag=-L$i
  46 +
  47 +
  48 +[liblink]
  49 +safe=yes
  50 +oneatatime=yes
  51 +cmd=ar rc $o $i
  52 +
  53 +libdir=
  54 +lib=
  55 +flag=
  56 +
  57 +
  58 +[postliblink]
  59 +cmd=ranlib $i
  60 +
  61 +
  62 +[shliblink]
  63 +shlibs=no
  64 +
  65 +[dyliblink]
  66 +dylibs=no
67 etc/rebuild/dmd-posix-tango
... ... @@ -0,0 +1,67 @@
  1 +profile=tango
  2 +
  3 +compiler=dmd
  4 +inifile=dmd.conf
  5 +
  6 +exeext=
  7 +objext=o
  8 +
  9 +
  10 +version=DigitalMars
  11 +noversion=GNU
  12 +version=linux
  13 +noversion=Unix
  14 +version=Posix
  15 +noversion=Windows
  16 +noversion=Win32
  17 +noversion=Win64
  18 +version=X86
  19 +noversion=PPC
  20 +noversion=X86_64
  21 +version=D_InlineAsm
  22 +version=D_InlineAsm_X86
  23 +noversion=D_InlineAsm_PPC
  24 +noversion=D_InlineAsm_X86_64
  25 +version=LittleEndian
  26 +noversion=BigEndian
  27 +version=Tango
  28 +
  29 +
  30 +[compile]
  31 +cmd=dmd -version=Posix -version=Tango -c $i
  32 +
  33 +flag=$i
  34 +incdir=-I$i
  35 +libdir=-L-L$i
  36 +optimize=-O
  37 +version=-version=$i
  38 +
  39 +
  40 +[link]
  41 +oneatatime=yes
  42 +cmd=dmd -L--start-group -L-ltango-base-dmd $i -of$o
  43 +
  44 +libdir=-L-L$i
  45 +lib=-L-l$i
  46 +flag=-L$i
  47 +
  48 +
  49 +[liblink]
  50 +safe=yes
  51 +oneatatime=yes
  52 +cmd=ar rc $o $i
  53 +
  54 +libdir=
  55 +lib=
  56 +flag=
  57 +
  58 +
  59 +[postliblink]
  60 +cmd=ranlib $i
  61 +
  62 +
  63 +[shliblink]
  64 +shlibs=no
  65 +
  66 +[dyliblink]
  67 +dylibs=no
71 etc/rebuild/dmd-win
... ... @@ -0,0 +1,71 @@
  1 +profile=phobos
  2 +
  3 +compiler=dmd
  4 +inifile=sc.ini
  5 +
  6 +exeext=.exe
  7 +objext=obj
  8 +objmodsep=-
  9 +
  10 +
  11 +version=DigitalMars
  12 +noversion=GNU
  13 +noversion=linux
  14 +noversion=Unix
  15 +noversion=Posix
  16 +version=Windows
  17 +testversion=Win32
  18 +testversion=Win64
  19 +version=X86
  20 +noversion=PPC
  21 +noversion=X86_64
  22 +version=D_InlineAsm
  23 +version=D_InlineAsm_X86
  24 +noversion=D_InlineAsm_PPC
  25 +noversion=D_InlineAsm_X86_64
  26 +version=LittleEndian
  27 +noversion=BigEndian
  28 +
  29 +
  30 +[compile]
  31 +cmd=dmd -c $i
  32 +response=@
  33 +
  34 +flag=$i
  35 +incdir=-I$i
  36 +libdir=-L-L$i
  37 +optimize=-O
  38 +version=-version=$i
  39 +
  40 +
  41 +[link]
  42 +oneatatime=yes
  43 +cmd=dmd $i -of$o
  44 +response=@
  45 +
  46 +libdir=-L+$i\
  47 +lib=-L+$i.lib
  48 +flag=-L$i
  49 +gui=-L/subsystem:windows
  50 +
  51 +
  52 +[liblink]
  53 +safe=yes
  54 +oneatatime=yes
  55 +cmd=lib -c -p512 $o $i
  56 +response=@
  57 +
  58 +libdir=
  59 +lib=
  60 +flag=
  61 +
  62 +
  63 +[postliblink]
  64 +cmd=echo $i
  65 +
  66 +
  67 +[shliblink]
  68 +shlibs=no
  69 +
  70 +[dyliblink]
  71 +dylibs=no
72 etc/rebuild/dmd-win-tango
... ... @@ -0,0 +1,72 @@
  1 +profile=tango
  2 +
  3 +compiler=dmd
  4 +inifile=sc.ini
  5 +
  6 +exeext=.exe
  7 +objext=obj
  8 +objmodsep=-
  9 +
  10 +
  11 +version=DigitalMars
  12 +noversion=GNU
  13 +noversion=linux
  14 +noversion=Unix
  15 +noversion=Posix
  16 +version=Windows
  17 +testversion=Win32
  18 +testversion=Win64
  19 +version=X86
  20 +noversion=PPC
  21 +noversion=X86_64
  22 +version=D_InlineAsm
  23 +version=D_InlineAsm_X86
  24 +noversion=D_InlineAsm_PPC
  25 +noversion=D_InlineAsm_X86_64
  26 +version=LittleEndian
  27 +noversion=BigEndian
  28 +version=Tango
  29 +
  30 +
  31 +[compile]
  32 +cmd=dmd -version=Tango -c $i
  33 +response=@
  34 +
  35 +flag=$i
  36 +incdir=-I$i
  37 +libdir=-L-L$i
  38 +optimize=-O
  39 +version=-version=$i
  40 +
  41 +
  42 +[link]
  43 +oneatatime=yes
  44 +cmd=dmd $i -of$o
  45 +response=@
  46 +
  47 +libdir=-L+$i\
  48 +lib=-L+$i.lib
  49 +flag=-L$i
  50 +gui=-L/subsystem:windows
  51 +
  52 +
  53 +[liblink]
  54 +safe=yes
  55 +oneatatime=yes
  56 +cmd=lib -c -p512 $o $i
  57 +response=@
  58 +
  59 +libdir=
  60 +lib=
  61 +flag=
  62 +
  63 +
  64 +[postliblink]
  65 +cmd=echo $i
  66 +
  67 +
  68 +[shliblink]
  69 +shlibs=no
  70 +
  71 +[dyliblink]
  72 +dylibs=no
76 etc/rebuild/gdc-posix
... ... @@ -0,0 +1,76 @@
  1 +profile=phobos
  2 +
  3 +compiler=gdc
  4 +
  5 +exeext=
  6 +objext=o
  7 +
  8 +
  9 +noversion=DigitalMars
  10 +version=GNU
  11 +testversion=linux
  12 +testversion=darwin
  13 +version=Unix
  14 +version=Posix
  15 +noversion=Windows
  16 +noversion=Win32
  17 +noversion=Win64
  18 +testversion=X86
  19 +testversion=PPC
  20 +testversion=X86_64
  21 +testversion=D_InlineAsm
  22 +testversion=D_InlineAsm_X86
  23 +testversion=D_InlineAsm_PPC
  24 +testversion=D_InlineAsm_X86_64
  25 +testversion=LittleEndian
  26 +testversion=BigEndian
  27 +
  28 +
  29 +[compile]
  30 +cmd=gdmd -version=Posix -c $i
  31 +
  32 +flag=$i
  33 +incdir=-I$i
  34 +libdir=-L-L$i
  35 +circular=-fall-sources
  36 +optimize=-O
  37 +version=-version=$i
  38 +
  39 +
  40 +[link]
  41 +cmd=gdmd $i -of$o
  42 +export_dynamic=-q,-rdynamic
  43 +
  44 +libdir=-L-L$i
  45 +lib=-L-l$i
  46 +flag=-L$i
  47 +
  48 +
  49 +[liblink]
  50 +safe=yes
  51 +cmd=ar rc $o $i
  52 +
  53 +libdir=
  54 +lib=
  55 +flag=
  56 +
  57 +
  58 +[postliblink]
  59 +cmd=ranlib $i
  60 +
  61 +
  62 +[shliblink]
  63 +shlibs=yes
  64 +cmd=gdmd -q,-shared -q,-nodefaultlibs $i -of$o
  65 +
  66 +libdir=-L-L$i
  67 +lib=-L-l$i
  68 +flag=-L$i
  69 +
  70 +[dyliblink]
  71 +dylibs=yes
  72 +cmd=gdmd -q,-shared -q,-nodefaultlibs $i $l/dymoduleinit.d -of$o
  73 +
  74 +libdir=-L-L$i
  75 +lib=-L-l$i
  76 +flag=-L$i
77 etc/rebuild/gdc-posix-tango
... ... @@ -0,0 +1,77 @@
  1 +profile=tango
  2 +
  3 +compiler=gdc
  4 +
  5 +exeext=
  6 +objext=o
  7 +
  8 +
  9 +noversion=DigitalMars
  10 +version=GNU
  11 +testversion=linux
  12 +testversion=darwin
  13 +version=Unix
  14 +version=Posix
  15 +noversion=Windows
  16 +noversion=Win32
  17 +noversion=Win64
  18 +testversion=X86
  19 +testversion=PPC
  20 +testversion=X86_64
  21 +testversion=D_InlineAsm
  22 +testversion=D_InlineAsm_X86
  23 +testversion=D_InlineAsm_PPC
  24 +testversion=D_InlineAsm_X86_64
  25 +testversion=LittleEndian
  26 +testversion=BigEndian
  27 +version=Tango
  28 +
  29 +
  30 +[compile]
  31 +cmd=gdmd -version=Posix -version=Tango -c $i
  32 +
  33 +flag=$i
  34 +incdir=-I$i
  35 +libdir=-L-L$i
  36 +circular=-fall-sources
  37 +optimize=-O
  38 +version=-version=$i
  39 +
  40 +
  41 +[link]
  42 +cmd=gdmd $i -of$o
  43 +export_dynamic=-q,-rdynamic
  44 +
  45 +libdir=-L-L$i
  46 +lib=-L-l$i
  47 +flag=-L$i
  48 +
  49 +
  50 +[liblink]
  51 +safe=yes
  52 +cmd=ar rc $o $i
  53 +
  54 +libdir=
  55 +lib=
  56 +flag=
  57 +
  58 +
  59 +[postliblink]
  60 +cmd=ranlib $i
  61 +
  62 +
  63 +[shliblink]
  64 +shlibs=yes
  65 +cmd=gdmd -q,-shared -q,-nodefaultlibs $i -of$o
  66 +
  67 +libdir=-L-L$i
  68 +lib=-L-l$i
  69 +flag=-L$i
  70 +
  71 +[dyliblink]
  72 +dylibs=yes
  73 +cmd=gdmd -q,-shared -q,-nodefaultlibs $i $l/dymoduleinit.d -of$o
  74 +
  75 +libdir=-L-L$i
  76 +lib=-L-l$i
  77 +flag=-L$i
69 etc/rebuild/gdc-win
... ... @@ -0,0 +1,69 @@
  1 +profile=phobos
  2 +
  3 +compiler=gdc
  4 +
  5 +exeext=.exe
  6 +objext=o
  7 +
  8 +
  9 +version=DigitalMars
  10 +noversion=GNU
  11 +noversion=linux
  12 +noversion=Unix
  13 +noversion=Posix
  14 +version=Windows
  15 +testversion=Win32
  16 +testversion=Win64
  17 +version=X86
  18 +noversion=PPC
  19 +noversion=X86_64
  20 +testversion=D_InlineAsm
  21 +testversion=D_InlineAsm_X86
  22 +noversion=D_InlineAsm_PPC
  23 +noversion=D_InlineAsm_X86_64
  24 +version=LittleEndian
  25 +noversion=BigEndian
  26 +
  27 +
  28 +[compile]
  29 +cmd=gdmd -c $i
  30 +
  31 +flag=$i
  32 +incdir=-I$i
  33 +libdir=-L-L$i
  34 +circular=-fall-sources
  35 +optimize=-O
  36 +version=-version=$i
  37 +
  38 +
  39 +[link]
  40 +cmd=gdmd $i -of$o
  41 +
  42 +libdir=-L-L$i
  43 +lib=-L-l$i
  44 +flag=-L$i
  45 +
  46 +
  47 +[liblink]
  48 +safe=yes
  49 +cmd=ar rc $o $i
  50 +
  51 +libdir=
  52 +lib=
  53 +flag=
  54 +
  55 +
  56 +[postliblink]
  57 +cmd=ranlib $i
  58 +
  59 +
  60 +[shliblink]
  61 +shlibs=yes
  62 +cmd=gdmd -q,-shared -q,-nodefaultlibs $i -of$o
  63 +
  64 +libdir=-L-L$i
  65 +lib=-L-l$i
  66 +flag=-L$i
  67 +
  68 +[dyliblink]
  69 +dylibs=no
70 etc/rebuild/gdc-win-tango
... ... @@ -0,0 +1,70 @@
  1 +profile=tango
  2 +
  3 +compiler=gdc
  4 +
  5 +exeext=.exe
  6 +objext=o
  7 +
  8 +
  9 +version=DigitalMars
  10 +noversion=GNU
  11 +noversion=linux
  12 +noversion=Unix
  13 +noversion=Posix
  14 +version=Windows
  15 +testversion=Win32
  16 +testversion=Win64
  17 +version=X86
  18 +noversion=PPC
  19 +noversion=X86_64
  20 +testversion=D_InlineAsm
  21 +testversion=D_InlineAsm_X86
  22 +noversion=D_InlineAsm_PPC
  23 +noversion=D_InlineAsm_X86_64
  24 +version=LittleEndian
  25 +noversion=BigEndian
  26 +version=Tango
  27 +
  28 +
  29 +[compile]
  30 +cmd=gdmd -version=Tango -c $i
  31 +
  32 +flag=$i
  33 +incdir=-I$i
  34 +libdir=-L-L$i
  35 +circular=-fall-sources
  36 +optimize=-O
  37 +version=-version=$i
  38 +
  39 +
  40 +[link]
  41 +cmd=gdmd $i -of$o
  42 +
  43 +libdir=-L-L$i
  44 +lib=-L-l$i
  45 +flag=-L$i
  46 +
  47 +
  48 +[liblink]
  49 +safe=yes
  50 +cmd=ar rc $o $i
  51 +
  52 +libdir=
  53 +lib=
  54 +flag=
  55 +
  56 +
  57 +[postliblink]
  58 +cmd=ranlib $i
  59 +
  60 +
  61 +[shliblink]
  62 +shlibs=yes
  63 +cmd=gdmd -q,-shared -q,-nodefaultlibs $i -of$o
  64 +
  65 +libdir=-L-L$i
  66 +lib=-L-l$i
  67 +flag=-L$i
  68 +
  69 +[dyliblink]
  70 +dylibs=no
1  etc/rebuild/native
... ... @@ -0,0 +1 @@
  1 +profile=default
1  etc/rebuild/phobos
... ... @@ -0,0 +1 @@
  1 +ignore=crc32 gcc. gcstats object std.
1  etc/rebuild/tango
... ... @@ -0,0 +1 @@
  1 +ignore=gcc. object
64 font.d
... ... @@ -0,0 +1,64 @@
  1 +module font;
  2 +
  3 +import std.stdio;
  4 +import std.string;
  5 +import derelict.sdl.sdl;
  6 +import derelict.sdl.ttf;
  7 +import derelict.sdl.image;
  8 +import video;
  9 +
  10 +class Font{
  11 +TTF_Font *font;
  12 +SDL_Color textColor;
  13 +SDL_Surface *message;
  14 +Video graphics;
  15 +int x, y;
  16 +
  17 +this(char* filename, Video grph){
  18 + DerelictSDLImage.load();
  19 + DerelictSDL.load();
  20 + DerelictSDLttf.load();
  21 + TTF_Init();
  22 + graphics = grph;
  23 +
  24 + SDL_Init(SDL_INIT_EVERYTHING);
  25 + textColor.r = 192;
  26 + textColor.g = 192;
  27 + textColor.b = 192;
  28 + font = TTF_OpenFont("font.ttf", 24);
  29 + if(font == null){writefln("font is null");}
  30 + message = null;
  31 +}
  32 +
  33 +public void displayMessage(int quadrant, char *theMsg){
  34 + message = TTF_RenderText_Solid(font, theMsg, textColor);
  35 + //if(message == null){writefln("message is null");}
  36 +
  37 + if(quadrant == 1){
  38 + x = 575;
  39 + y = 25;
  40 + }else if(quadrant == 2){
  41 + x = 25;
  42 + y = 25;
  43 + }else if(quadrant == 3){
  44 + x = 25;
  45 + y = 470;
  46 + }else if(quadrant == 4){
  47 + x = 575;
  48 + y = 470;
  49 + }else{
  50 + x = 575;
  51 + y = 20;
  52 + }
  53 + //writefln("inside display Message");
  54 + graphics.applySurface(x,y,message);
  55 +
  56 +}
  57 +
  58 + public void cleanUp(){
  59 + TTF_CloseFont(font);
  60 + TTF_Quit();
  61 + }
  62 +
  63 +
  64 +}
BIN  font.ttf
Binary file not shown
BIN  graphics/ENDSHAPE.png
BIN  graphics/LINE.png
BIN  graphics/LLSHAPE.png
BIN  graphics/LSHAPE.png
BIN  graphics/LZSHAPE.png
BIN  graphics/SQUARE.png
BIN  graphics/TSHAPE.png
BIN  graphics/ZSHAPE.png
BIN  graphics/endScreen.png
BIN  graphics/level1.png
BIN  graphics/level10.png
BIN  graphics/level11.png
BIN  graphics/level12.png
BIN  graphics/level2.png
BIN  graphics/level3.png
BIN  graphics/level4.png
BIN  graphics/level5.png
BIN  graphics/level6.png
BIN  graphics/level7.png
BIN  graphics/level8.png
BIN  graphics/level9.png
BIN  graphics/startScreen.png
BIN  graphics/winScreen.png
12,534 include/d/bcd/windows/windows.d
12,534 additions, 0 deletions not shown
73 include/d/hcf/env.d
... ... @@ -0,0 +1,73 @@
  1 +/**
  2 + * Helpful environment functions
  3 + *
  4 + * Authors:
  5 + * Gregor Richards
  6 + *
  7 + * License:
  8 + * Copyright (c) 2006 Gregor Richards
  9 + *
  10 + * Permission is hereby granted, free of charge, to any person obtaining a
  11 + * copy of this software and associated documentation files (the "Software"),
  12 + * to deal in the Software without restriction, including without limitation
  13 + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  14 + * and/or sell copies of the Software, and to permit persons to whom the
  15 + * Software is furnished to do so, subject to the following conditions:
  16 + *
  17 + * The above copyright notice and this permission notice shall be included in
  18 + * all copies or substantial portions of the Software.
  19 + *
  20 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  21 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  23 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  24 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  25 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  26 + * DEALINGS IN THE SOFTWARE.
  27 + */
  28 +
  29 +module hcf.env;
  30 +
  31 +import std.string;
  32 +
  33 +import std.c.stdlib;
  34 +
  35 +version (Windows) {
  36 + import bcd.windows.windows;
  37 +}
  38 +
  39 +/** Get an environment variable D-ly */
  40 +char[] getEnvVar(char[] var)
  41 +{
  42 + version (Posix) {
  43 + return toString(
  44 + getenv(toStringz(var)));
  45 + } else version (Windows) {
  46 + // CyberShadow 2007.02.22: enlarging buffer tenfold for people with huge PATHs (like me)
  47 + char[10240] buffer;
  48 + buffer[0] = '\0';
  49 + GetEnvironmentVariableA(
  50 + toStringz(var),
  51 + buffer.ptr,
  52 + 10240);
  53 + return toString(buffer.ptr);
  54 + } else {
  55 + static assert(0);
  56 + }
  57 +}
  58 +
  59 +/** Set an environment variable D-ly */
  60 +void setEnvVar(char[] var, char[] val)
  61 +{
  62 + version (Posix) {
  63 + setenv(toStringz(var),
  64 + toStringz(val),
  65 + 1);
  66 + } else version(Windows) {
  67 + SetEnvironmentVariableA(
  68 + toStringz(var),
  69 + toStringz(val));
  70 + } else {
  71 + static assert(0);
  72 + }
  73 +}
242 include/d/hcf/path.d
... ... @@ -0,0 +1,242 @@
  1 +/**
  2 + * Helpful path functions
  3 + *
  4 + * Authors:
  5 + * Gregor Richards
  6 + *
  7 + * License:
  8 + * Copyright (c) 2006 Gregor Richards
  9 + *
  10 + * Permission is hereby granted, free of charge, to any person obtaining a
  11 + * copy of this software and associated documentation files (the "Software"),
  12 + * to deal in the Software without restriction, including without limitation
  13 + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  14 + * and/or sell copies of the Software, and to permit persons to whom the
  15 + * Software is furnished to do so, subject to the following conditions:
  16 + *
  17 + * The above copyright notice and this permission notice shall be included in
  18 + * all copies or substantial portions of the Software.
  19 + *
  20 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  21 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  23 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  24 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  25 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  26 + * DEALINGS IN THE SOFTWARE.
  27 + */
  28 +
  29 +module hcf.path;
  30 +
  31 +public import std.path;
  32 +
  33 +import std.stdio;
  34 +import std.file;
  35 +import std.string;
  36 +
  37 +import std.c.stdlib;
  38 +
  39 +version (Windows) {
  40 + import bcd.windows.windows;
  41 +}
  42 +
  43 +/** Get the system PATH */
  44 +char[][] getPath()
  45 +{
  46 + return split(toString(getenv("PATH")), std.path.pathsep);
  47 +}
  48 +
  49 +/** From args[0], figure out our path. Returns 'false' on failure */
  50 +bool whereAmI(char[] argvz, inout char[] dir, inout char[] bname)
  51 +{
  52 + // split it
  53 + bname = getBaseName(argvz);
  54 + dir = getDirName(argvz);
  55 +
  56 + // on Windows, this is a .exe
  57 + version (Windows) {
  58 + bname = defaultExt(bname, "exe");
  59 + }
  60 +
  61 + // is this a directory?
  62 + if (dir != "") {
  63 + if (!std.path.isabs(dir)) {
  64 + // make it absolute
  65 + dir = getcwd() ~ std.path.sep ~ dir;
  66 + }
  67 + return true;
  68 + }
  69 +
  70 + version (Windows) {
  71 + // is it in cwd?
  72 + char[] cwd = getcwd();
  73 + if (exists(cwd ~ std.path.sep ~ bname)) {
  74 + dir = cwd;
  75 + return true;
  76 + }
  77 + }
  78 +
  79 + // rifle through the path
  80 + char[][] path = getPath();
  81 + foreach (pe; path) {
  82 + char[] fullname = pe ~ std.path.sep ~ bname;
  83 + if (exists(fullname)) {
  84 + version (Windows) {
  85 + dir = pe;
  86 + return true;
  87 + } else {
  88 + if (getAttributes(fullname) & 0100) {
  89 + dir = pe;
  90 + return true;
  91 + }
  92 + }
  93 + }
  94 + }
  95 +
  96 + // bad
  97 + return false;
  98 +}
  99 +
  100 +/// Return a canonical pathname
  101 +char[] canonPath(char[] origpath)
  102 +{
  103 + char[] ret;
  104 +
  105 + version (Windows) {
  106 + // replace any altsep with sep
  107 + if (altsep.length) {
  108 + ret = replace(origpath, altsep, sep);
  109 + } else {
  110 + ret = origpath.dup;
  111 + }
  112 + } else {
  113 + ret = origpath.dup;
  114 + }
  115 +
  116 + // expand tildes
  117 + ret = expandTilde(ret);
  118 +
  119 + // get rid of any duplicate separators
  120 + for (int i = 0; i < ret.length; i++) {
  121 + if (ret[i .. (i + 1)] == sep) {
  122 + // drop the duplicate separator
  123 + i++;
  124 + while (i < ret.length &&
  125 + ret[i .. (i + 1)] == sep) {
  126 + ret = ret[0 .. i] ~ ret[(i + 1) .. $];
  127 + }
  128 + }
  129 + }
  130 +
  131 + // make sure we don't miss a .. element
  132 + if (ret.length > 3 && ret[($-3) .. $] == std.path.sep ~ "..") {
  133 + ret ~= std.path.sep;
  134 + }
  135 +
  136 + // or a . element
  137 + if (ret.length > 2 && ret[($-2) .. $] == std.path.sep ~ ".") {
  138 + ret ~= std.path.sep;
  139 + }
  140 +
  141 + // search for .. elements
  142 + for (int i = 0; ret.length > 4 && i <= ret.length - 4; i++) {
  143 + if (ret[i .. (i + 4)] == std.path.sep ~ ".." ~ std.path.sep) {
  144 + // drop the previous path element
  145 + int j;
  146 + for (j = i - 1; j > 0 && ret[j..(j+1)] != std.path.sep; j--) {}
  147 + if (j > 0) {
  148 + // cut
  149 + if (ret[j..j+2] == "/.") {
  150 + j = i + 2; // skip it
  151 + } else {
  152 + ret = ret[0..j] ~ ret[(i + 3) .. $];
  153 + }
  154 + } else {
  155 + // can't cut
  156 + j = i + 2;
  157 + }
  158 + i = j - 1;
  159 + }
  160 + }
  161 +
  162 + // search for . elements
  163 + for (int i = 0; ret.length > 2 && i <= ret.length - 3; i++) {