diff --git a/Makefile.GnuLinux b/Makefile.GnuLinux new file mode 100644 index 0000000..fdf0a4b --- /dev/null +++ b/Makefile.GnuLinux @@ -0,0 +1,43 @@ +# +# Modification History +# +# 2006-June-27 Jason Rohrer +# Created. Condensed from X86 and PPC makefiles in Transcend project. +# +# 2007-April-23 Jason Rohrer +# Removed unneeded libraries. +# + + +## +# The common GnuLinux portion of Makefiles. +# Should not be made manually---used by configure to build Makefiles. +## + + +PLATFORM_COMPILE_FLAGS = -DLINUX + + +# various GL and X windows librariesneeded for linux +# also need portaudio library (which in turn needs pthreads) +PLATFORM_LINK_FLAGS = -L/usr/X11R6/lib -lGL -lGLU -lX11 -lSDL -lpthread -lpng -lz + + +# All platforms but OSX support g++ and need no linker hacks +GXX = g++ +LINK_FLAGS = + + + +## +# Platform-specific minorGems file path prefixes +## + +PLATFORM = Linux +PLATFORM_PATH = linux + +TIME_PLATFORM = Unix +TIME_PLATFORM_PATH = unix + +DIRECTORY_PLATFORM = Unix +DIRECTORY_PLATFORM_PATH = unix diff --git a/Makefile.MacOSX b/Makefile.MacOSX new file mode 100644 index 0000000..e269e21 --- /dev/null +++ b/Makefile.MacOSX @@ -0,0 +1,44 @@ +# +# Modification History +# +# 2006-June-27 Jason Rohrer +# Created. Adapted from Transcend project. +# + + +## +# The common MacOSX portion of Makefiles. +# Should not be made manually---used by configure to build Makefiles. +## + + +# __mac__ to trigger certain mac-specific coping code +# paths to GL and GLUT headers + +PLATFORM_COMPILE_FLAGS = -DBSD -D__mac__ -I/System/Library/Frameworks/OpenGL.framework/Headers + + +# various frameworks to support OpenGL and SDL +# static linking against zlib and libpng +PLATFORM_LINK_FLAGS = -framework OpenGL -framework SDL -framework Cocoa mac/SDLMain.m /usr/lib/libz.a /usr/lib/libpng.a + + +# Nothing special for OS X here +GXX = g++ +LINK_FLAGS = + + + +## +# Platform-specific minorGems file path prefixes +## + +PLATFORM = Linux +PLATFORM_PATH = linux + +TIME_PLATFORM = Unix +TIME_PLATFORM_PATH = unix + +DIRECTORY_PLATFORM = Unix +DIRECTORY_PLATFORM_PATH = unix + diff --git a/Makefile.MinGW b/Makefile.MinGW new file mode 100644 index 0000000..aaf7a1f --- /dev/null +++ b/Makefile.MinGW @@ -0,0 +1,58 @@ +# +# Modification History +# +# 2003-November-2 Jason Rohrer +# Created. +# +# 2003-November-10 Jason Rohrer +# Removed pthread flag. +# Changed LINUX flag to WIN_32 flag. +# Added wsock32 library flag. +# + + +## +# The common MinGW (GNU for Win32) portion of Makefiles. +# Should not be made manually---used by configure to build Makefiles. +## + + +# static lib flag needed to link compiled objs against miniupnp +PLATFORM_COMPILE_FLAGS = -DWIN_32 -DSTATICLIB + + +# need various GL libraries, winmm, and portaudio +# -mwindows tells mingw to hide the dos command window on launch +PLATFORM_LINK_FLAGS = -lopengl32 -lglu32 -lmingw32 -lSDLmain -lSDL -mwindows -lwsock32 -lpng -lz + + +# All platforms but OSX support g++ and need no linker hacks +GXX = g++ +LINK_FLAGS = + + +# don't build icon.o when make invoked with no arguments! +all: SleepIsDeath + +icon.o: ../build/win32/icon.ico ../build/win32/icon.rc + cp ../build/win32/icon.ico ../build/win32/icon.rc . + windres -i icon.rc -o icon.o + +ICON_FILE = icon.o + + + +## +# Platform-specific minorGems file path prefixes +## + +PLATFORM = Win32 +PLATFORM_PATH = win32 + +TIME_PLATFORM = Win32 +TIME_PLATFORM_PATH = win32 + +DIRECTORY_PLATFORM = Win32 +DIRECTORY_PLATFORM_PATH = win32 + + diff --git a/Makefile.common b/Makefile.common new file mode 100644 index 0000000..b72836f --- /dev/null +++ b/Makefile.common @@ -0,0 +1,82 @@ +# +# Modification History +# +# 2004-April-30 Jason Rohrer +# Created. Modified from MUTE source. +# +# 2005-August-29 Jason Rohrer +# Added optimization options. +# +# 2007-April-23 Jason Rohrer +# Upgraded to latest minorGems dependency format. +# + + +## +# The common portion of all Makefiles. +# Should not be made manually---used by configure to build Makefiles. +## + + + +EXE_LINKER = ${GXX} + +RANLIB = ranlib +LIBRARY_LINKER = ar + + +DEBUG_ON_FLAG = -g #-DDEBUG_MEMORY +DEBUG_OFF_FLAG = + +DEBUG_FLAG = ${DEBUG_ON_FLAG} + + +PROFILE_ON_FLAG = -pg -DUSE_GPROF_THREADS +PROFILE_OFF_FLAG = + +PROFILE_FLAG = ${PROFILE_OFF_FLAG} + + +OPTIMIZE_ON_FLAG = -O9 +OPTIMIZE_OFF_FLAG = -O0 + +OPTIMIZE_FLAG = ${OPTIMIZE_OFF_FLAG} + + + +# common to all platforms +SOCKET_UDP_PLATFORM_PATH = unix +SOCKET_UDP_PLATFORM = Unix + + + +COMPILE_FLAGS = -Wall -Wwrite-strings -Wchar-subscripts -Wparentheses ${DEBUG_FLAG} ${PLATFORM_COMPILE_FLAGS} ${PROFILE_FLAG} ${OPTIMIZE_FLAG} -I${ROOT_PATH} + +COMMON_LIBS = ${ROOT_PATH}/minorGems/network/upnp/miniupnpc/libminiupnpc.a + + + + +COMPILE = ${GXX} ${COMPILE_FLAGS} -c +EXE_LINK = ${EXE_LINKER} ${COMPILE_FLAGS} ${LINK_FLAGS} +LIBRARY_LINK = ${LIBRARY_LINKER} cru + + +# +# Generic: +# +# Map all .cpp C++ and C files into .o object files +# +# $@ represents the name.o file +# $< represents the name.cpp file +# +.cpp.o: + ${COMPILE} -o $@ $< +.c.o: + ${COMPILE} -o $@ $< + + + + + + diff --git a/README.md b/README.md deleted file mode 100644 index 82fc270..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# SleepIsDeath -a storytelling game for two players diff --git a/build/icon_base.png b/build/icon_base.png new file mode 100644 index 0000000..a1bd4c6 Binary files /dev/null and b/build/icon_base.png differ diff --git a/build/macOSX/SleepIsDeath.app/Contents/Info.plist b/build/macOSX/SleepIsDeath.app/Contents/Info.plist new file mode 100644 index 0000000..b0cf8db --- /dev/null +++ b/build/macOSX/SleepIsDeath.app/Contents/Info.plist @@ -0,0 +1,36 @@ + + + + + CFBundleInfoDictionaryVersion + 6.0 + CFBundleIdentifier + org.passage + CFBundleDevelopmentRegion + English + CFBundleExecutable + SleepIsDeath + CFBundleIconFile + SleepIsDeath.icns + CFBundleName + SleepIsDeath + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 0 + CFBundleShortVersionString + 0 + CFBundleGetInfoString + SleepIsDeath + CFBundleLongVersionString + 0 + NSHumanReadableCopyright + Public Domain, 2010 + LSRequiresCarbon + + CSResourcesFileMapped + + + diff --git a/build/macOSX/SleepIsDeath.app/Contents/PkgInfo b/build/macOSX/SleepIsDeath.app/Contents/PkgInfo new file mode 100644 index 0000000..bd04210 --- /dev/null +++ b/build/macOSX/SleepIsDeath.app/Contents/PkgInfo @@ -0,0 +1 @@ +APPL???? \ No newline at end of file diff --git a/build/macOSX/SleepIsDeath.app/Contents/Resources/SleepIsDeath.icns b/build/macOSX/SleepIsDeath.app/Contents/Resources/SleepIsDeath.icns new file mode 100644 index 0000000..efc4e87 Binary files /dev/null and b/build/macOSX/SleepIsDeath.app/Contents/Resources/SleepIsDeath.icns differ diff --git a/build/macOSX/SleepIsDeath.app/Contents/Resources/SleepIsDeath.rsrc b/build/macOSX/SleepIsDeath.app/Contents/Resources/SleepIsDeath.rsrc new file mode 100644 index 0000000..ba75391 Binary files /dev/null and b/build/macOSX/SleepIsDeath.app/Contents/Resources/SleepIsDeath.rsrc differ diff --git a/build/macOSX/dmgNotes.txt b/build/macOSX/dmgNotes.txt new file mode 100644 index 0000000..4fddc5d --- /dev/null +++ b/build/macOSX/dmgNotes.txt @@ -0,0 +1,23 @@ +To mount dmg: + +hdiutil mount Test.dmg + + +To unmount: + +hdiutil unmount /Volumes/Test + + +To convert DMG to compressed: + +hdiutil convert Test.dmg -format UDZO -o Test_compressed.dmg + + +To convert compressed DMG to R/W: + +hdiutil convert Test_compressed.dmg -format UDRW -o Test.dmg + + +To rename a volume: + +diskutil rename /Volumes/NameA NameB diff --git a/build/macOSX/iconColor.png b/build/macOSX/iconColor.png new file mode 100644 index 0000000..eccb82c Binary files /dev/null and b/build/macOSX/iconColor.png differ diff --git a/build/macOSX/iconMask.png b/build/macOSX/iconMask.png new file mode 100644 index 0000000..4d77896 Binary files /dev/null and b/build/macOSX/iconMask.png differ diff --git a/build/makeDistributionMacOSX b/build/makeDistributionMacOSX new file mode 100755 index 0000000..5382362 --- /dev/null +++ b/build/makeDistributionMacOSX @@ -0,0 +1,72 @@ +#!/bin/sh + +# +# Modification History +# +# 2007-November-12 Jason Rohrer +# Copied from Cultivation build. +# + + +if [ $# -lt 3 ] ; then + echo "Usage: $0 release_name unix_platform_name path_to_SDL.framework" + exit 1 +fi + + +rm -rf mac + +mkdir mac + + + +mkdir mac/SleepIsDeath +mkdir mac/SleepIsDeath/graphics +mkdir mac/SleepIsDeath/settings +mkdir mac/SleepIsDeath/languages +mkdir mac/SleepIsDeath/templates +mkdir mac/SleepIsDeath/loadingBay +mkdir mac/SleepIsDeath/importOldCache + + +cp ../gameSource/resourceSet15.tar.gz . +tar xzf resourceSet15.tar.gz +cp -r resourceSet15/* mac/SleepIsDeath/ +rm -r resourceSet15/ resourceSet15.tar.gz + + + +cp ../gameSource/graphics/*.tga mac/SleepIsDeath/graphics +cp ../gameSource/settings/*.ini mac/SleepIsDeath/settings +cp ../gameSource/languages/*.txt mac/SleepIsDeath/languages +cp ../gameSource/templates/*.php mac/SleepIsDeath/templates +cp ../gameSource/templates/*.html mac/SleepIsDeath/templates +cp ../gameSource/templates/*.png mac/SleepIsDeath/templates +cp ../gameSource/language.txt mac/SleepIsDeath +cp ../documentation/Readme.txt mac/SleepIsDeath +cp ../documentation/Upgrading.txt mac/SleepIsDeath + + + + +cp -r macOSX/SleepIsDeath.app mac/SleepIsDeath/SleepIsDeath.app +cp ../gameSource/SleepIsDeath mac/SleepIsDeath/SleepIsDeath.app/Contents/MacOS + +rm -r mac/SleepIsDeath/SleepIsDeath.app/CVS +rm -r mac/SleepIsDeath/SleepIsDeath.app/Contents/CVS +rm -r mac/SleepIsDeath/SleepIsDeath.app/Contents/MacOS/CVS +rm -r mac/SleepIsDeath/SleepIsDeath.app/Contents/Resources/CVS +rm -r mac/SleepIsDeath/SleepIsDeath.app/Contents/Frameworks/CVS + +# install SDL framework +cp -r $3 mac/SleepIsDeath/SleepIsDeath.app/Contents/Frameworks/ + +cd mac +tar cf "SleepIsDeath_$1_$2.tar" SleepIsDeath +gzip "SleepIsDeath_$1_$2.tar" + + + + + + diff --git a/build/makeDistributions b/build/makeDistributions new file mode 100755 index 0000000..2874a47 --- /dev/null +++ b/build/makeDistributions @@ -0,0 +1,102 @@ +#!/bin/sh + +# +# Modification History +# +# 2007-November-12 Jason Rohrer +# Copied from Cultivation build. +# + + +if [ $# -lt 2 ] ; then + echo "Usage: $0 release_name unix_platform_name" + exit 1 +fi + + +rm -rf unix +rm -rf windows + +mkdir windows +mkdir unix + + +# work on unix tree first +mkdir unix/SleepIsDeath +mkdir unix/SleepIsDeath/graphics +mkdir unix/SleepIsDeath/settings +mkdir unix/SleepIsDeath/languages +mkdir unix/SleepIsDeath/templates +mkdir unix/SleepIsDeath/loadingBay +mkdir unix/SleepIsDeath/importOldCache + + + +cp ../gameSource/resourceSet15.tar.gz . +tar xzf resourceSet15.tar.gz +cp -r resourceSet15/* unix/SleepIsDeath/ +rm -r resourceSet15/ resourceSet15.tar.gz + + + +cp ../gameSource/graphics/*.tga unix/SleepIsDeath/graphics +cp ../gameSource/settings/*.ini unix/SleepIsDeath/settings +cp ../gameSource/languages/*.txt unix/SleepIsDeath/languages +cp ../gameSource/templates/*.php unix/SleepIsDeath/templates +cp ../gameSource/templates/*.html unix/SleepIsDeath/templates +cp ../gameSource/templates/*.png unix/SleepIsDeath/templates +cp ../gameSource/language.txt unix/SleepIsDeath +cp ../documentation/Readme.txt unix/SleepIsDeath +cp ../documentation/Upgrading.txt unix/SleepIsDeath + + + +# duplicate unix tree so far to make windows tree +cp -r unix/SleepIsDeath windows/ + +cp ../gameSource/SleepIsDeath unix/SleepIsDeath/ + +cp win32/SleepIsDeath.exe win32/*.dll windows/SleepIsDeath/ + +cd unix +tar cf "SleepIsDeath_$1_$2.tar" SleepIsDeath +gzip "SleepIsDeath_$1_$2.tar" + + +cd .. + +g++ -o unix2dos unix2dos.c +cp unix2dos windows +cp unix2dosScript windows + + +cd windows + + +for file in SleepIsDeath/languages/*.txt +do + ./unix2dosScript "$file" +done + +for file in SleepIsDeath/templates/*.php +do + ./unix2dosScript "$file" +done + +for file in SleepIsDeath/templates/*.html +do + ./unix2dosScript "$file" +done + + +./unix2dosScript "SleepIsDeath/resourceCache/stringDatabase.txt" +./unix2dosScript "SleepIsDeath/Readme.txt" +./unix2dosScript "SleepIsDeath/Upgrading.txt" + + +zip -r "SleepIsDeath_$1_Windows.zip" SleepIsDeath + + + + + diff --git a/build/source/cleanSrc b/build/source/cleanSrc new file mode 100755 index 0000000..9f1fe17 --- /dev/null +++ b/build/source/cleanSrc @@ -0,0 +1,18 @@ +rm -r minorGems/ai +rm -r minorGems/bench +rm -r minorGems/doc +rm -r minorGems/examples +rm -r minorGems/sound + +rm -r SleepIsDeath/documentation/guides +rm -r SleepIsDeath/documentation/html +rm -r SleepIsDeath/documentation/installation +rm -r SleepIsDeath/documentation/press +rm -r SleepIsDeath/documentation/releasePlan +rm -r SleepIsDeath/documentation/teaser + +rm SleepIsDeath/gameSource/resourcePack*.tar.gz +rm SleepIsDeath/gameSource/resourceSet10.tar.gz +rm SleepIsDeath/gameSource/resourceSet12.tar.gz +rm SleepIsDeath/gameSource/resourceSet14.tar.gz + diff --git a/build/source/exportSrc b/build/source/exportSrc new file mode 100755 index 0000000..701f563 --- /dev/null +++ b/build/source/exportSrc @@ -0,0 +1,9 @@ +SOURCEDIR=`pwd` +echo "running export from $SOURCEDIR" + +cd ../../../../minorGems +hg archive $SOURCEDIR/minorGems + +cd $SOURCEDIR + +cvs -z3 -d:ext:jcr13@hcsoftware.cvs.sourceforge.net:/cvsroot/hcsoftware export -r HEAD SleepIsDeath \ No newline at end of file diff --git a/build/source/runToBuild b/build/source/runToBuild new file mode 100755 index 0000000..c9e1af5 --- /dev/null +++ b/build/source/runToBuild @@ -0,0 +1,82 @@ +#!/bin/bash + +# +# Modification History +# +# 2010-April-2 Andy Sommerville +# - Added a few "|| exit 1" to terminate as soon as error occurs. +# - Read menu choice from argv[1]. +# - Added "-p" to mkdir to suppress "already exists" message. +# - Added automatic backup of "resourceCache". (wish I'd thought of that a few minutes ago....) +# +# 2007-November-12 Jason Rohrer +# Copied from Cultivation. +# + + +cd SleepIsDeath +chmod u+x ./configure +./configure $@ || exit 1 + + +echo "Building miniUPNP..." + +cd ../minorGems/network/upnp/miniupnpc +make || exit 1 +cd ../../../../SleepIsDeath + + +cd gameSource + + +echo "Building SleepIsDeath..." + +make || exit 1 + + + +cd ../.. + +mkdir -p graphics +mkdir -p settings +mkdir -p languages +mkdir -p templates +mkdir -p loadingBay +mkdir -p importOldCache + +# this now happens from resource pack expansion, below +#mkdir resourceCache +#cd resourceCache +#mkdir object room sprite tile +#cd .. + + +cp SleepIsDeath/gameSource/SleepIsDeath ./SleepIsDeathApp +cp SleepIsDeath/documentation/Readme.txt . +cp SleepIsDeath/documentation/Upgrading.txt . +cp SleepIsDeath/gameSource/graphics/* ./graphics +cp SleepIsDeath/gameSource/settings/* ./settings +cp SleepIsDeath/gameSource/languages/* ./languages +cp SleepIsDeath/gameSource/language.txt ./ +cp SleepIsDeath/gameSource/templates/*.php ./templates +cp SleepIsDeath/gameSource/templates/*.html ./templates +cp SleepIsDeath/gameSource/templates/*.png ./templates + +# backup old resources +if [ -d resourceCache ] ; then + BACKUP=resourceCache-backup-$(date '+%Y%m%d%H%M%S').tar.gz + echo "Backing up resources to $BACKUP" + tar -czf $BACKUP resourceCache +fi + +# copy default resources +tar xzf SleepIsDeath/gameSource/resourceSet15.tar.gz + +cp -r resourceSet15/* . + + +echo "Run SleepIsDeathApp to play." + + + + diff --git a/build/unix2dos.c b/build/unix2dos.c new file mode 100644 index 0000000..9ff8902 --- /dev/null +++ b/build/unix2dos.c @@ -0,0 +1,22 @@ +#include +#include + +int +main(void) +{ + while(1) { + int c = getchar(); + + if(c == EOF) + exit(0); + + if(c == '\n') { + putchar(015); /* ^M */ + putchar(012); /* ^J */ + } else { + putchar(c); + } + } + + exit(0); +} diff --git a/build/unix2dosScript b/build/unix2dosScript new file mode 100755 index 0000000..bfe4321 --- /dev/null +++ b/build/unix2dosScript @@ -0,0 +1,7 @@ + + +cat "$1" | ./unix2dos > tempUNIX2DOS.txt + +cp -f tempUNIX2DOS.txt "$1" + +rm -f tempUNIX2DOS.txt \ No newline at end of file diff --git a/build/win32/SDL.dll b/build/win32/SDL.dll new file mode 100755 index 0000000..3ce97a5 Binary files /dev/null and b/build/win32/SDL.dll differ diff --git a/build/win32/icon.ico b/build/win32/icon.ico new file mode 100644 index 0000000..d100bef Binary files /dev/null and b/build/win32/icon.ico differ diff --git a/build/win32/icon.png b/build/win32/icon.png new file mode 100644 index 0000000..7eb4f8a Binary files /dev/null and b/build/win32/icon.png differ diff --git a/build/win32/icon.rc b/build/win32/icon.rc new file mode 100644 index 0000000..86e8e9b --- /dev/null +++ b/build/win32/icon.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON DISCARDABLE "icon.ico" diff --git a/build/win32/icon_installer.ico b/build/win32/icon_installer.ico new file mode 100644 index 0000000..6e63d6f Binary files /dev/null and b/build/win32/icon_installer.ico differ diff --git a/build/win32/icon_installer.png b/build/win32/icon_installer.png new file mode 100644 index 0000000..645d4dc Binary files /dev/null and b/build/win32/icon_installer.png differ diff --git a/build/win32/libpng3.dll b/build/win32/libpng3.dll new file mode 100755 index 0000000..649ec64 Binary files /dev/null and b/build/win32/libpng3.dll differ diff --git a/build/win32/zlib1.dll b/build/win32/zlib1.dll new file mode 100755 index 0000000..076f503 Binary files /dev/null and b/build/win32/zlib1.dll differ diff --git a/configure b/configure new file mode 100755 index 0000000..4b32ce9 --- /dev/null +++ b/configure @@ -0,0 +1,104 @@ +#!/bin/bash + +# +# Modification History +# +# 2010-April-2 Andy Sommerville +# Allow menu choice from argv. +# "exit 1" when user chooses 'q'; terminate build. +# +# 2006-June-27 Jason Rohrer +# Copied/modified from Transcend project. Dropped a platforms that were only +# nominally supported. +# + +if [[ "$1" < "4" ]] ; then + if [[ "$1" > "0" ]] ; then + platformSelection="$1" + fi +fi +while [ -z "$platformSelection" ] +do + + echo "select platform:" + + echo " 1 -- GNU/Linux" + echo " 2 -- MacOSX" + echo " 3 -- Win32 using MinGW" + echo " q -- quit" + + echo "" + echo -n "> " + + read platformSelection + + + if [ "$platformSelection" = "q" ] + then + exit 1 + fi + + + # use ASCII comparison. + + if [[ "$platformSelection" > "3" ]] + then + platformSelection="" + fi + + if [[ "$platformSelection" < "1" ]] + then + platformSelection="" + fi + +done + + +# use partial makefiles from minorGems project +makefileMinorGems="../minorGems/build/Makefile.minorGems" +makefileMinorGemsTargets="../minorGems/build/Makefile.minorGems_targets" + + + +platformName="Generic" +platformMakefile="generic" + + + +case "$platformSelection" in + + + "1" ) + platformName="GNU/Linux" + platformMakefile="Makefile.GnuLinux" + ;; + + + "2" ) + platformName="MacOSX" + platformMakefile="Makefile.MacOSX" + ;; + + + "3" ) + platformName="Win32 MinGW" + platformMakefile="Makefile.MinGW" + ;; + + +esac + + + +rm -f Makefile.temp +echo "# Auto-generated by game7/configure for the $platformName platform. Do not edit manually." > Makefile.temp + +rm -f gameSource/Makefile +cat Makefile.temp $platformMakefile Makefile.common $makefileMinorGems gameSource/Makefile.all $makefileMinorGemsTargets > gameSource/Makefile + + +rm Makefile.temp + + + +exit diff --git a/demo/index.html b/demo/index.html new file mode 100644 index 0000000..5fda3b0 --- /dev/null +++ b/demo/index.html @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/demo/server.php b/demo/server.php new file mode 100644 index 0000000..7136592 --- /dev/null +++ b/demo/server.php @@ -0,0 +1,914 @@ + +Demo Permissions Server Web-based setup + + + + + + +"; + +$setup_footer = " + + + +