nuclide/vmap

39 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
SCRPATH="$( cd "$( dirname $(readlink -nf $0) )" && pwd )"
PATH="$SCRPATH"/bin:"$PATH"
if [ ! -f "$SCRPATH"/bin/vmap ]; then
printf "Map compiler is not present, please run build_editor.sh\n"
exit
fi
# Check how many cores/processors we should use for building
if ! [ -x "$(command -v nproc)" ]; then
# check if we're on OpenBSD then
if ! [ -x "$(command -v sysctl)" ]; then
BUILD_PROC=1
else
BUILD_PROC=$(sysctl -n hw.ncpu)
fi
else
BUILD_PROC=$(nproc)
fi
set -e
if [ "$VMAP_NOBSP" != "1" ]; then
"$SCRPATH"/bin/vmap -v -custinfoparms -fs_basepath "$SCRPATH" -fs_game platform -threads $BUILD_PROC -samplesize 8 $*
fi
if [ "$VMAP_NOVIS" != "1" ]; then
if [ "$VMAP_FASTVIS" != "1" ]; then
"$SCRPATH"/bin/vmap -vis -v -fs_basepath "$SCRPATH" -fs_game platform $*
else
"$SCRPATH"/bin/vmap -vis -v -fast -fs_basepath "$SCRPATH" -fs_game platform $*
fi
fi
if [ "$VMAP_NOLIGHT" != "1" ]; then
"$SCRPATH"/bin/vmap -light -custinfoparms -fs_basepath "$SCRPATH" -v -dirty -fs_game platform -bounce 8 -samplesize 8 -threads $BUILD_PROC -shade -shadeangle 60 -patchshadows $*
fi