mirror of
https://github.com/FWGS/xash3d-fwgs
synced 2024-12-05 00:21:02 +01:00
ref_soft: Implement texture free
This commit is contained in:
parent
b2105a113c
commit
60e3a78221
@ -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 ));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user