mirror of
https://gitlab.com/xonotic/xonotic
synced 2025-01-18 20:21:18 +00:00
add a REALLY FUN FUN FUN texture randomizer script
This commit is contained in:
parent
59ecb5b7d8
commit
433d27100a
37
misc/tools/bsptool-shaderfun.sh
Executable file
37
misc/tools/bsptool-shaderfun.sh
Executable file
@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
|
||||
# input: a .shader file
|
||||
# parameters: in and out .bsp file
|
||||
|
||||
BSPTOOL="${0%/*}"/bsptool.pl
|
||||
LF="
|
||||
"
|
||||
|
||||
in=$1
|
||||
out=$2
|
||||
|
||||
shaders=`"$BSPTOOL" "$in" -S`
|
||||
|
||||
newshaders=`cat | grep '^[^ {}]'`
|
||||
|
||||
set --
|
||||
|
||||
list=
|
||||
for shader in $shaders; do
|
||||
if [ -z "$list" ]; then
|
||||
echo >&2 "Filling list..."
|
||||
list=`echo "$newshaders" | sort -R`$LF
|
||||
fi
|
||||
case "$shader" in
|
||||
noshader|NULL|textures/common/*)
|
||||
;;
|
||||
*)
|
||||
item=${list%%$LF*}
|
||||
list=${list#*$LF}
|
||||
set -- "$@" "-S$shader=$item"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
set -- "$BSPTOOL" "$in" "$@" -o"$out"
|
||||
"$@"
|
Loading…
Reference in New Issue
Block a user