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

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, vec2 coord, struct chunk** chunk);