diff options
author | Brian Paul <[email protected]> | 2001-05-09 21:58:19 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2001-05-09 21:58:19 +0000 |
commit | 20dc7e69459a9b529ce99f0669b78ea83162a78d (patch) | |
tree | 6dbd5a05f0aee3f6d7c2b75275459e72aa0fd0ee /src/mesa/drivers/glide/fxddtex.c | |
parent | b9f2494bfc990fe7269feeb441a3893aceb7569e (diff) |
minor clean-ups
Diffstat (limited to 'src/mesa/drivers/glide/fxddtex.c')
-rw-r--r-- | src/mesa/drivers/glide/fxddtex.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index 3253a1bcde5..21f2bd98b0e 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -1166,9 +1166,8 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, struct gl_texture_image *texImage) { fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; - GrTextureFormat_t gldformat; tfxTexInfo *ti; - tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage); + tfxMipMapLevel *mml; GLint texelBytes; if (!fxIsTexSupported(target, internalFormat, texImage)) { @@ -1176,16 +1175,23 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, return; } - if (!texObj->DriverData) + if (!texObj->DriverData) { texObj->DriverData = fxAllocTexObjData(fxMesa); + if (!texObj->DriverData) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); + return; + } + } ti = fxTMGetTexInfo(texObj); - if (!mml) { + if (!texImage->DriverData) { texImage->DriverData = MALLOC(sizeof(tfxMipMapLevel)); - mml = FX_MIPMAP_DATA(texImage); + if (!texImage->DriverData) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); + return; + } } - - fxTexGetFormat(internalFormat, &gldformat, NULL); + mml = FX_MIPMAP_DATA(texImage); fxTexGetInfo(width, height, NULL, NULL, NULL, NULL, NULL, NULL, &mml->wScale, &mml->hScale); @@ -1199,7 +1205,6 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx, internalFormat, format, type); assert(texImage->TexFormat); - texelBytes = texImage->TexFormat->TexelBytes; assert(texelBytes == 1 || texelBytes == 2); |