X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=scripts%2Fshader-audit.sh;h=250e7d3ae84785e2e9bb800711fd393648ccdf01;hb=a2e171dbec4303eb20a814dce168b44ed4280cb8;hp=c90a4e7509186ccb3908523410e2cb4ed19907b2;hpb=d921f21a0d29d43961fc1774163435363275cd36;p=xonotic%2Fxonotic-maps.pk3dir.git diff --git a/scripts/shader-audit.sh b/scripts/shader-audit.sh index c90a4e75..250e7d3a 100755 --- a/scripts/shader-audit.sh +++ b/scripts/shader-audit.sh @@ -187,7 +187,7 @@ use_texture() parsing_shader= parse_shaderstage() { - while read L A1 A2 Aother; do + while read L A1 Aother; do case "$L" in map) case "$A1" in @@ -199,7 +199,7 @@ parse_shaderstage() esac ;; animmap) - for X in $A2 $Aother; do + for X in $Aother; do use_texture "$parsing_shader" "`normalize "$X"`" animmap done ;; @@ -215,7 +215,7 @@ parse_shaderstage() parse_shader() { use_texture "$parsing_shader" "$parsing_shader" shader - while read L A1 AREST; do + while read L A1 Aother; do case "$L" in qer_editorimage) use_texture "$parsing_shader" "`normalize "$A1"`" editorimage @@ -286,11 +286,14 @@ strip_comments() sed 's,//.*,,g; s,\r, ,g; s,\t, ,g; s, *, ,g; s, $,,; s,^ ,,; /^$/ d' } +t=`mktemp || echo ".temp"` for X in *.shader; do - strip_comments < "$X" | parse_shaderfile "${X%.shader}" + strip_comments < "$X" > "$t" + parse_shaderfile "${X%.shader}" < "$t" done +rm -f "$t" -textures_avail=`( cd ..; find textures/ -type f -not -name '*_norm.*' -not -name '*_glow.*' -not -name '*_gloss.*' -not -name '*.xcf' ) | while IFS= read -r T; do normalize "$T"; done | sort -u` +textures_avail=`( cd ..; find textures/ -type f -not -name '*_norm.*' -not -name '*_glow.*' -not -name '*_gloss.*' -not -name '*_reflect.*' -not -name '*_bump.*' -not -name '*.xcf' ) | while IFS= read -r T; do normalize "$T"; done | sort -u` textures_used=`echo "${textures_used#$LF}" | sort -u` echo "$textures_used$LF$textures_used$LF$textures_avail" | sort | uniq -u | while IFS= read -r L; do