cache sprite srcrects

This commit is contained in:
2024-10-15 18:43:02 +03:00
parent 768daf1f54
commit f2bbc1863e
2 changed files with 11 additions and 3 deletions

View File

@ -50,6 +50,7 @@ typedef struct TextureCache {
typedef struct TextureKey { uint16_t id; } TextureKey;
/* tests whether given key structure corresponds to any texture */
#define TEXTURE_KEY_INVALID (TextureKey) { (uint16_t)-1 }
#define m_texture_key_is_valid(p_key) ((p_key).id != (uint16_t)-1)
void textures_cache_init(struct TextureCache *cache, SDL_Window *window);