summaryrefslogtreecommitdiff
path: root/dda.c
diff options
context:
space:
mode:
Diffstat (limited to 'dda.c')
-rw-r--r--dda.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/dda.c b/dda.c
index 52ceb20..3df28c5 100644
--- a/dda.c
+++ b/dda.c
@@ -404,14 +404,17 @@ make_get (polygon_t *polygon, int x, int y, int width, int height,
}
static edge_t **
-update_aet (edge_t **aet, sample_t y, edge_t **global, int *n_edges)
+update_aet (edge_t **aet, int *n_active,
+ sample_t y, edge_t **global, int *n_edges)
{
int i;
+ int new_size;
int n_new;
for (i = 0; i < *n_edges; ++i)
{
- /* add stuff from global [i] if it has become active */
+ edge_t *e = global[i];
+
}
*n_edges -= n_new;
@@ -434,28 +437,25 @@ polygon_rasterize (polygon_t *polygon, int x, int y, int width, int height)
fixed_t min;
sample_t yi;
edge_t **aet;
+ int n_active;
next_edge = get = make_get (polygon, x, y, width, height, &n_edges, &min);
yi = next_sample_y (min);
- aet = update_aet (NULL, yi, &next_edge, &n_edges);
+ n_active = 0;
+ aet = update_aet (NULL, &n_active, yi, &next_edge, &n_edges);
while (fixed_to_int (yi) < y + height)
{
- edge_t **active;
-
- active = aet;
- while (*active)
- {
- edge_step (*active, yi, poly_emit, NULL);
+ int i;
- active++;
- }
+ for (i = 0; i < n_active; ++i)
+ edge_step (aet[i], yi, poly_emit, NULL);
yi = step_y (yi);
- aet = update_aet (aet, yi, &next_edge, &n_edges);
+ aet = update_aet (aet, &n_active, yi, &next_edge, &n_edges);
}
/* First step all the edges to the top of the bounding box */