From 9037d157d53e986bc7d84a69b7ac5c8f6fdbe4d0 Mon Sep 17 00:00:00 2001 From: Luke Benstead Date: Wed, 17 May 2023 20:38:21 +0100 Subject: [PATCH] Clean up --- GL/texture.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/GL/texture.c b/GL/texture.c index 68f40ae..8b92d96 100644 --- a/GL/texture.c +++ b/GL/texture.c @@ -1929,8 +1929,9 @@ GLAPI GLvoid APIENTRY glDefragmentTextureMemory_KOS(void) { /* Replace all texture pointers */ for(id = 0; id < MAX_TEXTURE_COUNT; id++){ - if(glIsTexture(id)){ - TextureObject* txr = (TextureObject*) named_array_get(&TEXTURE_OBJECTS, id); + TextureObject* txr = (TextureObject*) named_array_get(&TEXTURE_OBJECTS, id); + if(txr){ + gl_assert(txr->index == id); txr->data = yalloc_defrag_address(YALLOC_BASE, txr->data); } }