… | |
… | |
533 | |
533 | |
534 | // same as ordered_mapwalk, but the walk will not follow any particular |
534 | // same as ordered_mapwalk, but the walk will not follow any particular |
535 | // order (unorded), but is likely faster. |
535 | // order (unorded), but is likely faster. |
536 | // m will be set to the map (never 0!), nx, ny to the map coord, dx, dy to the offset relative to op |
536 | // m will be set to the map (never 0!), nx, ny to the map coord, dx, dy to the offset relative to op |
537 | // "continue" will skip to the next space |
537 | // "continue" will skip to the next space |
538 | #define unordered_mapwalk(op,dx0,dy0,dx1,dy1) \ |
538 | #define unordered_mapwalk_at(map,ox,oy,dx0,dy0,dx1,dy1) \ |
539 | for (maprect *r_e_c_t = (op)->map->split_to_tiles ( \ |
539 | for (maprect *r_e_c_t = (map)->split_to_tiles ( \ |
540 | (op)->x + (dx0) , (op)->y + (dy0) , \ |
540 | (ox) + (dx0) , (oy) + (dy0) , \ |
541 | (op)->x + (dx1) + 1, (op)->y + (dy1) + 1); \ |
541 | (ox) + (dx1) + 1, (oy) + (dy1) + 1); \ |
542 | r_e_c_t->m; \ |
542 | r_e_c_t->m; \ |
543 | ++r_e_c_t) \ |
543 | ++r_e_c_t) \ |
544 | rect_mapwalk (r_e_c_t, (op)->x, (op)->y) |
544 | rect_mapwalk (r_e_c_t, (ox), (oy)) |
|
|
545 | |
|
|
546 | #define unordered_mapwalk(op,dx0,dy0,dx1,dy1) \ |
|
|
547 | unordered_mapwalk_at (op->map, op->x, op->y, dx0, dy0, dx1, dy1) |
545 | |
548 | |
546 | #endif |
549 | #endif |
547 | |
550 | |