| 384 | } |
| 385 | |
| 386 | int regrass_cuboid(color_ostream &out, const regrass_options &options, const cuboid &bounds) |
| 387 | { // Regrass all tiles in the defined cuboid. |
| 388 | DEBUG(log, out).print("Regrassing cuboid ({}:{}, {}:{}, {}:{})\n", |
| 389 | bounds.x_min, bounds.x_max, bounds.y_min, bounds.y_max, bounds.z_min, bounds.z_max); |
| 390 | |
| 391 | int count = 0; |
| 392 | bounds.forBlock([&](df::map_block *block, cuboid intersect) { |
| 393 | DEBUG(log, out).print("Cuboid regrass block at ({}, {}, {})\n", |
| 394 | block->map_pos.x, block->map_pos.y, block->map_pos.z); |
| 395 | intersect.forCoord([&](df::coord pos) { |
| 396 | count += regrass_tile(out, options, block, pos.x&15, pos.y&15); |
| 397 | return true; |
| 398 | }); |
| 399 | return true; |
| 400 | }); |
| 401 | return count; |
| 402 | } |
| 403 | |
| 404 | int regrass_block(color_ostream &out, const regrass_options &options, df::map_block *block) |
| 405 | { // Regrass all tiles in a single block. |
no test coverage detected