From 2b2b69ee31f00aa46ab6baa967e12437ce7334d1 Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 4 Jul 2025 07:00:08 -0600 Subject: Heightmap, player, and more concepts --- src/assets.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/assets.c (limited to 'src/assets.c') diff --git a/src/assets.c b/src/assets.c new file mode 100644 index 0000000..79c7ef9 --- /dev/null +++ b/src/assets.c @@ -0,0 +1,41 @@ +#include "assets.h" + +const char imageAssetPaths[IMAGE_ASSET_COUNT][FT_NAMEMAX] = { + "heightmap.png" +}; + +const char textureAssetPaths[TEXTURE_ASSET_COUNT][FT_NAMEMAX] = { + "heightmap.png" +}; + +void initAssets(Assets* assets) +{ + // Images. + for (int index = 0; index < IMAGE_ASSET_COUNT; ++index) + { + assets->images[index] = LoadImage( + TextFormat("assets/%s", imageAssetPaths[index])); + } + + // Textures. + for (int index = 0; index < TEXTURE_ASSET_COUNT; ++index) + { + assets->textures[index] = LoadTexture( + TextFormat("assets/%s", textureAssetPaths[index])); + } +} + +void closeAssets(Assets* assets) +{ + // Images. + for (int index = 0; index < IMAGE_ASSET_COUNT; ++index) + { + UnloadImage(assets->images[index]); + } + + // Textures. + for (int index = 0; index < TEXTURE_ASSET_COUNT; ++index) + { + UnloadTexture(assets->textures[index]); + } +} -- cgit v1.2.3