]> git.mxchange.org Git - flightgear.git/commitdiff
fix min/max coordinates; spelling; cosmetics
authormfranz <mfranz>
Sun, 30 Oct 2005 19:59:53 +0000 (19:59 +0000)
committermfranz <mfranz>
Sun, 30 Oct 2005 19:59:53 +0000 (19:59 +0000)
utils/Modeller/ac3d-despeckle

index 296326b828b9cd9168354d9a7b05a248dc0089e8..d9ff26566da7e84964e2880437f9d11a8e027f1c 100755 (executable)
@@ -3,7 +3,7 @@
 # Melchior FRANZ  < mfranz # aon : at >  Public Domain
 #
 # Older nVidia cards like the GF4 MX440 don't like UV faces
-# where all cooridnates are equal, and thus don't have an area.
+# where all coordinates are equal, and thus don't have an area.
 # This leads to grey spots that are constantly going on and off.
 # The script fixes UV faces with 3 and 4 references by assigning
 # a one (half)pixel sized area, and moves coordinates into the
@@ -143,7 +143,7 @@ while (<>) {
                @ref3 = split /\s+/, <> if $n == 4;
 
                goto writeuv if $ref0[1] != $ref1[1] or $ref0[2] != $ref1[2] or $ref1[1] != $ref2[1] or $ref1[2] != $ref2[2];
-               goto writeuv if $1 == 4 and ($ref2[1] != $ref3[1] or $ref2[2] != $ref3[2]);
+               goto writeuv if $n == 4 and ($ref2[1] != $ref3[1] or $ref2[2] != $ref3[2]);
 
 
                if (defined $TEXTURE) {
@@ -151,10 +151,10 @@ while (<>) {
 
                        my ($x, $y) = @ref0[1, 2];
 
-                       $x = -0.5 if $x < -0.5;
-                       $x = 0.5 - $PIXW if $x > 0.5 - $PIXW;
-                       $y = -0.5 if $y < -0.5;
-                       $y = 0.5 - $PIXH if $y > 0.5 - $PIXH;
+                       $x = 0.0 if $x < 0.0;
+                       $x = 1.0 - $PIXW if $x > 1.0 - $PIXW;
+                       $y = 0.0 if $y < 0.0;
+                       $y = 1.0 - $PIXH if $y > 1.0 - $PIXH;
 
                        $x -= $x - POSIX::floor($x / $PIXW) * $PIXW;
                        $y -= $y - POSIX::floor($y / $PIXH) * $PIXH;