#!/bin/sh

set -e

if [ "$#" -ne 1 ]; then
  echo "Expected exactly one argument.  Example usage:" 2>&1
  echo "  `basename \"${0}\"` ut4_icy.map" 2>&1
  exit 1
fi
MAPNAME="$1"
Q3MAP2="q3map2-v2.5.17"
URTDIR="${HOME}/UrbanTerror"

"${Q3MAP2}" -v -game quake3 -fs_basepath "${URTDIR}" -meta \
  -patchmeta -subdivisions 1 -fs_game q3ut4 "${MAPNAME}"
"${Q3MAP2}" -game quake3 -fs_basepath "${URTDIR}" -vis -saveprt \
  -fs_game q3ut4 "${MAPNAME}"
"${Q3MAP2}" -v -game quake3 -fs_basepath "${URTDIR}" -light -fast \
  -super 4 -filter -bounce 4 -patchshadows -fs_game q3ut4 "${MAPNAME}"
