summaryrefslogtreecommitdiff
path: root/textures.c
blob: 52a745bc51ee908a001d92029a7d947b5295eeb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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]);
    }
}