X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=blobdiff_plain;f=misc%2Ftools%2Fcached-converter.sh;h=361265881865430d5b4ccaa09924d7bca6709003;hp=1e6c0eb9bd395ae8e4c597aa06135fecfba947dc;hb=12fe42d7f5037b53c863189c0ff45ab19042a339;hpb=68334b70fb0380249ca1aaade8b0be903d55fb11 diff --git a/misc/tools/cached-converter.sh b/misc/tools/cached-converter.sh index 1e6c0eb9..36126588 100755 --- a/misc/tools/cached-converter.sh +++ b/misc/tools/cached-converter.sh @@ -105,8 +105,10 @@ reduce_ogg_ogg() { i=$1; shift; shift o=$1; shift; shift + tags=`vorbiscomment -R -l "$i"` oggdec -o "$tmpdir/x.wav" "$i" && \ oggenc -q"$1" -o "$o" "$tmpdir/x.wav" + echo "$tags" | vorbiscomment -R -w "$o" } reduce_wav_ogg() @@ -129,8 +131,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 +177,11 @@ for F in "$@"; do will_jpeg=$do_jpeg will_dds=$do_dds case "$f" in + *_bump) will_dds=false ;; + ./models/player/*) will_dds=false ;; + ./models/sprites/*) will_dds=false ;; ./textures/*) ;; ./models/*) ;; - ./maps/*/*) ;; ./particles/*) ;; ./progs/*) ;; *) @@ -245,7 +249,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