Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2700bd0
Showing
126 changed files
with
27,342 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Tetris - OSGCC2 | ||
Steve Klabnik, Chuck Davis, Marylou Kunkle | ||
|
||
Requirements for building: | ||
|
||
DSSS (http://www.dsource.org/projects/dsss) | ||
DMD (http://www.digitalmars.com/d/download.html) | ||
SDL, SDL_Mixer, SDL_Image, SDL_ttf | ||
|
||
To build: (all in the root directory) | ||
|
||
- First install derelict using dsss | ||
dsss net install derelict | ||
|
||
- Build using dsss | ||
dsss build | ||
|
||
To Run: | ||
|
||
./main (linux, osx) | ||
main.exe (windows) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
module audio; | ||
|
||
import derelict.sdl.mixer; | ||
import derelict.sdl.sdl; | ||
import std.stdio; | ||
import std.string; | ||
|
||
class Audio{ | ||
Mix_Music *music; | ||
Mix_Chunk *effect1; | ||
Mix_Chunk *effect2; | ||
Mix_Chunk *effect3; | ||
Mix_Chunk *effect4; | ||
Mix_Chunk *effect5; | ||
Mix_Chunk *effect6; | ||
|
||
this(){ | ||
music = null; | ||
} | ||
|
||
public void lowerMusicVolume(){Mix_VolumeMusic(MIX_MAX_VOLUME/8);} | ||
|
||
public void init(){ | ||
DerelictSDLMixer.load(); | ||
DerelictSDL.load(); | ||
Mix_OpenAudio(22050, MIX_DEFAULT_FORMAT, 2, 4096); | ||
} | ||
|
||
public void loadMusic(char* filename){ | ||
music = Mix_LoadMUS(filename); | ||
} | ||
|
||
public void playMusic(){ | ||
if(Mix_PlayingMusic() == 0){ | ||
Mix_PlayMusic(music, -1); | ||
} | ||
} | ||
|
||
public void pauseMusic(){ | ||
if(Mix_PlayingMusic() == 1){ | ||
Mix_PauseMusic(); | ||
} | ||
} | ||
|
||
public void unpauseMusic(){ | ||
if(Mix_PausedMusic() == 1){ | ||
Mix_ResumeMusic(); | ||
} | ||
} | ||
|
||
public void stopMusic(){ | ||
Mix_HaltMusic(); | ||
} | ||
|
||
public void playBoom(){ | ||
Mix_PlayChannel(-1, effect1, 0); | ||
} | ||
|
||
public void playBoop(){ | ||
Mix_PlayChannel(-1, effect2, 0); | ||
} | ||
|
||
public void playLine(){ | ||
Mix_PlayChannel(-1, effect3, 0); | ||
} | ||
|
||
public void playRotate(){ | ||
Mix_PlayChannel(-1, effect4, 0); | ||
} | ||
|
||
public void playTetris(){ | ||
Mix_PlayChannel(-1, effect5, 0); | ||
} | ||
|
||
public void playItsOver(){ | ||
Mix_PlayChannel(-1, effect6, 0); | ||
} | ||
|
||
public void loadEffects(){ | ||
effect1 = Mix_LoadWAV("sounds/boom.wav"); | ||
effect2 = Mix_LoadWAV("sounds/boop.wav"); | ||
effect3 = Mix_LoadWAV("sounds/line.wav"); | ||
effect4 = Mix_LoadWAV("sounds/rotate.wav"); | ||
effect5 = Mix_LoadWAV("sounds/tetris.wav"); | ||
effect6 = Mix_LoadWAV("sounds/itsover.wav"); | ||
} | ||
|
||
public void cleanUp(){ | ||
Mix_FreeChunk(effect1); | ||
Mix_FreeChunk(effect2); | ||
Mix_FreeChunk(effect3); | ||
Mix_FreeChunk(effect4); | ||
Mix_FreeChunk(effect5); | ||
Mix_FreeChunk(effect6); | ||
Mix_FreeMusic(music); | ||
Mix_CloseAudio(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
These are binaries required for Windows, not necessary on other systems. | ||
|
||
Most of these are from http://gnuwin32.sourceforge.net/, namely these packages: | ||
|
||
bsdtar-1.2.38-bin.zip | ||
bzip2-1.0.3-1-bin.zip | ||
cygutils-1.2.9-bin.zip [just unix2dos.exe] | ||
libarchive-1.2.38-bin.zip | ||
libiconv-1.9.2-1-bin.zip | ||
libintl-0.11.5-2-bin.zip | ||
libintl-0.14.4-bin.zip | ||
openssl-0.9.7c-bin.zip | ||
patch-2.5.9-6-bin.zip | ||
popt-1.8-1-bin.zip | ||
zlib-1.2.3-bin.zip | ||
|
||
|
||
The sources are available from the same site. | ||
|
||
|
||
Also included is curl.exe and its dependencies, from: | ||
|
||
http://curl.haxx.se/download/curl-7.16.0-win32-ssl.zip | ||
|
||
|
||
Also included is svn.exe and dependencies, from: | ||
|
||
http://subversion.tigris.org/downloads/svn-win32-1.4.0.zip |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[main.d] | ||
target=main | ||
buildflags=-full -lldl | ||
|
||
[video.d] | ||
buildflags=-full -lldl -c | ||
|
||
[audio.d] | ||
buildflags=-full -lldl -c | ||
|
||
[shape.d] | ||
buildflags=-full -lldl -c | ||
|
||
[font.d] | ||
buildflags=-full -lldl -c | ||
|
||
[timer.d] | ||
buildflags=-full -lldl -c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[main.d] | ||
target=main | ||
buildflags=-full -lldl | ||
|
||
[video.d] | ||
buildflags=-full -lldl -c | ||
|
||
[audio.d] | ||
buildflags=-full -lldl -c | ||
|
||
[shape.d] | ||
buildflags=-full -lldl -c | ||
|
||
[font.d] | ||
buildflags=-full -lldl -c | ||
|
||
[timer.d] | ||
buildflags=-full -lldl -c |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
http://svn.dsource.org/projects/dsss/sources | ||
http://dsss.brainsware.org/sources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
profile=dmd-win |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
profile=phobos | ||
|
||
compiler=dmd | ||
inifile=dmd.conf | ||
|
||
exeext= | ||
objext=o | ||
|
||
|
||
version=DigitalMars | ||
noversion=GNU | ||
version=linux | ||
noversion=Unix | ||
version=Posix | ||
noversion=Windows | ||
noversion=Win32 | ||
noversion=Win64 | ||
version=X86 | ||
noversion=PPC | ||
noversion=X86_64 | ||
version=D_InlineAsm | ||
version=D_InlineAsm_X86 | ||
noversion=D_InlineAsm_PPC | ||
noversion=D_InlineAsm_X86_64 | ||
version=LittleEndian | ||
noversion=BigEndian | ||
|
||
|
||
[compile] | ||
cmd=dmd -version=Posix -c $i | ||
|
||
flag=$i | ||
incdir=-I$i | ||
libdir=-L-L$i | ||
optimize=-O | ||
version=-version=$i | ||
|
||
|
||
[link] | ||
oneatatime=yes | ||
cmd=dmd -L--start-group -L-lphobos $i -of$o | ||
|
||
libdir=-L-L$i | ||
lib=-L-l$i | ||
flag=-L$i | ||
|
||
|
||
[liblink] | ||
safe=yes | ||
oneatatime=yes | ||
cmd=ar rc $o $i | ||
|
||
libdir= | ||
lib= | ||
flag= | ||
|
||
|
||
[postliblink] | ||
cmd=ranlib $i | ||
|
||
|
||
[shliblink] | ||
shlibs=no | ||
|
||
[dyliblink] | ||
dylibs=no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
profile=tango | ||
|
||
compiler=dmd | ||
inifile=dmd.conf | ||
|
||
exeext= | ||
objext=o | ||
|
||
|
||
version=DigitalMars | ||
noversion=GNU | ||
version=linux | ||
noversion=Unix | ||
version=Posix | ||
noversion=Windows | ||
noversion=Win32 | ||
noversion=Win64 | ||
version=X86 | ||
noversion=PPC | ||
noversion=X86_64 | ||
version=D_InlineAsm | ||
version=D_InlineAsm_X86 | ||
noversion=D_InlineAsm_PPC | ||
noversion=D_InlineAsm_X86_64 | ||
version=LittleEndian | ||
noversion=BigEndian | ||
version=Tango | ||
|
||
|
||
[compile] | ||
cmd=dmd -version=Posix -version=Tango -c $i | ||
|
||
flag=$i | ||
incdir=-I$i | ||
libdir=-L-L$i | ||
optimize=-O | ||
version=-version=$i | ||
|
||
|
||
[link] | ||
oneatatime=yes | ||
cmd=dmd -L--start-group -L-ltango-base-dmd $i -of$o | ||
|
||
libdir=-L-L$i | ||
lib=-L-l$i | ||
flag=-L$i | ||
|
||
|
||
[liblink] | ||
safe=yes | ||
oneatatime=yes | ||
cmd=ar rc $o $i | ||
|
||
libdir= | ||
lib= | ||
flag= | ||
|
||
|
||
[postliblink] | ||
cmd=ranlib $i | ||
|
||
|
||
[shliblink] | ||
shlibs=no | ||
|
||
[dyliblink] | ||
dylibs=no |
Oops, something went wrong.