#!/bin/sh # $OpenBSD$ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Doomsday engine v1.8.6 wrapper, v1.0 # # Author - Ryan Freeman # # provides a better interface to the engine to make startup options # # easier to use and to keep output files in a $HOME/.doomsday/ dir # # and not spew in $PWD # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # usage () { print "Doomsday Engine 1.8.6\n\nUsage: doomsday game args\n"; print "Normal Doom/Heretic/Hexen arguments such as -file for loading"; print "PWADs or other game options may be used after selecting one"; print "of the games below:\n"; print " -doom Doom / Ultimate Doom"; print " -doom2 Doom II: Hell on Earth"; print " -plutonia Final Doom: Plutonia Experiment"; print " -tnt Final Doom: Evilution"; print " -heretic Heretic / Heretic: Shadow of the Serpent Riders"; print " -hexen Hexen: Beyond Heretic\n"; print "NOTE: Data files from above-mentioned games must be installed"; print "into \$DOOMWADDIR (currently $DOOMWADDIR) else"; print "you will get an IWAD load error when choosing a non-existent"; print "game data file. Also, -file PWAD args need to be absolute.\n"; } # set DOOMWADDIR to standard location DOOMWADDIR=/usr/local/share/games/doom # verify game specified, show usage [[ $# < 1 ]] && { usage print "ERROR: no game specified"; exit 1; } # sanity check. verify doomsday configuration directories exist [[ ! -d ~/.doomsday ]] && mkdir ~/.doomsday [[ ! -d ~/.doomsday/jdoom ]] && mkdir ~/.doomsday/jdoom [[ ! -d ~/.doomsday/jheretic ]] && mkdir ~/.doomsday/jheretic [[ ! -d ~/.doomsday/jhexen ]] && mkdir ~/.doomsday/jhexen # run selected game and store configs and other output files properly [[ $1 = -doom ]] && { shift 1 doomsday-bin -game jdoom -userdir ~/.doomsday/jdoom -iwad \ ${DOOMWADDIR}/doom.wad "$@" } [[ $1 = -doom2 ]] && { shift 1 doomsday-bin -game jdoom -userdir ~/.doomsday/jdoom -iwad \ ${DOOMWADDIR}/doom2.wad $* } [[ $1 = -plutonia ]] && { shift 1 doomsday-bin -game jdoom -userdir ~/.doomsday/jdoom -iwad \ ${DOOMWADDIR}/plutonia.wad $* } [[ $1 = -tnt ]] && { shift 1 doomsday-bin -game jdoom -userdir ~/.doomsday/jdoom -iwad \ ${DOOMWADDIR}/tnt.wad $* } [[ $1 = -heretic ]] && { shift 1 doomsday-bin -game jheretic -userdir ~/.doomsday/jheretic -iwad \ ${DOOMWADDIR}/heretic.wad $* } [[ $1 = -hexen ]] && { shift 1 doomsday-bin -game jhexen -userdir ~/.doomsday/jhexen -iwad \ ${DOOMWADDIR}/hexen.wad $* }