eco2d/code/apps/server/source/utils/options.c

24 lines
620 B
C
Raw Normal View History

2021-01-11 21:23:43 +00:00
#include <stdio.h>
2021-01-11 13:47:14 +00:00
#include "world/world.h"
#include "world/blocks.h"
#include "utils/options.h"
void generate_minimap(int32_t seed, uint16_t block_size, uint16_t chunk_size, uint16_t world_size) {
2021-05-04 17:39:50 +00:00
world_init(seed, block_size, 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;
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++) {
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
}