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