]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - misc/tools/compress-texture
fix more bugs
[xonotic/xonotic.git] / misc / tools / compress-texture
index 1c488b09503ec7603a2fd7bb6fecdda6ee156608..5ee658c659322432dde564a7dab44e7f4bb3aaa0 100755 (executable)
@@ -10,6 +10,8 @@ format=$1; shift
 src=$1; shift
 dst=$1; shift
 
+ext=${src##*.}
+
 c=
 f=
 
@@ -63,7 +65,6 @@ case "$tool" in
                esac
                dir=`mktemp -d "$HOME/.wine/drive_c/compressonator.XXXXXX"`
                dir_dos="C:/${dir##*/}"
-               ext=${src##*.}
                cp "$src" "$dir/src.$ext"
 
                # compressonator and wine suck, so we sometimes have to retry :(
@@ -84,6 +85,14 @@ case "$tool" in
                esac
                nvcompress $f "$@" "$src" "$dst"
                ;;
+       s2tc)
+               case "$format" in
+                       dxt1) f="-t DXT1" ;;
+                       dxt3) f="-t DXT3" ;;
+                       dxt5) f="-t DXT5" ;;
+               esac
+               s2tc_compress $f "$@" -i "$src" -o "$dst"
+               ;;
 esac
 
 if [ -n "$fourcchack" ]; then