MCPcopy Create free account
hub / github.com/DFHack/dfhack / write_tiles

Method write_tiles

plugins/3dveins.cpp:1022–1047  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1020 */
1021
1022void 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
1049void VeinGenerator::write_block_tiles(Block *b, df::coord2d column, int z)
1050{

Callers 1

cmd_3dveinsFunction · 0.80

Calls 4

findTopBlockFunction · 0.85
BlockAtMethod · 0.80
discardBlockMethod · 0.80
WriteMethod · 0.45

Tested by

no test coverage detected