Browse Source

ref_soft: Implement texture free

pull/2/head
mittorn 6 years ago
parent
commit
60e3a78221
  1. 7
      r_image.c

7
r_image.c

@ -886,11 +886,12 @@ static void GL_DeleteTexture( image_t *tex ) @@ -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 ) @@ -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 ));
}

Loading…
Cancel
Save