From 17cd7420e9d2432d56f9c69c6e4a8ab665ef4b9b Mon Sep 17 00:00:00 2001 From: Aaditya Dhruv Date: Tue, 27 Jan 2026 22:35:54 -0600 Subject: 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 --- src/world.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/world.h') 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 #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); -- cgit