diff options
Diffstat (limited to 'dda.c')
-rw-r--r-- | dda.c | 23 |
1 files changed, 10 insertions, 13 deletions
@@ -78,21 +78,8 @@ dda (test_data_t *testdata) printf ("= = = = %f %f %f %f = = = = \n", x0, y0, x1, y1); #endif - goto step; - while (yi < next_sample_y (y1)) { - if (testdata->points[i++] != xi || - testdata->points[i++] != yi) - { - printf ("error %f %f\n", testdata->points[i - 1], xi); - exit (-1); - } - - e -= sample_step_y (yi) * dx; - yi += sample_step_y (yi); - - step: if (dx >= 0) { while (e <= 0) @@ -115,6 +102,16 @@ dda (test_data_t *testdata) s = sample_step_x_backward (xi); } } + + if (testdata->points[i++] != xi || + testdata->points[i++] != yi) + { + printf ("error %f %f\n", testdata->points[i - 1], xi); + exit (-1); + } + + e -= sample_step_y (yi) * dx; + yi += sample_step_y (yi); } } |