diff --git a/src/twn_textures.c b/src/twn_textures.c index ffd9fdc..5688a49 100644 --- a/src/twn_textures.c +++ b/src/twn_textures.c @@ -231,7 +231,7 @@ static bool update_rects(struct texture_cache *cache, stbrp_rect *rects, stbrp_r /* updates the atlas location of every rect in the cache */ static void update_texture_rects_in_atlas(struct texture_cache *cache, stbrp_rect *rects) { int r = 0; - for (size_t i = 0; i < arrlenu(rects); ++i) { + for (size_t i = 0; i < shlenu(cache->hash); ++i) { if (cache->hash[i].value.loner_texture != 0) continue;