summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2000-08-02 20:16:03 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2000-08-02 20:16:03 +0000
commitbd0f7f42d6413577b78c342ab2f73b8d05c81d2f (patch)
tree7cc0ad3b138a70a61c6ae668616fa4e0a75bd82c /src
parent6f173cafbdf4fe370b9d7b365e28ccbc12bc7844 (diff)
fixed return val bug in glAreTexturesResident()
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/texobj.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 0fdaedc998..275cc47915 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;i<n;i++) {
+ for (i = 0; i < n; i++) {
struct gl_texture_object *t;
- if (texName[i]==0) {
- gl_error( ctx, GL_INVALID_VALUE, "glAreTexturesResident(textures)" );
+ if (texName[i] == 0) {
+ gl_error(ctx, GL_INVALID_VALUE, "glAreTexturesResident(textures)");
return GL_FALSE;
}
t = (struct gl_texture_object *)
_mesa_HashLookup(ctx->Shared->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 {