Skip to content

Commit f94bc44

Browse files
author
Zach Collins
committed
Added blockmap processing stats
1 parent c4ed180 commit f94bc44

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/blockmap.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,23 @@ void BlockMap::build(Renderer &renderer) {
4646
renderer.draw_map_outline();
4747
};
4848

49+
int block_count = 0;
50+
4951
// Generate the blocks
5052
for (int y = height-1; y >= 0; y--) {
5153
for (int x = 0; x < width; x++) {
5254
draw_grid();
5355

54-
if(gen(x, y, renderer))
55-
renderer.show();
56-
}
56+
if (gen(x, y, renderer)) {
57+
// Draw some stats
58+
renderer.draw_text(
59+
std::string("Building Blockmap...") +
60+
"\nBlocks processed: " + std::to_string(block_count++)
61+
);
62+
63+
renderer.show();
64+
}
65+
}
5766
}
5867
}
5968

0 commit comments

Comments
 (0)