From 1b6ecc22e77b7aa1fee16420b041c1dea1925052 Mon Sep 17 00:00:00 2001 From: riton Date: Sat, 29 Mar 2025 21:37:46 +0300 Subject: init repo --- textures.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 textures.c (limited to 'textures.c') diff --git a/textures.c b/textures.c new file mode 100644 index 0000000..52a745b --- /dev/null +++ b/textures.c @@ -0,0 +1,23 @@ +#include "textures.h" + +Texture2D textures[T_COUNT]; + +Texture2D load_texture(const char *path){ + char buf[128]; + snprintf(buf, 128, ASSET_ROOT "%s", path); + return LoadTexture(buf); +} + +void load_textures(){ + textures[T_PLAYER] = load_texture("8-dir.png"); + textures[T_GRASS] = load_texture("grass_tiles.png"); + textures[T_DIRT] = load_texture("dirt-path.png"); + textures[T_TOWER] = load_texture("tower.png"); + textures[T_SKELETON_MOVE] = load_texture("skeleton1/movement.png"); +} + +void unload_textures(){ + for (size_t i = 0; i < T_COUNT; i++){ + UnloadTexture(textures[i]); + } +} -- cgit v1.2.3