]> git.mxchange.org Git - flightgear.git/blobdiff - utils/Modeller/ac3d-despeckle
Merge branch 'rj/ttw' into next
[flightgear.git] / utils / Modeller / ac3d-despeckle
index d9ff26566da7e84964e2880437f9d11a8e027f1c..abecec42c2452894a84106b4ff3126306016e2c5 100755 (executable)
@@ -10,7 +10,6 @@
 # texture area if necessary.
 #
 use strict;
-use POSIX qw(floor);
 
 my $SELF = $0;
 $SELF =~ s,.*\/,,;
@@ -131,7 +130,7 @@ while (<>) {
                if ($n < 3 or $n > 4) {
                        report("?") if $VERBOSE;
                        unless ($NOOP) {
-                               print scalar(<>) foreach (0 .. $n);
+                               print scalar(<>) foreach (1 .. $n);
                        }
                        next;
                }
@@ -156,8 +155,8 @@ while (<>) {
                        $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;
+                       $x = int($x / $PIXW) * $PIXW;
+                       $y = int($y / $PIXH) * $PIXH;
 
                        $ref0[1] = $x, $ref0[2] = $y;
                        $ref1[1] = $x + $PIXW;