From: Brian Paul Date: Wed, 2 Aug 2000 20:16:03 +0000 (+0000) Subject: fixed return val bug in glAreTexturesResident() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bd0f7f42d6413577b78c342ab2f73b8d05c81d2f;p=mesa.git fixed return val bug in glAreTexturesResident() --- diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 0fdaedc998b..275cc47915c 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -1,3 +1,4 @@ +/* $Id: texobj.c,v 1.25 2000/08/02 20:16:03 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -635,41 +636,44 @@ _mesa_PrioritizeTextures( GLsizei n, const GLuint *texName, * Execute glAreTexturesResident */ GLboolean -_mesa_AreTexturesResident( GLsizei n, const GLuint *texName, - GLboolean *residences ) +_mesa_AreTexturesResident(GLsizei n, const GLuint *texName, + GLboolean *residences) { GET_CURRENT_CONTEXT(ctx); - GLboolean resident = GL_TRUE; + GLboolean allResident = GL_TRUE; GLint i; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, - "glAreTexturesResident", - GL_FALSE); - if (n<0) { - gl_error( ctx, GL_INVALID_VALUE, "glAreTexturesResident(n)" ); + "glAreTexturesResident", GL_FALSE); + if (n < 0) { + gl_error(ctx, GL_INVALID_VALUE, "glAreTexturesResident(n)"); return GL_FALSE; } - for (i=0;iShared->TexObjects, texName[i]); if (t) { - if (ctx->Driver.IsTextureResident) - residences[i] = ctx->Driver.IsTextureResident( ctx, t ); - else + if (ctx->Driver.IsTextureResident) { + residences[i] = ctx->Driver.IsTextureResident(ctx, t); + if (!residences[i]) + allResident = GL_FALSE; + } + else { residences[i] = GL_TRUE; + } } else { - gl_error( ctx, GL_INVALID_VALUE, "glAreTexturesResident(textures)" ); + gl_error(ctx, GL_INVALID_VALUE, "glAreTexturesResident(textures)"); return GL_FALSE; } } - return resident; + return allResident; } @@ -683,7 +687,7 @@ _mesa_IsTexture( GLuint texture ) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glIsTextures", GL_FALSE); - if (texture>0 && _mesa_HashLookup(ctx->Shared->TexObjects, texture)) { + if (texture > 0 && _mesa_HashLookup(ctx->Shared->TexObjects, texture)) { return GL_TRUE; } else {