Consistent copyright info (version number, date) across all files.
This commit is contained in:
@@ -1,20 +1,22 @@
|
||||
/* $Id: t_dd_tritmp.h,v 1.6 2001/03/12 00:48:44 gareth Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.5
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
*
|
||||
*
|
||||
* Copyright (C) 1999-2001
|
||||
Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
@@ -22,19 +24,19 @@
|
||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Author:
|
||||
* Keith Whitwell <keithw@valinux.com>
|
||||
* Authors:
|
||||
* Keith Whitwell <keithw@valinux.com>
|
||||
*/
|
||||
|
||||
|
||||
/* Template for building functions to plug into the driver interface
|
||||
* of t_vb_render.c:
|
||||
* ctx->Driver.QuadFunc
|
||||
* ctx->Driver.TriangleFunc
|
||||
* ctx->Driver.LineFunc
|
||||
* ctx->Driver.PointsFunc
|
||||
* ctx->Driver.QuadFunc
|
||||
* ctx->Driver.TriangleFunc
|
||||
* ctx->Driver.LineFunc
|
||||
* ctx->Driver.PointsFunc
|
||||
*
|
||||
* DO_TWOSIDE: Plug back-color values from the VB into backfacing triangles,
|
||||
* DO_TWOSIDE: Plug back-color values from the VB into backfacing triangles,
|
||||
* and restore vertices afterwards.
|
||||
* DO_OFFSET: Calculate offset for triangles and adjust vertices. Restore
|
||||
* vertices after rendering.
|
||||
@@ -67,39 +69,39 @@
|
||||
#if HAVE_RGBA
|
||||
#define VERT_SET_IND( v, c ) (void) c
|
||||
#define VERT_COPY_IND( v0, v1 )
|
||||
#define VERT_SAVE_IND( idx )
|
||||
#define VERT_RESTORE_IND( idx )
|
||||
#if HAVE_BACK_COLORS
|
||||
#define VERT_SET_RGBA( v, c )
|
||||
#endif
|
||||
#define VERT_SAVE_IND( idx )
|
||||
#define VERT_RESTORE_IND( idx )
|
||||
#if HAVE_BACK_COLORS
|
||||
#define VERT_SET_RGBA( v, c )
|
||||
#endif
|
||||
#else
|
||||
#define VERT_SET_RGBA( v, c ) (void) c
|
||||
#define VERT_COPY_RGBA( v0, v1 )
|
||||
#define VERT_SAVE_RGBA( idx )
|
||||
#define VERT_RESTORE_RGBA( idx )
|
||||
#if HAVE_BACK_COLORS
|
||||
#define VERT_SET_IND( v, c )
|
||||
#endif
|
||||
#define VERT_SAVE_RGBA( idx )
|
||||
#define VERT_RESTORE_RGBA( idx )
|
||||
#if HAVE_BACK_COLORS
|
||||
#define VERT_SET_IND( v, c )
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !HAVE_SPEC
|
||||
#define VERT_SET_SPEC( v, c ) (void) c
|
||||
#define VERT_COPY_SPEC( v0, v1 )
|
||||
#define VERT_SAVE_SPEC( idx )
|
||||
#define VERT_RESTORE_SPEC( idx )
|
||||
#define VERT_SAVE_SPEC( idx )
|
||||
#define VERT_RESTORE_SPEC( idx )
|
||||
#if HAVE_BACK_COLORS
|
||||
#define VERT_COPY_SPEC1( v )
|
||||
#endif
|
||||
#else
|
||||
#if HAVE_BACK_COLORS
|
||||
#define VERT_SET_SPEC( v, c )
|
||||
#define VERT_SET_SPEC( v, c )
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !HAVE_BACK_COLORS
|
||||
#define VERT_COPY_SPEC1( v )
|
||||
#define VERT_COPY_IND1( v )
|
||||
#define VERT_COPY_RGBA1( v )
|
||||
#define VERT_COPY_RGBA1( v )
|
||||
#endif
|
||||
|
||||
#ifndef INSANE_VERTICES
|
||||
@@ -139,7 +141,7 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
|
||||
if (DO_UNFILLED) {
|
||||
if (facing) {
|
||||
mode = ctx->Polygon.BackMode;
|
||||
if (ctx->Polygon.CullFlag &&
|
||||
if (ctx->Polygon.CullFlag &&
|
||||
ctx->Polygon.CullFaceMode != GL_FRONT) {
|
||||
return;
|
||||
}
|
||||
@@ -174,7 +176,7 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
|
||||
VERT_SAVE_SPEC( 2 );
|
||||
VERT_COPY_SPEC1( v[2] );
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
GLchan (*vbcolor)[4] = VB->ColorPtr[1]->data;
|
||||
ASSERT(VB->ColorPtr[1]->stride == 4*sizeof(GLchan));
|
||||
@@ -185,17 +187,17 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
|
||||
VERT_SET_RGBA( v[1], vbcolor[e1] );
|
||||
}
|
||||
VERT_SET_RGBA( v[2], vbcolor[e2] );
|
||||
|
||||
|
||||
if (HAVE_SPEC && VB->SecondaryColorPtr[1]) {
|
||||
GLchan (*vbspec)[4] = VB->SecondaryColorPtr[1]->data;
|
||||
|
||||
|
||||
if (!DO_FLAT) {
|
||||
VERT_SET_SPEC( v[0], vbspec[e0] );
|
||||
VERT_SET_SPEC( v[1], vbspec[e1] );
|
||||
}
|
||||
VERT_SET_SPEC( v[2], vbspec[e2] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
GLuint *vbindex = VB->IndexPtr[1]->data;
|
||||
@@ -243,7 +245,7 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
|
||||
VERT_COPY_SPEC( v[0], v[2] );
|
||||
VERT_COPY_SPEC( v[1], v[2] );
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
VERT_SAVE_IND( 0 );
|
||||
VERT_SAVE_IND( 1 );
|
||||
@@ -274,7 +276,7 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
|
||||
}
|
||||
if (DO_UNFILLED)
|
||||
RASTERIZE( GL_TRIANGLES );
|
||||
TRI( v[0], v[1], v[2] );
|
||||
TRI( v[0], v[1], v[2] );
|
||||
}
|
||||
|
||||
if (DO_OFFSET)
|
||||
@@ -296,22 +298,22 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
|
||||
VERT_RESTORE_SPEC( 1 );
|
||||
VERT_RESTORE_SPEC( 2 );
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
GLchan (*vbcolor)[4] = VB->ColorPtr[0]->data;
|
||||
ASSERT(VB->ColorPtr[0]->stride == 4*sizeof(GLchan));
|
||||
(void) vbcolor;
|
||||
|
||||
|
||||
if (!DO_FLAT) {
|
||||
VERT_SET_RGBA( v[0], vbcolor[e0] );
|
||||
VERT_SET_RGBA( v[1], vbcolor[e1] );
|
||||
}
|
||||
VERT_SET_RGBA( v[2], vbcolor[e2] );
|
||||
|
||||
|
||||
if (HAVE_SPEC && VB->SecondaryColorPtr[0]) {
|
||||
GLchan (*vbspec)[4] = VB->SecondaryColorPtr[0]->data;
|
||||
ASSERT(VB->SecondaryColorPtr[0]->stride == 4*sizeof(GLchan));
|
||||
|
||||
|
||||
if (!DO_FLAT) {
|
||||
VERT_SET_SPEC( v[0], vbspec[e0] );
|
||||
VERT_SET_SPEC( v[1], vbspec[e1] );
|
||||
@@ -319,7 +321,7 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
|
||||
VERT_SET_SPEC( v[2], vbspec[e2] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
GLuint *vbindex = VB->IndexPtr[0]->data;
|
||||
if (!DO_FLAT) {
|
||||
@@ -339,7 +341,7 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
|
||||
VERT_RESTORE_SPEC( 0 );
|
||||
VERT_RESTORE_SPEC( 1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
VERT_RESTORE_IND( 0 );
|
||||
VERT_RESTORE_IND( 1 );
|
||||
@@ -381,7 +383,7 @@ static void TAG(quad)( GLcontext *ctx,
|
||||
if (DO_UNFILLED) {
|
||||
if (facing) {
|
||||
mode = ctx->Polygon.BackMode;
|
||||
if (ctx->Polygon.CullFlag &&
|
||||
if (ctx->Polygon.CullFlag &&
|
||||
ctx->Polygon.CullFaceMode != GL_FRONT) {
|
||||
return;
|
||||
}
|
||||
@@ -399,7 +401,7 @@ static void TAG(quad)( GLcontext *ctx,
|
||||
if (HAVE_RGBA) {
|
||||
GLchan (*vbcolor)[4] = VB->ColorPtr[1]->data;
|
||||
(void)vbcolor;
|
||||
|
||||
|
||||
if (!DO_FLAT) {
|
||||
VERT_SET_RGBA( v[0], vbcolor[e0] );
|
||||
VERT_SET_RGBA( v[1], vbcolor[e1] );
|
||||
@@ -471,7 +473,7 @@ static void TAG(quad)( GLcontext *ctx,
|
||||
VERT_COPY_SPEC( v[1], v[3] );
|
||||
VERT_COPY_SPEC( v[2], v[3] );
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
VERT_SAVE_IND( 0 );
|
||||
VERT_SAVE_IND( 1 );
|
||||
@@ -506,7 +508,7 @@ static void TAG(quad)( GLcontext *ctx,
|
||||
VERT_Z_ADD(v[3], offset);
|
||||
}
|
||||
RASTERIZE( GL_TRIANGLES );
|
||||
QUAD( (v[0]), (v[1]), (v[2]), (v[3]) );
|
||||
QUAD( (v[0]), (v[1]), (v[2]), (v[3]) );
|
||||
}
|
||||
|
||||
if (DO_OFFSET)
|
||||
@@ -515,7 +517,7 @@ static void TAG(quad)( GLcontext *ctx,
|
||||
VERT_SET_Z(v[1], z[1]);
|
||||
VERT_SET_Z(v[2], z[2]);
|
||||
VERT_SET_Z(v[3], z[3]);
|
||||
}
|
||||
}
|
||||
|
||||
if (DO_TWOSIDE && facing == 1)
|
||||
{
|
||||
@@ -523,18 +525,18 @@ static void TAG(quad)( GLcontext *ctx,
|
||||
GLchan (*vbcolor)[4] = VB->ColorPtr[0]->data;
|
||||
ASSERT(VB->ColorPtr[0]->stride == 4*sizeof(GLchan));
|
||||
(void) vbcolor;
|
||||
|
||||
|
||||
if (!DO_FLAT) {
|
||||
VERT_SET_RGBA( v[0], vbcolor[e0] );
|
||||
VERT_SET_RGBA( v[1], vbcolor[e1] );
|
||||
VERT_SET_RGBA( v[2], vbcolor[e2] );
|
||||
}
|
||||
VERT_SET_RGBA( v[3], vbcolor[e3] );
|
||||
|
||||
|
||||
if (HAVE_SPEC && VB->SecondaryColorPtr[0]) {
|
||||
GLchan (*vbspec)[4] = VB->SecondaryColorPtr[0]->data;
|
||||
ASSERT(VB->SecondaryColorPtr[0]->stride == 4*sizeof(GLchan));
|
||||
|
||||
|
||||
if (!DO_FLAT) {
|
||||
VERT_SET_SPEC( v[0], vbspec[e0] );
|
||||
VERT_SET_SPEC( v[1], vbspec[e1] );
|
||||
@@ -542,7 +544,7 @@ static void TAG(quad)( GLcontext *ctx,
|
||||
}
|
||||
VERT_SET_SPEC( v[3], vbspec[e3] );
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
GLuint *vbindex = VB->IndexPtr[0]->data;
|
||||
if (!DO_FLAT) {
|
||||
@@ -565,7 +567,7 @@ static void TAG(quad)( GLcontext *ctx,
|
||||
VERT_RESTORE_SPEC( 1 );
|
||||
VERT_RESTORE_SPEC( 2 );
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
VERT_RESTORE_IND( 0 );
|
||||
VERT_RESTORE_IND( 1 );
|
||||
@@ -573,7 +575,7 @@ static void TAG(quad)( GLcontext *ctx,
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
#else
|
||||
static void TAG(quad)( GLcontext *ctx, GLuint e0,
|
||||
GLuint e1, GLuint e2, GLuint e3 )
|
||||
{
|
||||
@@ -581,12 +583,12 @@ static void TAG(quad)( GLcontext *ctx, GLuint e0,
|
||||
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
|
||||
GLubyte ef1 = VB->EdgeFlag[e1];
|
||||
GLubyte ef3 = VB->EdgeFlag[e3];
|
||||
VB->EdgeFlag[e1] = 0;
|
||||
VB->EdgeFlag[e1] = 0;
|
||||
TAG(triangle)( ctx, e0, e1, e3 );
|
||||
VB->EdgeFlag[e1] = ef1;
|
||||
VB->EdgeFlag[e3] = 0;
|
||||
TAG(triangle)( ctx, e1, e2, e3 );
|
||||
VB->EdgeFlag[e3] = ef3;
|
||||
VB->EdgeFlag[e3] = 0;
|
||||
TAG(triangle)( ctx, e1, e2, e3 );
|
||||
VB->EdgeFlag[e3] = ef3;
|
||||
} else {
|
||||
TAG(triangle)( ctx, e0, e1, e3 );
|
||||
TAG(triangle)( ctx, e1, e2, e3 );
|
||||
@@ -613,7 +615,7 @@ static void TAG(line)( GLcontext *ctx, GLuint e0, GLuint e1 )
|
||||
VERT_SAVE_SPEC( 0 );
|
||||
VERT_COPY_SPEC( v[0], v[1] );
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
VERT_SAVE_IND( 0 );
|
||||
VERT_COPY_IND( v[0], v[1] );
|
||||
@@ -629,7 +631,7 @@ static void TAG(line)( GLcontext *ctx, GLuint e0, GLuint e1 )
|
||||
if (HAVE_SPEC && VB->SecondaryColorPtr[0]) {
|
||||
VERT_RESTORE_SPEC( 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
VERT_RESTORE_IND( 0 );
|
||||
}
|
||||
@@ -687,17 +689,17 @@ static void TAG(init)( void )
|
||||
#undef VERT_COPY_IND
|
||||
#undef VERT_SAVE_IND
|
||||
#undef VERT_RESTORE_IND
|
||||
#if HAVE_BACK_COLORS
|
||||
#if HAVE_BACK_COLORS
|
||||
#undef VERT_SET_RGBA
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#undef VERT_SET_RGBA
|
||||
#undef VERT_COPY_RGBA
|
||||
#undef VERT_SAVE_RGBA
|
||||
#undef VERT_RESTORE_RGBA
|
||||
#if HAVE_BACK_COLORS
|
||||
#if HAVE_BACK_COLORS
|
||||
#undef VERT_SET_IND
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !HAVE_SPEC
|
||||
@@ -724,4 +726,3 @@ static void TAG(init)( void )
|
||||
#undef VERT_SET_Z
|
||||
#undef VERT_Z_ADD
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user