]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - misc/tools/cached-converter.sh
Merge branch 'master' into divVerent/crypto2
[xonotic/xonotic.git] / misc / tools / cached-converter.sh
index 5b1d0bf07bfd0dd10537eeeed1e2f02bb6e1ee96..e11b4576fa74441ef46f9d49668c5dadb3ee8a1a 100755 (executable)
@@ -12,6 +12,7 @@ set -e
 : ${do_ogg:=false}
 : ${ogg_qual:=1}
 : ${del_src:=false}
+: ${git_src_repo:=}
 
 me=$0
 case "$me" in
@@ -40,6 +41,7 @@ cached()
        if ! $flag; then
                return 0
        fi
+       #sleep 0.25
        if [ x"$infile1" = x"$outfile1" ]; then
                keep=true
        fi
@@ -47,9 +49,16 @@ cached()
        if [ x"$infile1/../$infile2" = x"$lastinfiles" ]; then
                sum=$lastinfileshash
        else
-               sum=`git hash-object "$infile1"`
-               if [ -n "$infile2" ]; then
-                       sum=$sum`git hash-object "$infile2"`
+               if [ -n "$git_src_repo" ]; then
+                       sum=`( cd "$git_src_repo"; git rev-parse --revs-only HEAD:"${infile1#./}" | grep . ) || git hash-object "$infile1"`
+                       if [ -n "$infile2" ]; then
+                               sum=$sum`( cd "$git_src_repo"; git rev-parse --revs-only HEAD:"${infile2#./}" | grep . ) || git hash-object "$infile2"`
+                       fi
+               else
+                       sum=`git hash-object "$infile1"`
+                       if [ -n "$infile2" ]; then
+                               sum=$sum`git hash-object "$infile2"`
+                       fi
                fi
                lastinfileshash=$sum
        fi
@@ -105,8 +114,10 @@ reduce_ogg_ogg()
 {
        i=$1; shift; shift
        o=$1; shift; shift
+       tags=`vorbiscomment -R -l "$i" || true`
        oggdec -o "$tmpdir/x.wav" "$i" && \
        oggenc -q"$1" -o "$o" "$tmpdir/x.wav"
+       echo "$tags" | vorbiscomment -R -w "$o" || true
 }
 
 reduce_wav_ogg()
@@ -175,9 +186,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/*) ;;
                *)