]> icculus.org git repositories - divverent/nexuiz.git/blob - data/maps/compile.sh
fixed ent pos
[divverent/nexuiz.git] / data / maps / compile.sh
1 #!/bin/sh
2
3 : ignore <<'EOF'
4
5 Nexuiz map recompilation script
6
7 NOTE: to use this script, you need a shell script called q3map2 in your $PATH.
8       Mine looks like this:
9
10         #!/bin/sh
11         exec ~/bin/q3map2.x86 -threads 2 "$@"
12
13       Note that you can NOT call q3map2.x86 directly from $PATH, as it segfaults
14       then!
15
16 Usage:
17 sh compile.sh tznex01
18
19 EOF
20
21 #settings_tznex01=":-fast:-fast"
22 settings_default="-samplesize 8::-deluxe -patchshadows -samples 3"
23
24 set -ex
25
26 map2()
27 {
28         dir=`pwd`
29         # note: you are in data/maps. Removintg these two components...
30         dir=${dir%/*/*}
31
32         q3map2 -fs_basepath "$dir" -fs_game data -v "$@"
33 }
34
35 for MAP in "$@"; do
36         [ -f "$MAP.map" ]
37
38         # get settings for this map
39         eval s=\$settings_$MAP
40         [ -n "$s" ] || s=$settings_default
41
42         # recompile it
43         map2 -bsp -meta `echo "$s" | cut -d : -f 1` "$MAP.map" | tee    "$MAP.log"
44         map2 -vis       `echo "$s" | cut -d : -f 2` "$MAP.map" | tee -a "$MAP.log"
45         map2 -light     `echo "$s" | cut -d : -f 3` "$MAP.map" | tee -a "$MAP.log"
46         rm   -f                                     "$MAP.srf"
47 done