forked from DavidGriffith/daphne
-
Notifications
You must be signed in to change notification settings - Fork 0
/
singe.sh
executable file
·72 lines (60 loc) · 1.68 KB
/
singe.sh
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
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
SCRIPT_DIR=`dirname "$0"`
if realpath / >/dev/null; then SCRIPT_DIR=$(realpath "$SCRIPT_DIR"); fi
DAPHNE_BIN=daphne.bin
DAPHNE_SHARE=~/.daphne
function STDERR () {
/bin/cat - 1>&2
}
echo "Singe Launcher : Script dir is $SCRIPT_DIR"
cd "$SCRIPT_DIR"
# point to our linked libs that user may not have
export LD_LIBRARY_PATH=$SCRIPT_DIR:$DAPHNE_SHARE:$LD_LIBRARY_PATH
if [ "$1" = "-fullscreen" ]; then
FULLSCREEN="-fullscreen"
shift
fi
if [ -z $1 ] ; then
echo "Specify a game to try: " | STDERR
echo
echo "$0 [-fullscreen] <gamename>" | STDERR
echo
echo -n "Games available: " | STDERR
for game in $(ls $DAPHNE_SHARE/singe/); do
installed="$installed $game"
done
echo "$installed" | fold -s -w60 | sed 's/^ //; s/^/\t/' | STDERR
echo
exit
fi
if [ ! -f $DAPHNE_SHARE/singe/$1/$1.singe ] || [ ! -f $DAPHNE_SHARE/singe/$1/$1.txt ]; then
echo
echo "Missing file: $DAPHNE_SHARE/singe/$1/$1.singe ?" | STDERR
echo " $DAPHNE_SHARE/singe/$1/$1.txt ?" | STDERR
echo
exit 1
fi
#strace -o strace.txt \
./$DAPHNE_BIN singe vldp \
$FULLSCREEN \
-framefile $DAPHNE_SHARE/singe/$1/$1.txt \
-script $DAPHNE_SHARE/singe/$1/$1.singe \
-homedir $DAPHNE_SHARE \
-datadir $DAPHNE_SHARE \
-sound_buffer 2048 \
-noserversend \
-x 800 \
-y 600
EXIT_CODE=$?
if [ "$EXIT_CODE" -ne "0" ] ; then
if [ "$EXIT_CODE" -eq "127" ]; then
echo ""
echo "Daphne failed to start." | STDERR
echo "This is probably due to a library problem." | STDERR
echo "Run ./daphne.bin directly to see which libraries are missing." | STDERR
echo ""
else
echo "DaphneLoader failed with an unknown exit code : $EXIT_CODE." | STDERR
fi
exit $EXIT_CODE
fi