diff options
author | Søren Sandmann Pedersen <ssp@l3000.localdomain> | 2010-12-19 23:48:09 -0500 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@l3000.localdomain> | 2010-12-20 10:48:53 -0500 |
commit | b471364e86578820e0f263bdbd83c1b9d5c5191d (patch) | |
tree | 00a66ae8f9c18a4fea7b7a8445b60ec85cd9eadd /newplan | |
parent | e3d0dd18532061e9c6521ed24094e2944a64587b (diff) |
More poly2
Diffstat (limited to 'newplan')
-rw-r--r-- | newplan | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -41,6 +41,10 @@ Potential optimizations: - Polygons could store the edges as a kind of BSP tree to allow quick access to arbitrary sub-rectangles. +- Rectilinear polygons could be recognized + +- Rectilinear integer-aligned polygons could be recognized. + Write it top-down. rasterize (polygon, int x, int y, int width, int height) @@ -51,7 +55,7 @@ rasterize (polygon, int x, int y, int width, int height) yi = next_sample_y (y); // yi = y << 8; - aet = update_aet (aet, yi); + aet = update_aet (aet, yi, scanline=true); /* For each scanline */ while (fixed_to_int (yi) < height) @@ -61,17 +65,22 @@ rasterize (polygon, int x, int y, int width, int height) case VERTICALS/NON_OVERLAP/etc. */ - for (i = 0; i < N_GRID_Y; ++i) + for (i = 0; i < N_GRID_Y - 1; ++i) { for_each (aet) - step edge (emit); + small step edge (emit); - yi = step_y (yi); + yi = small_step_y (yi); - aet = update_aet (aet); + aet = update_aet (aet, scanline=false); } - // emit scan line + for_each (aet) + big_step edge (emit); + + yi = big_step_y (yi); // yi = fixed_floor (yi + fixed_1); + + aet = update_aet (yi, scanline=true); } } |