summaryrefslogtreecommitdiff
path: root/src/world.h
blob: ec0328b0b09e7531830529d3ea5f1a0eda8f2cdd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#pragma once
#include "chunk.h"
#include <stdint.h>
#define WORLD_LENGTH 6
#define WORLD_WIDTH 6

struct world {
    struct chunk* chunks[WORLD_WIDTH][WORLD_LENGTH];
    int32_t seed;
};

int world_init(int32_t seed, struct world** world);
int world_save(int32_t seed);
int world_get_chunk(struct world* world, int coord[2], struct chunk** chunk);
void world_get_chunk_real_coord(struct world* world, vec2 coord, int out[2]);