static mempool_t *texturemempool;
+static memexpandablearray_t texturearray;
// note: this must not conflict with TEXF_ flags in r_textures.h
// bitmask for mismatch checking
if (glt->inputtexels)
Mem_Free(glt->inputtexels);
- Mem_Free(glt);
+ Mem_ExpandableArray_FreeRecord(&texturearray, glt);
}
rtexturepool_t *R_AllocTexturePool(void)
qglPixelStorei(GL_PACK_ALIGNMENT, 1);CHECKGLERROR
texturemempool = Mem_AllocPool("texture management", 0, NULL);
+ Mem_ExpandableArray_NewArray(&texturearray, texturemempool, sizeof(gltexture_t), 512);
// Disable JPEG screenshots if the DLL isn't loaded
if (! JPEG_OpenLibrary ())
resizebuffer = NULL;
colorconvertbuffer = NULL;
texturebuffer = NULL;
+ Mem_ExpandableArray_FreeArray(&texturearray);
Mem_FreePool(&texturemempool);
}
else
Con_Printf ("R_LoadTexture: input size changed after alpha fallback\n");
- glt = (gltexture_t *)Mem_Alloc(texturemempool, sizeof(gltexture_t));
+ glt = (gltexture_t *)Mem_ExpandableArray_AllocRecord(&texturearray);
if (identifier)
strlcpy (glt->identifier, identifier, sizeof(glt->identifier));
glt->pool = pool;
texinfo = R_GetTexTypeInfo(textype, flags);
- glt = (gltexture_t *)Mem_Alloc(texturemempool, sizeof(gltexture_t));
+ glt = (gltexture_t *)Mem_ExpandableArray_AllocRecord(&texturearray);
strlcpy (glt->identifier, filename, sizeof(glt->identifier));
glt->pool = pool;
glt->chain = pool->gltchain;