aboutsummaryrefslogtreecommitdiffstats
path: root/games/wolf3d/files/wolf3d.in
blob: 772c64ede26ce35f6e2d4f5b2c260ca2a1a91039 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/sh
#
# wolf3d - wolf3d-20011028 wrapper script
#
# 2004 Travis Poppe
#

USERDIR="$HOME/.wolf3d"
WOLF_BIN="sdlwolf3d"

msg_game()
{
    echo "Please provide a \"-game\" parameter with one of the following values:"
    echo ""
    echo "wf - Wolfenstein 3D (full version)"
    echo "ws - Wolfenstein 3D (shareware version)"
    echo "sf - Spear of Destiny (full version)"
    echo "ss - Spear of Destiny (shareware version)"
    echo ""
}

msg_options()
{
    echo "Basic options:"
    echo ""
    echo "-nowait           Skips introduction"
    echo "-nojoy            Disables joystick"
    echo "-nomouse          Disables mouse"
    echo "-x2               Increases screen size by x2"
    echo "-x3               Increases screen size by x3"
    echo "-fullscreen       Enables fullscreen mode"
    echo "-demotest         Starts wolf3d in demonstration mode"
    echo "-version          Reports game version"
    echo ""
}

if [ "$1" = "-game" -a -n "`echo $2 | grep -E '^(wf|ws|sf|ss)$'`" ]
then
    GAME="$2"
    shift; shift

    if [ ! -d $USERDIR ]
    then
        mkdir $USERDIR
        ln -s %%PREFIX%%/libexec/wolf3d/* $USERDIR
        ln -s %%DATADIR%%/* $USERDIR

        echo "wolf3d was installed to $USERDIR/"
    else
        echo "wolf3d appears to be installed to $USERDIR/"
    fi

    msg_options

    cd $USERDIR || exit 1
    exec ./${WOLF_BIN}-${GAME} "$@"
else
    msg_game

    exit 1
fi