From: Rudolf Polzer Date: Thu, 15 Jul 2010 18:41:40 +0000 (+0200) Subject: better shader audit script - now all of tZork's shaders pass X-Git-Tag: xonotic-v0.1.0preview~154^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=99ea8d69016b9f583f36302fd947896684af351f;p=xonotic%2Fxonotic-maps.pk3dir.git better shader audit script - now all of tZork's shaders pass --- diff --git a/scripts/shader-audit.sh b/scripts/shader-audit.sh index 2d020a08..8076dea9 100644 --- a/scripts/shader-audit.sh +++ b/scripts/shader-audit.sh @@ -30,6 +30,56 @@ use_texture() textures_used="$textures_used$LF$2" # TODO verify shader -> texture name + case "$1" in + textures/*x/*-*) + pre=${1%%x/*}x + suf=${1#*x/} + # rule: in suffix part, change each - to / + suf="`echo "$suf" | sed 's,-,/,g'`" + case "$2" in + "$pre"/*/*) + ;; + *) + echo "(EE) texture $2 of shader $1 is out of place, recommended file name is $pre/$suf" + ;; + esac + ;; + textures/*x/*) + pre=${1%%x/*}x + suf=${1#*x/} + case "$2" in + "$pre"/*/*) + ;; + *) + echo "(EE) texture $2 of shader $1 is out of place, recommended file name is $pre/base/$suf" + ;; + esac + ;; + textures/common/*) + case "$2" in + "$1") + ;; + textures/common/*/*) + ;; + *) + echo "(EE) texture $2 of shader $1 is out of place, recommended file name is $1 or textures/common/*/*" + ;; + esac + ;; + textures/decals/*) + case "$2" in + "$1") + # I _suppose_ this is fine, as tZork committed this pack + ;; + *) + echo "(EE) texture $2 of shader $1 is out of place, recommended file name is $1 or textures/common/*/*" + ;; + esac + ;; + *) + echo "(EE) no shader name pattern for $1" + ;; + esac } parsing_shader=