-/* $Id: t_vb_cliptmp.h,v 1.12 2001/05/09 12:25:40 keithw Exp $ */
+/* $Id: t_vb_cliptmp.h,v 1.16 2002/10/29 20:29:03 brianp Exp $ */
/*
* Mesa 3-D graphics library
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
- * Keith Whitwell <keithw@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*/
/* Clip a line against the viewport and user clip planes.
*/
-static __inline void TAG(clip_line)( GLcontext *ctx,
- GLuint i, GLuint j,
- GLubyte mask )
+static INLINE void
+TAG(clip_line)( GLcontext *ctx, GLuint i, GLuint j, GLubyte mask )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &tnl->vb;
- interp_func interp = tnl->Driver.RenderInterp;
+ interp_func interp = tnl->Driver.Render.Interp;
GLfloat (*coord)[4] = VB->ClipPtr->data;
GLuint ii = i, jj = j, p;
if (mask & CLIP_USER_BIT) {
for (p=0;p<MAX_CLIP_PLANES;p++) {
- if (ctx->Transform.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 );
}
}
}
if ((ctx->_TriangleCaps & DD_FLATSHADE) && j != jj)
- tnl->Driver.RenderCopyPV( ctx, jj, j );
+ tnl->Driver.Render.CopyPV( ctx, jj, j );
- tnl->Driver.RenderClippedLine( ctx, ii, jj );
+ tnl->Driver.Render.ClippedLine( ctx, ii, jj );
}
/* Clip a triangle against the viewport and user clip planes.
*/
-static __inline void TAG(clip_tri)( GLcontext *ctx,
- GLuint v0, GLuint v1, GLuint v2,
- GLubyte mask )
+static INLINE void
+TAG(clip_tri)( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLubyte mask )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &tnl->vb;
- interp_func interp = tnl->Driver.RenderInterp;
+ interp_func interp = tnl->Driver.Render.Interp;
GLfloat (*coord)[4] = VB->ClipPtr->data;
GLuint pv = v2;
GLuint vlist[2][MAX_CLIPPED_VERTICES];
if (mask & CLIP_USER_BIT) {
for (p=0;p<MAX_CLIP_PLANES;p++) {
- if (ctx->Transform.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 );
+ }
}
}
if (ctx->_TriangleCaps & DD_FLATSHADE) {
if (pv != inlist[0]) {
ASSERT( inlist[0] >= VB->FirstClipped );
- tnl->Driver.RenderCopyPV( ctx, inlist[0], pv );
+ tnl->Driver.Render.CopyPV( ctx, inlist[0], pv );
}
}
- tnl->Driver.RenderClippedPolygon( ctx, inlist, n );
+ tnl->Driver.Render.ClippedPolygon( ctx, inlist, n );
}
/* Clip a quad against the viewport and user clip planes.
*/
-static __inline void TAG(clip_quad)( GLcontext *ctx,
- GLuint v0, GLuint v1, GLuint v2, GLuint v3,
- GLubyte mask )
+static INLINE void
+TAG(clip_quad)( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3,
+ GLubyte mask )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &tnl->vb;
- interp_func interp = tnl->Driver.RenderInterp;
+ interp_func interp = tnl->Driver.Render.Interp;
GLfloat (*coord)[4] = VB->ClipPtr->data;
GLuint pv = v3;
GLuint vlist[2][MAX_CLIPPED_VERTICES];
if (mask & CLIP_USER_BIT) {
for (p=0;p<MAX_CLIP_PLANES;p++) {
- if (ctx->Transform.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 );
}
}
if (ctx->_TriangleCaps & DD_FLATSHADE) {
if (pv != inlist[0]) {
ASSERT( inlist[0] >= VB->FirstClipped );
- tnl->Driver.RenderCopyPV( ctx, inlist[0], pv );
+ tnl->Driver.Render.CopyPV( ctx, inlist[0], pv );
}
}
- tnl->Driver.RenderClippedPolygon( ctx, inlist, n );
+ tnl->Driver.Render.ClippedPolygon( ctx, inlist, n );
}
#undef W