2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-12-04 16:11:31 +01:00

ref_soft: Implement texture free

This commit is contained in:
mittorn 2019-04-13 20:49:07 +07:00
parent b2105a113c
commit 60e3a78221

View File

@ -886,11 +886,12 @@ static void GL_DeleteTexture( image_t *tex )
{
image_t **prev;
image_t *cur;
int i;
ASSERT( tex != NULL );
// already freed?
if( !tex->pixels) return;
if( !tex->pixels[0]) return;
// debug
if( !tex->name[0] )
@ -919,6 +920,10 @@ static void GL_DeleteTexture( image_t *tex )
if( tex->original )
gEngfuncs.FS_FreeImage( tex->original );
for( i = 0; i < 4; i++ )
if( tex->pixels[i]) Mem_Free(tex->pixels[i]);
if( tex->alpha_pixels ) Mem_Free(tex->alpha_pixels);
memset( tex, 0, sizeof( *tex ));
}