From f74cf52946f4e569a26bc81105537b40be95c2c7 Mon Sep 17 00:00:00 2001 From: omnisci3nce Date: Fri, 12 Jul 2024 12:47:07 +1000 Subject: wip: big makeover --- src/systems/terrain.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/systems/terrain.h') diff --git a/src/systems/terrain.h b/src/systems/terrain.h index a65ecec..890cb90 100644 --- a/src/systems/terrain.h +++ b/src/systems/terrain.h @@ -19,7 +19,7 @@ Future: #include "str.h" typedef struct Heightmap { - str8 filepath; + Str8 filepath; u32x2 size; void* image_data; bool is_uploaded; @@ -32,9 +32,13 @@ PUB bool Terrain_Init(Terrain_Storage* storage); PUB void Terrain_Shutdown(Terrain_Storage* storage); PUB void Terrain_Run(Terrain_Storage* storage); // NOTE: For now it renders directly to main framebuffer -PUB Heightmap Heightmap_FromImage(str8 filepath); +/** @brief Sets the active heightmap to be rendered and collided against. */ +PUB Heightmap Terrain_LoadHeightmap(Heightmap hmap, bool free_on_upload); +PUB Heightmap Heightmap_FromImage(Str8 filepath); PUB Heightmap Heightmap_FromPerlin(/* TODO: perlin noise generation parameters */); +PUB bool Terrain_IsActive(); // checks whether we have a loaded heightmap and it's being rendered + // --- Internal // TODO: void terrain_system_render_hmap(renderer* rend, terrain_state* state); -- cgit v1.2.3-70-g09d2