head	3.5;
access;
symbols
	merge-1:1.1.2.1
	experimental-1:1.1.0.2;
locks; strict;
comment	@ * @;


3.5
date	99.07.30.17.10.21;	author brianp;	state Exp;
branches;
next	3.4;

3.4
date	99.07.20.22.35.20;	author keithw;	state Exp;
branches;
next	3.3;

3.3
date	99.07.12.20.28.01;	author brianp;	state Exp;
branches;
next	3.2;

3.2
date	99.07.12.15.19.30;	author brianp;	state Exp;
branches;
next	3.1;

3.1
date	99.07.12.12.05.24;	author keithw;	state Exp;
branches;
next	1.1;

1.1
date	99.05.21.21.29.26;	author keithw;	state dead;
branches
	1.1.2.1;
next	;

1.1.2.1
date	99.05.21.21.29.26;	author keithw;	state Exp;
branches;
next	;


desc
@@


3.5
log
@silence unused var warning
@
text
@/* $Id: interp_tmp.h,v 3.4 1999/07/20 22:35:20 keithw Exp $ */

/*
 * Mesa 3-D graphics library
 * Version:  3.1
 * 
 * Copyright (C) 1999  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
 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
 * 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.
 */


static void NAME( struct vertex_buffer *VB,
		  GLuint dst, GLfloat t, GLuint in, GLuint out )
{
#if (IND & CLIP_RGBA0)
   GLfloat col[3][4];
#endif

   (void) VB;
   (void) dst;
   (void) t;
   (void) in;
   (void) out;

#if (IND & CLIP_EDGE)
  * VEC_ELT(VB->EdgeFlagPtr, GLubyte, dst) = 
      * VEC_ELT(VB->EdgeFlagPtr, GLubyte, out);
#endif

#if (IND & CLIP_RGBA0)
   UBYTE_RGBA_TO_FLOAT_RGBA(col[1], VB->Color[0]->data[in]);
   UBYTE_RGBA_TO_FLOAT_RGBA(col[2], VB->Color[0]->data[out]);
   INTERP_SZ( t, col, 0, 1, 2, 4 );
   FLOAT_RGBA_TO_UBYTE_RGBA(VB->Color[0]->data[dst], col[0]);
#endif

#if (IND & CLIP_RGBA1)
   if (VB->ctx->TriangleCaps & DD_TRI_LIGHT_TWOSIDE) {
      UBYTE_RGBA_TO_FLOAT_RGBA(col[1], VB->Color[1]->data[in]);
      UBYTE_RGBA_TO_FLOAT_RGBA(col[2], VB->Color[1]->data[out]);
      INTERP_SZ( t, col, 0, 1, 2, 4 );
      FLOAT_RGBA_TO_UBYTE_RGBA(VB->Color[1]->data[dst], col[0]);
   }

   if (VB->ctx->TriangleCaps & DD_SEPERATE_SPECULAR) 
   {
      UBYTE_RGBA_TO_FLOAT_RGBA(col[1], VB->Spec[0][in]);
      UBYTE_RGBA_TO_FLOAT_RGBA(col[2], VB->Spec[0][out]);
      INTERP_SZ( t, col, 0, 1, 2, 4 );
      FLOAT_RGBA_TO_UBYTE_RGBA(VB->Spec[0][dst], col[0]);

      if (VB->ctx->TriangleCaps & DD_TRI_LIGHT_TWOSIDE) {
	 UBYTE_RGBA_TO_FLOAT_RGBA(col[1], VB->Spec[1][in]);
	 UBYTE_RGBA_TO_FLOAT_RGBA(col[2], VB->Spec[1][out]);
	 INTERP_SZ( t, col, 0, 1, 2, 4 );
	 FLOAT_RGBA_TO_UBYTE_RGBA(VB->Spec[1][dst], col[0]);
      }
   }      
#endif

#if (IND & CLIP_INDEX0)
   VB->IndexPtr->data[dst] = (GLuint) (GLint) 
      LINTERP( t, 
	       (GLfloat) VB->Index[0]->data[in],
	       (GLfloat) VB->Index[0]->data[out] );
#endif

#if (IND & CLIP_INDEX1)
   VB->Index[1]->data[dst] = (GLuint) (GLint) 
      LINTERP( t, 
	       (GLfloat) VB->Index[1]->data[in],
	       (GLfloat) VB->Index[1]->data[out] );
#endif

#if (IND & CLIP_TEX0)
   INTERP_SZ( t, 
	      VB->TexCoordPtr[0]->data, 
	      dst, in, out, 
	      VB->TexCoordPtr[0]->size );
#endif

#if (IND & CLIP_TEX1)
   INTERP_SZ( t, 
	      VB->TexCoordPtr[1]->data, 
	      dst, in, out, 
	      VB->TexCoordPtr[1]->size );
#endif
}


