summaryrefslogtreecommitdiff
path: root/textures.c
diff options
context:
space:
mode:
Diffstat (limited to 'textures.c')
-rw-r--r--textures.c23
1 files changed, 23 insertions, 0 deletions
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]);
+ }
+}