2021-01-11 21:23:43 +00:00
|
|
|
#include <stdio.h>
|
2021-01-11 13:47:14 +00:00
|
|
|
|
2021-01-17 07:03:06 +00:00
|
|
|
#include "world/world.h"
|
|
|
|
#include "world/blocks.h"
|
|
|
|
#include "utils/options.h"
|
|
|
|
|
2021-01-17 14:23:23 +00:00
|
|
|
void generate_minimap(int32_t seed, uint16_t block_size, uint16_t chunk_size, uint16_t world_size) {
|
2021-05-04 20:32:12 +00:00
|
|
|
world_init(seed, 3, chunk_size, world_size, NULL, NULL);
|
2021-01-17 11:05:29 +00:00
|
|
|
|
2021-01-11 20:25:09 +00:00
|
|
|
uint8_t const *world;
|
2021-01-17 14:23:23 +00:00
|
|
|
uint32_t world_length = chunk_size * world_size;
|
2021-01-11 16:20:12 +00:00
|
|
|
uint32_t len = world_buf(&world, NULL);
|
2021-01-17 11:05:29 +00:00
|
|
|
|
2021-01-11 16:20:12 +00:00
|
|
|
for (int i=0; i<len; i++) {
|
2021-01-17 14:23:23 +00:00
|
|
|
if (i > 0 && i % world_length == 0) {
|
2021-01-11 21:23:43 +00:00
|
|
|
putc('\n', stdout);
|
2021-01-11 13:47:14 +00:00
|
|
|
}
|
2021-01-11 21:23:43 +00:00
|
|
|
putc(blocks_get_symbol(world[i]), stdout);
|
2021-01-11 13:47:14 +00:00
|
|
|
}
|
2021-01-17 11:05:29 +00:00
|
|
|
|
2021-01-11 21:23:43 +00:00
|
|
|
putc('\n', stdout);
|
2021-01-11 16:20:12 +00:00
|
|
|
world_destroy();
|
2021-01-11 13:47:14 +00:00
|
|
|
}
|