rename/clean-up _mesa_validate_texture_wrap_mode
authorBrian <brian.paul@tungstengraphics.com>
Mon, 11 Jun 2007 22:42:35 +0000 (16:42 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Mon, 11 Jun 2007 22:42:35 +0000 (16:42 -0600)
src/mesa/main/texstate.c

index 75fea56119a5f301c5ede5d29353c0ab5bacc64b..ed82f8028dc1c25f7aa806cccf4822aad9c82035 100644 (file)
@@ -1141,26 +1141,29 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params )
 /*                       Texture Parameters                           */
 /**********************************************************************/
 
+/**
+ * Check if a coordinate wrap mode is supported for the texture target.
+ * \return GL_TRUE if legal, GL_FALSE otherwise
+ */
 static GLboolean 
-_mesa_validate_texture_wrap_mode(GLcontext * ctx,
-                                GLenum target, GLenum eparam)
+validate_texture_wrap_mode(GLcontext * ctx, GLenum target, GLenum wrap)
 {
    const struct gl_extensions * const e = & ctx->Extensions;
 
-   if (eparam == GL_CLAMP || eparam == GL_CLAMP_TO_EDGE ||
-       (eparam == GL_CLAMP_TO_BORDER && e->ARB_texture_border_clamp)) {
+   if (wrap == GL_CLAMP || wrap == GL_CLAMP_TO_EDGE ||
+       (wrap == GL_CLAMP_TO_BORDER && e->ARB_texture_border_clamp)) {
       /* any texture target */
       return GL_TRUE;
    }
    else if (target != GL_TEXTURE_RECTANGLE_NV &&
-           (eparam == GL_REPEAT ||
-            (eparam == GL_MIRRORED_REPEAT &&
+           (wrap == GL_REPEAT ||
+            (wrap == GL_MIRRORED_REPEAT &&
              e->ARB_texture_mirrored_repeat) ||
-            (eparam == GL_MIRROR_CLAMP_EXT &&
+            (wrap == GL_MIRROR_CLAMP_EXT &&
              (e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp)) ||
-            (eparam == GL_MIRROR_CLAMP_TO_EDGE_EXT &&
+            (wrap == GL_MIRROR_CLAMP_TO_EDGE_EXT &&
              (e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp)) ||
-            (eparam == GL_MIRROR_CLAMP_TO_BORDER_EXT &&
+            (wrap == GL_MIRROR_CLAMP_TO_BORDER_EXT &&
              (e->EXT_texture_mirror_clamp)))) {
       /* non-rectangle texture */
       return GL_TRUE;
@@ -1316,7 +1319,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
       case GL_TEXTURE_WRAP_S:
          if (texObj->WrapS == eparam)
             return;
-         if (_mesa_validate_texture_wrap_mode(ctx, texObj->Target, eparam)) {
+         if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) {
             FLUSH_VERTICES(ctx, _NEW_TEXTURE);
             texObj->WrapS = eparam;
          }
@@ -1327,7 +1330,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
       case GL_TEXTURE_WRAP_T:
          if (texObj->WrapT == eparam)
             return;
-         if (_mesa_validate_texture_wrap_mode(ctx, texObj->Target, eparam)) {
+         if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) {
             FLUSH_VERTICES(ctx, _NEW_TEXTURE);
             texObj->WrapT = eparam;
          }
@@ -1338,7 +1341,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
       case GL_TEXTURE_WRAP_R:
          if (texObj->WrapR == eparam)
             return;
-         if (_mesa_validate_texture_wrap_mode(ctx, texObj->Target, eparam)) {
+         if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) {
             FLUSH_VERTICES(ctx, _NEW_TEXTURE);
             texObj->WrapR = eparam;
          }