| 1020 | */ |
| 1021 | |
| 1022 | void VeinGenerator::write_tiles() |
| 1023 | { |
| 1024 | for (int x = 0; x < size.x; x++) |
| 1025 | { |
| 1026 | for (int y = 0; y < size.y; y++) |
| 1027 | { |
| 1028 | df::coord2d column(x,y); |
| 1029 | |
| 1030 | int top = findTopBlock(map, x, y); |
| 1031 | |
| 1032 | for (int z = top; z >= 0; z--) |
| 1033 | { |
| 1034 | Block *b = map.BlockAt(df::coord(x,y,z)); |
| 1035 | if (!b || !b->is_valid()) |
| 1036 | continue; |
| 1037 | |
| 1038 | write_block_tiles(b, column, z); |
| 1039 | |
| 1040 | b->Write(); |
| 1041 | map.discardBlock(b); |
| 1042 | } |
| 1043 | |
| 1044 | map.trash(); |
| 1045 | } |
| 1046 | } |
| 1047 | } |
| 1048 | |
| 1049 | void VeinGenerator::write_block_tiles(Block *b, df::coord2d column, int z) |
| 1050 | { |
no test coverage detected