diff options
author | nathan <nathansmith@disroot.org> | 2025-07-04 13:00:08 +0000 |
---|---|---|
committer | nathan <nathansmith@disroot.org> | 2025-07-04 13:00:08 +0000 |
commit | 2b2b69ee31f00aa46ab6baa967e12437ce7334d1 (patch) | |
tree | 1ba7fd19c30bb33ef20f55afc84ccfff30460969 /src/assets.c | |
parent | de3a92fb2bde8cbec688f788c53f7ba52d6a723a (diff) | |
download | FindThings-2b2b69ee31f00aa46ab6baa967e12437ce7334d1.tar.gz FindThings-2b2b69ee31f00aa46ab6baa967e12437ce7334d1.tar.bz2 FindThings-2b2b69ee31f00aa46ab6baa967e12437ce7334d1.zip |
Heightmap, player, and more concepts
Diffstat (limited to 'src/assets.c')
-rw-r--r-- | src/assets.c | 41 |
1 files changed, 41 insertions, 0 deletions
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]); + } +} |