filter out lightmaps and model previews from DDS
[xonotic/xonotic.git] / misc / tools / cached-converter.sh
index 1e6c0eb9bd395ae8e4c597aa06135fecfba947dc..ccbe0bb862a507b41b0b85d1cf905b0e5408d636 100755 (executable)
@@ -129,8 +129,8 @@ reduce_rgba_jpeg2()
        i=$1; shift; shift
        o=$1; shift
        oa=$1; shift
-       convert "$i" -alpha extract -quality 100 "$o" && \
-       convert "$i" -alpha off     -quality 100 "$oa" && \
+       convert "$i" -alpha off     -quality 100 "$o" && \
+       convert "$i" -alpha extract -quality 100 "$oa" && \
        jpegoptim --strip-all -m"$1" "$o" && \
        jpegoptim --strip-all -m"$2" "$oa"
 }
@@ -175,9 +175,9 @@ for F in "$@"; do
        will_jpeg=$do_jpeg
        will_dds=$do_dds
        case "$f" in
+               ./models/player/*) will_dds=false ;;
                ./textures/*) ;;
                ./models/*) ;;
-               ./maps/*/*) ;;
                ./particles/*) ;;
                ./progs/*) ;;
                *)
@@ -245,7 +245,7 @@ for F in "$@"; do
        if [ -f "dds/${f}.dds" ]; then
                if [ -z "${f##./textures/*}" ]; then
                        if [ -n "${f##./textures/*/*}" ]; then
-                               ln -snf "textures/${f%./textures/}.dds" "dds/${f%./textures/}.dds"
+                               ln -snf "textures/${f#./textures/}.dds" "dds/${f#./textures/}.dds"
                        fi
                fi
        fi