summaryrefslogtreecommitdiff
path: root/dot/local/bin/doom1
blob: 42c7274cbdb8cbd8090e9c262d9db7bf2a842e1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
game=${0##*/}
waddir=/usr/share/games/doom
case "$game" in
	doom1) game=doom ;;
esac
if ! [ -e "$waddir"/"$game".wad ]
then
	set --
	for wad in "$waddir"/*.wad
	do
		wad=${wad##*/}
		wad=${wad%.wad}
		set -- "$@" "$wad"
	done
	exec >&2
	echo "Error: No WAD found for $game ('$waddir/$game.wad' not found)"
	echo "Available WAD files: $@"
	exit 1
fi
savedir=~/.prboom-plus/save/"$game"
mkdir -p "$savedir"
prboom-plus -save "$savedir" -iwad "$game" -window "$@"