Merge branch 'master' of ssh://git.xonotic.org/xonotic
authorRudolf Polzer <divverent@alientrap.org>
Mon, 28 Jun 2010 12:27:41 +0000 (14:27 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Mon, 28 Jun 2010 12:27:41 +0000 (14:27 +0200)
all
misc/tools/cached-converter.sh
misc/tools/compress-texture [new file with mode: 0755]

diff --git a/all b/all
index e1b87444aee25aa2fcacab30de7877c1ce529c62..8f5ffa5c573b08e0b2207d03ad28ae0df17e62b9 100755 (executable)
--- a/all
+++ b/all
@@ -617,29 +617,7 @@ case "$cmd" in
                rm -rf "$patchdir"
                ;;
        admin-merge)
-               if [ "$#" = 1 ]; then
-                       set -- "${1%%/*}" "${1#*/}"
-               fi
-               for d in $repos; do
-                       enter "$d0/$d" verbose
-                       git rev-parse "$1/$2" || continue
-                       # 1. review
-                       {
-                               git log HEAD.."$1/$2"
-                               git diff HEAD..."$1/$2"
-                       } | less
-                       if yesno "Merge \"$1/$2\" into `git symbolic-ref HEAD` of $d?"; then
-                               git merge "$1/$2"
-                               if "$SELF" compile && yesno "Still merge \"$1/$2\" into `git symbolic-ref HEAD` of $d? Maybe you want to test first."; then
-                                       git push origin HEAD
-                                       git push "$1" :"$2"
-                               else
-                                       git reset --hard HEAD@{1}
-                               fi
-                       fi
-               done
-               ;;
-       admin-merge-2)
+               branch=$1
                t=`mktemp`
                report=""
                reportecho()
@@ -675,6 +653,11 @@ case "$cmd" in
                                                continue
                                                ;;
                                esac
+                               if [ -n "$branch" ]; then
+                                       if [ x"$branch" != x"${ref#refs/remotes/origin/}" ]; then
+                                               continue
+                                       fi
+                               fi
                                reportecho "  Branch $ref:"
                                note=`GIT_NOTES_REF=refs/notes/admin-merge git notes show "$ref" 2>/dev/null || true`
                                logdata=`git log --color "$base".."$ref"`
index fda5cac0f8e4cb4d08720e97ec15c2a41e62c5bd..4d52563ec279e3290e88b3b216a11b9368056946 100755 (executable)
@@ -7,10 +7,20 @@ set -e
 : ${jpeg_qual_rgb:=95}
 : ${jpeg_qual_a:=99}
 : ${do_dds:=true}
-: ${dds_flags:=}
+: ${dds_tool:=compressonator-dxtc}
 : ${do_ogg:=false}
 : ${ogg_qual:=1}
 
+me=$0
+case "$me" in
+       */*)
+               meprefix=${me%/*}/
+               ;;
+       *)
+               meprefix=
+               ;;
+esac
+
 tmpdir=`mktemp -d -t cached-converter.XXXXXX`
 trap 'exit 1' INT
 trap 'rm -rf "$tmpdir"' EXIT
@@ -47,7 +57,7 @@ cached()
        else
                rm -f "$tempfile1"
                rm -f "$tempfile2"
-       exit 1
+               exit 1
        fi
 }
 
@@ -57,7 +67,7 @@ reduce_jpeg2_dds()
        ia=$1; shift
        o=$1; shift; shift 
        convert "$i" "$ia" -compose CopyOpacity -composite "$tmpdir/x.png" && \
-       nvcompress -alpha -bc3 $1 "$tmpdir/x.png" "$o"
+       "$meprefix"compress-texture "$dds_tool" dxt5 "$tmpdir/x.png" "$o" $1
 }
 
 reduce_jpeg2_jpeg2()
@@ -89,7 +99,7 @@ reduce_rgba_dds()
 {
        i=$1; shift; shift
        o=$1; shift; shift
-       nvcompress -alpha -bc3 $1 "$i" "$o"
+       "$meprefix"compress-texture "$dds_tool" dxt5 "$i" "$o" $1
 }
 
 reduce_rgba_jpeg2()
@@ -107,7 +117,7 @@ reduce_rgb_dds()
 {
        i=$1; shift; shift
        o=$1; shift; shift
-       nvcompress -bc1 $1 "$i" "$o"
+       "$meprefix"compress-texture "$dds_tool" dxt1 "$i" "$o" $1
 }
 
 reduce_rgb_jpeg()
diff --git a/misc/tools/compress-texture b/misc/tools/compress-texture
new file mode 100755 (executable)
index 0000000..0cafa5a
--- /dev/null
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+# usage: compress-texture tool compression in.png out.dds
+# example: compress-texture compressonator dxt1 foo.jpg foo.dds
+
+tool=$1; shift
+format=$1; shift
+src=$1; shift
+dst=$1; shift
+
+c=
+f=
+case "$tool" in
+       compressonator-dxtc|compressonator-atic)
+               case "$tool" in
+                       *-dxtc) c="-codec DXTC.dll" ;;
+                       *-atic) c="-codec ATICompressor.dll" ;;
+               esac
+               case "$format" in
+                       dxt1) f="+fourCC DXT1" ;;
+                       dxt3) f="+fourCC DXT3" ;;
+                       dxt5) f="+fourCC DXT5" ;;
+               esac
+               dir=`mktemp -d "$HOME/.wine/drive_c/compressonator.XXXXXX"`
+               dir_dos="C:/${dir##*/}"
+               ext=${src##*.}
+               cp "$src" "$dir/src.$ext"
+               DISPLAY= wine "$HOME/.wine/drive_c/Program Files/AMD/The Compressonator 1.50/TheCompressonator.exe" -convert -mipmaps "$dir_dos/src.$ext" "$dir_dos/dst.dds" $c $f "$@" -mipper BoxFilter.dll
+               mv "$dir/dst.dds" "$dst"
+               rm -rf "$dir"
+               ;;
+       nvcompress)
+               case "$format" in
+                       dxt1) f="-bc1" ;;
+                       dxt3) f="-alpha -bc3" ;;
+                       dxt5) f="-alpha -bc5" ;;
+               esac
+               nvcompress $f "$@" "$src" "$dst"
+               ;;
+esac