textures.c: remove by one offsetiing, use macro for validity checking

This commit is contained in:
2024-07-19 23:38:10 +03:00
parent 765e6bb8a0
commit 867dea1958
2 changed files with 14 additions and 16 deletions

View File

@@ -11,10 +11,7 @@
typedef struct { int id; } t_texture_key;
/* tests whether given key structure corresponds to any texture */
#define m_texture_key_is_valid(p_key) ((p_key).id != 0)
/* tests whether given key corresponds to atlas texture or a loner */
#define m_texture_is_atlas(p_key) ((p_key).id > 0)
#define m_texture_key_is_valid(p_key) ((p_key).id != -1)
void textures_cache_init(struct texture_cache *cache, SDL_Window *window);
void textures_cache_deinit(struct texture_cache *cache);