Add Cushion texture - thanks hotdog
[xonotic/xonotic-maps.pk3dir.git] / scripts / shader-parser.subr
index ea964572f83f1342651850b571407ff97e46575c..5f18cec84a90434f80a55540bfd15bf52c99b8b9 100644 (file)
@@ -4,7 +4,7 @@
 
 shader_normalize()
 {
-       echo "$1" | sed 's/\.\(tga\|jpg\|png\)$//'
+       echo "$1" | sed 's/^"//; s/"$//; s/\.\(tga\|jpg\|png\)$//'
 }
 
 parse_shaderstage_pre()
@@ -30,6 +30,8 @@ parse_shaderstage()
                        '}')
                                break
                                ;;
+                       '')
+                               ;;
                        *)
                                parse_shaderstage_line "$shaderparser_L" "$shaderparser_A1" "$shaderparser_Aother"
                                ;;
@@ -61,6 +63,8 @@ parse_shader()
                        '}')
                                break
                                ;;
+                       '')
+                               ;;
                        *)
                                parse_shader_line "$shaderparser_L" "$shaderparser_A1" "$shaderparser_Aother"
                                ;;
@@ -109,7 +113,7 @@ shaderparser_strip_comments()
 parse_shaders()
 {
        shaderparser_t=`mktemp || echo ".temp"`
-       for shaderparser_X in *.shader; do
+       for shaderparser_X in "$@"; do
                shaderparser_strip_comments < "$shaderparser_X" > "$shaderparser_t"
                parsing_shaderfile="$shaderparser_X"
                parse_shaderfile < "$shaderparser_t"