diff --git a/plot.c b/plot.c index 498aa88..9fa1c07 100644 --- a/plot.c +++ b/plot.c @@ -787,48 +787,29 @@ invalidateRect(int x0, int y0, int x1, int y1){ mark_map(x, y); } +#define SWAP(x,y) {int t=x;x=y;y=t;} + static void mark_cells_from_index(void) { - int t; + int t, i; /* mark cells between each neighber points */ for (t = 0; t < TRACES_MAX; t++) { if (!trace[t].enabled) continue; - int x0 = CELL_X(trace_index[t][0]); - int y0 = CELL_Y(trace_index[t][0]); - int m0 = x0 / CELLWIDTH; - int n0 = y0 / CELLHEIGHT; - int i; - mark_map(m0, n0); + int m0 = CELL_X(trace_index[t][0]) / CELLWIDTH; + int n0 = CELL_Y(trace_index[t][0]) / CELLHEIGHT; + markmap[current_mappage][n0] |= 1<x1) SWAP(x0, x1); m0=m1; + int y0 = n0; int y1 = n1; if (y0>y1) SWAP(y0, y1); n0=n1; + for (; y0<=y1; y0++) + for(int j=x0;j<=x1;j++) + markmap[current_mappage][y0]|= 1<