-/* $Id: teximage.c,v 1.118 2002/10/02 17:25:05 brianp Exp $ */
+/* $Id: teximage.c,v 1.119 2002/10/10 14:12:09 brianp Exp $ */
/*
* Mesa 3-D graphics library
void
_mesa_free_texture_image( struct gl_texture_image *teximage )
{
- if (teximage->Data) {
+ if (teximage->Data && !teximage->IsClientData) {
MESA_PBUFFER_FREE( teximage->Data );
teximage->Data = NULL;
}
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
/* free the old texture data */
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
clear_teximage_fields(texImage); /* not really needed, but helpful */
_mesa_init_teximage_fields(ctx, target, texImage,
postConvWidth, 1, 1,
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
/* free the old texture data */
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
clear_teximage_fields(texImage); /* not really needed, but helpful */
_mesa_init_teximage_fields(ctx, target, texImage,
postConvWidth, postConvHeight, 1,
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
clear_teximage_fields(texImage); /* not really needed, but helpful */
_mesa_init_teximage_fields(ctx, target, texImage,
width, height, depth,
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
/* free the old texture data */
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
clear_teximage_fields(texImage); /* not really needed, but helpful */
_mesa_init_teximage_fields(ctx, target, texImage, postConvWidth, 1, 1,
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
/* free the old texture data */
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
clear_teximage_fields(texImage); /* not really needed, but helpful */
_mesa_init_teximage_fields(ctx, target, texImage,
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
_mesa_init_teximage_fields(ctx, target, texImage, width, 1, 1,
border, internalFormat);
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
_mesa_init_teximage_fields(ctx, target, texImage, width, height, 1,
border, internalFormat);
return;
}
}
- else if (texImage->Data) {
+ else if (texImage->Data && !texImage->IsClientData) {
MESA_PBUFFER_FREE(texImage->Data);
- texImage->Data = NULL;
}
+ texImage->Data = NULL;
_mesa_init_teximage_fields(ctx, target, texImage, width, height, depth,
border, internalFormat);