summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@l3000.localdomain>2010-12-05 08:16:28 -0500
committerSøren Sandmann Pedersen <ssp@l3000.localdomain>2010-12-20 10:48:50 -0500
commitc38be0bf970e34a05300d9b72d64e03e3e266d69 (patch)
treeef759a2dc4ce9ad73e9a30c1a28994206f4d5cbb
parent755178b6326b7458268c3329c120473950cd4d08 (diff)
Move xi outside loop
-rw-r--r--dda.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/dda.c b/dda.c
index 91357ee..15c7b1c 100644
--- a/dda.c
+++ b/dda.c
@@ -59,11 +59,10 @@ dda (test_data_t *testdata)
double dxdy = (x1 - x0) / (y1 - y0);
double y = next_sample_y (y0);
double x = (y - y0) * dxdy + x0;
+ double xi = next_sample_x (x);
while (y < next_sample_y (y1))
{
- double xi = next_sample_x (x);
-
if (testdata->points[i++] != xi ||
testdata->points[i++] != y)
{
@@ -72,7 +71,7 @@ dda (test_data_t *testdata)
}
x += sample_step_y (y) * dxdy;
-
+ xi = next_sample_x (x);
y += sample_step_y (y);
}
}