#undef IND
#undef NAME
@


3.4
log
@line clipping and rasterization bugs
@
text
@d1 1
a1 1
/* $Id: interp_tmp.h,v 3.3 1999/07/12 20:28:01 brianp Exp $ */
d35 1
@


3.3
log
@inserted copyright info
@
text
@d1 1
a1 1
/* $Id$ */
d53 21
a73 4
   UBYTE_RGBA_TO_FLOAT_RGBA(col[1], VB->Color[1]->data[in]);
   UBYTE_RGBA_TO_FLOAT_RGBA(col[2], VB->Color[1]->data[out]);
   INTERP_SZ( t, col, 0, 1, 2, 4 );
   FLOAT_RGBA_TO_UBYTE_RGBA(VB->Color[1]->data[dst], col[0]);
@


3.2
log
@silence unused var warnings
@
text
@d1 27
@


3.1
log
@merge from experimental branch upto merge-1 tag
@
text
@d8 5
@


1.1
log
@file interp_tmp.h was initially added on branch experimental-1.
@
text
@d1 58
@


1.1.2.1
log
@Quake3 inspired optimizations
@
text
@a0 58
static void NAME( struct vertex_buffer *VB,
		  GLuint dst, GLfloat t, GLuint in, GLuint out )
{
#if (IND & CLIP_RGBA0)
   GLfloat col[3][4];
#endif

#if (IND & CLIP_EDGE)
  * VEC_ELT(VB->EdgeFlagPtr, GLubyte, dst) = 
      * VEC_ELT(VB->EdgeFlagPtr, GLubyte, out);
#endif

#if (IND & CLIP_RGBA0)
   UBYTE_RGBA_TO_FLOAT_RGBA(col[1], VB->Color[0]->data[in]);
   UBYTE_RGBA_TO_FLOAT_RGBA(col[2], VB->Color[0]->data[out]);
   INTERP_SZ( t, col, 0, 1, 2, 4 );
   FLOAT_RGBA_TO_UBYTE_RGBA(VB->Color[0]->data[dst], col[0]);
#endif

#if (IND & CLIP_RGBA1)
   UBYTE_RGBA_TO_FLOAT_RGBA(col[1], VB->Color[1]->data[in]);
   UBYTE_RGBA_TO_FLOAT_RGBA(col[2], VB->Color[1]->data[out]);
   INTERP_SZ( t, col, 0, 1, 2, 4 );
   FLOAT_RGBA_TO_UBYTE_RGBA(VB->Color[1]->data[dst], col[0]);
#endif

#if (IND & CLIP_INDEX0)
   VB->IndexPtr->data[dst] = (GLuint) (GLint) 
      LINTERP( t, 
	       (GLfloat) VB->Index[0]->data[in],
	       (GLfloat) VB->Index[0]->data[out] );
#endif

#if (IND & CLIP_INDEX1)
   VB->Index[1]->data[dst] = (GLuint) (GLint) 
      LINTERP( t, 
	       (GLfloat) VB->Index[1]->data[in],
	       (GLfloat) VB->Index[1]->data[out] );
#endif

#if (IND & CLIP_TEX0)
   INTERP_SZ( t, 
	      VB->TexCoordPtr[0]->data, 
	      dst, in, out, 
	      VB->TexCoordPtr[0]->size );
#endif

#if (IND & CLIP_TEX1)
   INTERP_SZ( t, 
	      VB->TexCoordPtr[1]->data, 
	      dst, in, out, 
	      VB->TexCoordPtr[1]->size );
#endif
}


#undef IND
#undef NAME
@

