]> git.xonotic.org Git - xonotic/xonotic.git/commitdiff
Merge branch 'master' of git://de.git.xonotic.org/xonotic/xonotic
authorRudolf Polzer <divVerent@xonotic.org>
Sun, 31 Jul 2011 19:26:01 +0000 (21:26 +0200)
committerRudolf Polzer <divVerent@xonotic.org>
Sun, 31 Jul 2011 19:26:01 +0000 (21:26 +0200)
all
misc/tools/bsptool.pl
misc/tools/compress-texture

diff --git a/all b/all
index ad3d1507c22624761c1cef9d4cc353e3c9e1241e..388a6e39b82ddfe0954162373f5091dcedb42c92 100755 (executable)
--- a/all
+++ b/all
@@ -380,6 +380,10 @@ fix_upstream_rebase_mergefail()
 
 fix_git_config()
 {
+       if ! [ -f ".git/config" ]; then
+               $ECHO "Not a git repository. Bailing out to not cause damage."
+               exit 1
+       fi
        verbose git config remote.origin.url "$1"
        if [ -n "$2" ]; then
                verbose git config remote.origin.pushurl "$2"
@@ -516,7 +520,7 @@ case "$cmd" in
                        url=`repourl "$d"`
                        pushurl=`repopushurl "$d"`
                        branch=`repobranch "$d"`
-                       if [ -d "$d0/$d" ]; then
+                       if [ -f "$d0/$d/.git/config" ]; then
                                verbose cd "$d0/$d"
                                fix_git_config "$url" "$pushurl"
                                cd "$d0"
@@ -694,7 +698,7 @@ case "$cmd" in
                        url=`repourl "$d"`
                        pushurl=`repopushurl "$d"`
                        branch=`repobranch "$d"`
-                       if [ -d "$d0/$d" ]; then
+                       if [ -f "$d0/$d/.git/config" ]; then
                                # if we have .no file, skip
                                if [ -f "$d0/$d.no" ]; then
                                        msg "Repository $d disabled by a .no file, delete $d.no to enable; thus, not updated"
@@ -722,6 +726,14 @@ case "$cmd" in
                                        cd "$d0"
                                fi
                        else
+                               if [ -d "$d0/$d" ]; then
+                                       if yesno "$d0/$d is in the way, get rid of it and reclone?"; then
+                                               verbose rm -rf "$d0/$d"
+                                       else
+                                               echo "Note: $d0/$d will stay broken."
+                                               continue
+                                       fi
+                               fi
                                verbose git clone "$url" "$d0/$d"
                                enter "$d0/$d" verbose
                                fix_git_config "$url" "$pushurl"
index 84f23233aa388f3f91c86422623f394f6db5dc57..efc6cccb2efa3a2770e7c99a4cc81cfd3d97cb81 100755 (executable)
@@ -218,12 +218,14 @@ for(@ARGV)
 {
        if(/^-i$/) # info
        {
-               my $total = 17 * 8 + 8 + length($msg);
+               my $msgalign = [0, 3, 2, 1]->[length($msg) % 4];
+               my $total = 17 * 8 + 8 + length($msg) + $msgalign;
                my $max = 0;
                for(0..@bsp-1)
                {
                        my $nl = length $bsp[$_]->[2];
-                       $total += $nl;
+                       my $align = [0, 3, 2, 1]->[$nl % 4];
+                       $total += $nl + $align;
                        print "BSP lump $_ ($lumpname[$_]): offset $bsp[$_]->[0] length $bsp[$_]->[1] newlength $nl\n";
                        my $endpos = $bsp[$_]->[0] + $bsp[$_]->[1];
                        $max = $endpos if $max < $endpos;
@@ -487,18 +489,23 @@ for(@ARGV)
                open my $fh, ">", $outfile
                        or die "$outfile: $!";
                print $fh $header;
-               my $pos = 17 * 8 + tell($fh) + length $msg;
+               my $msgalign = [0, 3, 2, 1]->[length($msg) % 4];
+               my $pos = 17 * 8 + tell($fh) + length($msg) + $msgalign;
                for(@bsp)
                {
+                       my $align = [0, 3, 2, 1]->[length($_->[2]) % 4];
                        $_->[0] = $pos;
                        $_->[1] = length $_->[2];
-                       $pos += $_->[1];
+                       $pos += $_->[1] + $align;
                        print $fh pack "VV", $_->[0], $_->[1];
                }
                print $fh $msg;
+               print $fh "\x00" x $msgalign;
                for(@bsp)
                {
+                       my $align = [0, 3, 2, 1]->[length($_->[2]) % 4];
                        print $fh $_->[2];
+                       print $fh "\x00" x $align;
                }
                close $fh;
                print STDERR "Wrote $outfile\n";
index 5141b92d04a0da6ec0f1aff748190114e48a12ad..5ee658c659322432dde564a7dab44e7f4bb3aaa0 100755 (executable)
@@ -91,7 +91,7 @@ case "$tool" in
                        dxt3) f="-t DXT3" ;;
                        dxt5) f="-t DXT5" ;;
                esac
-               s2tc $f "$@" -i "$src" -o "$dst"
+               s2tc_compress $f "$@" -i "$src" -o "$dst"
                ;;
 esac