From: mfranz Date: Sun, 30 Oct 2005 19:59:53 +0000 (+0000) Subject: fix min/max coordinates; spelling; cosmetics X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=837cf56c1fb80e0f81a505acaf985a872133fa3a;p=flightgear.git fix min/max coordinates; spelling; cosmetics --- diff --git a/utils/Modeller/ac3d-despeckle b/utils/Modeller/ac3d-despeckle index 296326b82..d9ff26566 100755 --- a/utils/Modeller/ac3d-despeckle +++ b/utils/Modeller/ac3d-despeckle @@ -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;