1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- #!/bin/sh
- show_usage (){
- printf "Usage: $0 [options [parameters]]\n"
- printf "\n"
- printf "Mandatory options:\n"
- printf " -i|--iwad [doom | doom2 | tnt | plutonia | heretic | hexen | hexdd] (Mandatory)\n"
- printf "\n"
- printf "Options:\n"
- printf " -w|--wads (wad or space separated wad list)\n"
- printf "\n"
- printf " -l|--list, list available wad files\n"
- printf " -h|--help, Print help\n"
- exit
- }
- if [ -z "$1" ]; then
- show_usage
- fi
- if { [ "$1" = --help ] || [ "$1" = -h ];}; then
- show_usage
- fi
- if { [ "$1" = --list ] || [ "$1" = -l ];}; then
- find "$HOME"/games/doom/wads/{doom,doom2,tnt,plutonia,heretic,hexen}/{vanilla,nolimit}/*/*.wad -type f -printf "%T@ %Tc %p\n" | sort -rn | awk '{print $9}' >/dev/null 2>&1 | grep -v 'tex' | grep -v 'fix' | grep -v 'res' | grep -v 'demo' | grep -v 'credits'
- #find ~/games/doom/wads/doom2/*/*/{*.wad,*.pk3} -printf "%T@ %Tc %p\n" | sort -rn | awk '{print $9}'
- echo ""
- exit
- fi
- while [ -n "$1" ]; do
- case "$1" in
- --iwad | -i)
- shift
- echo "iwad: $1"
- iwad=$1
- ;;
- --wad | -w)
- shift
- echo "wad: $1"
- wad=$1
- ;;
- *)
- show_usage
- ;;
- esac
- shift
- done
- if [ -z "$iwad" ]; then
- show_usage
- fi
- if [ -z "$wad" ]; then
- show_usage
- fi
- iwads="doom doom2 tnt plutonia heretic hexen hexdd"
- echo "$iwads" | tr ' ' '\n' | while read -r item; do
- if [ "$item" = "$iwad" ]; then touch match; fi
- done
- if [ ! -f match ]; then echo "ERROR: $iwad is not a valid option, valid options are: $iwads"; exit 1; fi; rm match
- mods=
- base_dir="$HOME/games/doom"
- doom_mods="$base_dir/mods/vanilla/pk_doom_sfx/pk_doom_sfx_20120224.wad $base_dir/mods/vanilla/jovian_palette/JoyPal.wad"
- heretic_mods="$base_dir/mods/vanilla/dimm_pal/her-pal.wad"
- hexen_mods="$base_dir/mods/vanilla/dimm_pal/hex-pal.wad"
- doom_config="$base_dir"/config/crispy/config_nolimit.ini
- heretic_config="$base_dir"/config/crispy/config_nolimit_heretic.ini
- hexen_config="$base_dir"/config/crispy/config_nolimit_hexen.ini
- if [ -f ~/src/crispy-doom/src/crispy-doom ]; then
- engine_doom="~/src/crispy-doom/src/crispy-doom"
- engine_heretic="~/src/crispy-doom/src/crispy-heretic"
- engine_hexen="~/crispy-doom/src/crispy-hexen"
- else
- engine_doom="crispy-doom"
- engine_heretic="crispy-heretic"
- engine_hexen="crispy-hexen"
- fi
- case "$iwad" in
- *doom*) mods=$doom_mods; engine=$engine_doom; config=$doom_config ;;
- *tnt*) mods=$doom_mods; engine=$engine_doom; config=$doom_config ;;
- *plutonia*) mods=$doom_mods; engine=$engine_doom; config=$doom_config ;;
- *heretic*) mods=$heretic_mods, engine=$engine_heretic; config=$heretic_config ;;
- *hexen*) mods=$hexen_mods; engine=$engine_hexen; config=$hexen_config ;;
- *hexdd*) mods=$hexen_mods; engine=$engine_hexen; config=$hexen_config ;;
- esac
- $engine -fullscreen -config "$config" -iwad "$base_dir"/wads/iwads/"$iwad".wad -file "$wad" $mods -savedir "$base_dir"/savegames/"$iwad"/ -skill 3 -warp 01
|