From 103bc0f75c00dfcf671dc50d8d9666f88a42a59d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 29 Mar 2002 17:27:59 +0000 Subject: Replaced ClipEnabled[] array and _AnyClip with ClipPlanesEnabled bitmask. --- src/mesa/tnl/t_vb_cliptmp.h | 36 ++++++++++++++++++------------------ src/mesa/tnl/t_vb_vertex.c | 6 +++--- 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'src/mesa/tnl') diff --git a/src/mesa/tnl/t_vb_cliptmp.h b/src/mesa/tnl/t_vb_cliptmp.h index 305d45b6ba..33d605f96d 100644 --- a/src/mesa/tnl/t_vb_cliptmp.h +++ b/src/mesa/tnl/t_vb_cliptmp.h @@ -1,4 +1,4 @@ -/* $Id: t_vb_cliptmp.h,v 1.14 2001/07/13 17:26:39 brianp Exp $ */ +/* $Id: t_vb_cliptmp.h,v 1.15 2002/03/29 17:27:59 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -140,11 +140,11 @@ TAG(clip_line)( GLcontext *ctx, GLuint i, GLuint j, GLubyte mask ) if (mask & CLIP_USER_BIT) { for (p=0;pTransform.ClipEnabled[p]) { - GLfloat a = ctx->Transform._ClipUserPlane[p][0]; - GLfloat b = ctx->Transform._ClipUserPlane[p][1]; - GLfloat c = ctx->Transform._ClipUserPlane[p][2]; - GLfloat d = ctx->Transform._ClipUserPlane[p][3]; + if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { + const GLfloat a = ctx->Transform._ClipUserPlane[p][0]; + const GLfloat b = ctx->Transform._ClipUserPlane[p][1]; + const GLfloat c = ctx->Transform._ClipUserPlane[p][2]; + const GLfloat d = ctx->Transform._ClipUserPlane[p][3]; LINE_CLIP( CLIP_USER_BIT, a, b, c, d ); } } @@ -188,13 +188,13 @@ TAG(clip_tri)( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLubyte mask ) if (mask & CLIP_USER_BIT) { for (p=0;pTransform.ClipEnabled[p]) { - GLfloat a = ctx->Transform._ClipUserPlane[p][0]; - GLfloat b = ctx->Transform._ClipUserPlane[p][1]; - GLfloat c = ctx->Transform._ClipUserPlane[p][2]; - GLfloat d = ctx->Transform._ClipUserPlane[p][3]; - POLY_CLIP( CLIP_USER_BIT, a, b, c, d ); - } + if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { + const GLfloat a = ctx->Transform._ClipUserPlane[p][0]; + const GLfloat b = ctx->Transform._ClipUserPlane[p][1]; + const GLfloat c = ctx->Transform._ClipUserPlane[p][2]; + const GLfloat d = ctx->Transform._ClipUserPlane[p][3]; + POLY_CLIP( CLIP_USER_BIT, a, b, c, d ); + } } } @@ -241,11 +241,11 @@ TAG(clip_quad)( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3, if (mask & CLIP_USER_BIT) { for (p=0;pTransform.ClipEnabled[p]) { - GLfloat a = ctx->Transform._ClipUserPlane[p][0]; - GLfloat b = ctx->Transform._ClipUserPlane[p][1]; - GLfloat c = ctx->Transform._ClipUserPlane[p][2]; - GLfloat d = ctx->Transform._ClipUserPlane[p][3]; + if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { + const GLfloat a = ctx->Transform._ClipUserPlane[p][0]; + const GLfloat b = ctx->Transform._ClipUserPlane[p][1]; + const GLfloat c = ctx->Transform._ClipUserPlane[p][2]; + const GLfloat d = ctx->Transform._ClipUserPlane[p][3]; POLY_CLIP( CLIP_USER_BIT, a, b, c, d ); } } diff --git a/src/mesa/tnl/t_vb_vertex.c b/src/mesa/tnl/t_vb_vertex.c index 9026ec5144..4369df16f6 100644 --- a/src/mesa/tnl/t_vb_vertex.c +++ b/src/mesa/tnl/t_vb_vertex.c @@ -1,4 +1,4 @@ -/* $Id: t_vb_vertex.c,v 1.12 2002/01/22 14:35:17 brianp Exp $ */ +/* $Id: t_vb_vertex.c,v 1.13 2002/03/29 17:27:59 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -79,7 +79,7 @@ static void NAME( GLcontext *ctx, \ GLuint p; \ \ for (p = 0; p < ctx->Const.MaxClipPlanes; p++) \ - if (ctx->Transform.ClipEnabled[p]) { \ + if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { \ GLuint nr, i; \ const GLfloat a = ctx->Transform._ClipUserPlane[p][0]; \ const GLfloat b = ctx->Transform._ClipUserPlane[p][1]; \ @@ -211,7 +211,7 @@ static GLboolean run_vertex_stage( GLcontext *ctx, /* Test userclip planes. This contributes to VB->ClipMask, so * is essentially required to be in this stage. */ - if (ctx->Transform._AnyClip) { + if (ctx->Transform.ClipPlanesEnabled) { usercliptab[VB->ClipPtr->size]( ctx, VB->ClipPtr, store->clipmask, -- cgit v1.2.3