summaryrefslogtreecommitdiff
path: root/src/world.h
diff options
context:
space:
mode:
authorAaditya Dhruv <[email protected]>2026-01-27 22:35:54 -0600
committerAaditya Dhruv <[email protected]>2026-01-27 22:35:54 -0600
commit17cd7420e9d2432d56f9c69c6e4a8ab665ef4b9b (patch)
tree7bcfc1d05b9b058240799d714ea0674f5eed58f3 /src/world.h
parent186889aaa18426d31c268735a4d34b494234f421 (diff)
Add World and multi-chunk rendering
- More than 1 chunk can now be rendered with the help of the world struct - Block coords are now in world space, not local space - Engine init code cleaned up for cleaner world/chunk handling
Diffstat (limited to 'src/world.h')
-rw-r--r--src/world.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/world.h b/src/world.h
index 5be1cf2..c65a1d0 100644
--- a/src/world.h
+++ b/src/world.h
@@ -3,11 +3,12 @@
#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);
+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);
+int world_get_chunk(struct world* world, vec2 coord, struct chunk** chunk);