-/* $Id: osmesa.c,v 1.49 2001/03/08 15:23:46 brianp Exp $ */
+/* $Id: osmesa.c,v 1.50 2001/03/08 17:33:33 brianp Exp $ */
/*
* Mesa 3-D graphics library
{ \
GLint i, len = RIGHT-LEFT; \
GLchan *img = PIXELADDR4(LEFT, Y); \
- (void) fffog; \
for (i = 0; i < len; i++, img += 4) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
{ \
GLint i, len = RIGHT-LEFT; \
GLuint *img = (GLuint *) PIXELADDR4(LEFT, Y); \
- (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
-/* $Id: xm_tri.c,v 1.18 2001/02/06 04:06:36 keithw Exp $ */
+/* $Id: xm_tri.c,v 1.19 2001/03/08 17:33:33 brianp Exp $ */
/*
* Mesa 3-D graphics library
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer, Y); \
GLint len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++) { \
DEPTH_TYPE z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
{ \
GLint i, len = RIGHT-LEFT; \
GLint yy = FLIP(xmesa->xm_buffer, Y); \
- (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
XDITHER_SETUP(yy); \
- (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
XDITHER_SETUP(yy); \
- (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
{ \
GLint i, len = RIGHT-LEFT; \
LOOKUP_SETUP; \
- (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++) { \
DEPTH_TYPE z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
{ \
GLint i, len = RIGHT-LEFT; \
GLint yy = FLIP(xmesa->xm_buffer, Y); \
- (void) fffog; \
for (i=0;i<len;i++) { \
DEPTH_TYPE z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
FLAT_DITHER_ROW_SETUP(FLIP(xmesa->xm_buffer, yy)); \
- (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
FLAT_DITHER_ROW_SETUP(yy); \
- (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
- (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
-/* $Id: s_lines.c,v 1.12 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_lines.c,v 1.13 2001/03/08 17:33:33 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
-
/* Flat, color index line */
static void flat_ci_line( GLcontext *ctx,
const SWvertex *vert0,
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define PLOT(X,Y) PB_WRITE_PIXEL(PB, X, Y, Z, fog0);
#include "s_linetemp.h"
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define PLOT(X,Y) PB_WRITE_PIXEL(PB, X, Y, Z, fog0);
#include "s_linetemp.h"
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_INDEX 1
#define PLOT(X,Y) \
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_RGB 1
#define INTERP_ALPHA 1
/* stippled */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_INDEX 1
#define WIDE 1
#define STIPPLE 1
/* special case: unstippled and width=2 */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_INDEX 1
#define XMAJOR_PLOT(X,Y) \
pbx[count] = X; pbx[count+1] = X; \
/* unstippled, any width */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_INDEX 1
#define WIDE 1
#define PLOT(X,Y) \
/* stippled, any width */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define WIDE 1
#define STIPPLE 1
#define PLOT(X,Y) \
/* special case: unstippled and width=2 */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define XMAJOR_PLOT(X,Y) \
pbx[count] = X; pbx[count+1] = X; \
pby[count] = Y; pby[count+1] = Y+1; \
/* unstippled, any width */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define WIDE 1
#define PLOT(X,Y) \
pbx[count] = X; \
/* stippled */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_RGB 1
#define INTERP_ALPHA 1
#define WIDE 1
/* special case: unstippled and width=2 */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_RGB 1
#define INTERP_ALPHA 1
#define XMAJOR_PLOT(X,Y) \
/* unstippled, any width */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_RGB 1
#define INTERP_ALPHA 1
#define WIDE 1
/* stippled */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define WIDE 1
#define STIPPLE 1
#define PLOT(X,Y) PB_WRITE_PIXEL(PB, X, Y, Z, fog0);
/* special case: unstippled and width=2 */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define XMAJOR_PLOT(X,Y) PB_WRITE_PIXEL(PB, X, Y, Z, fog0); \
PB_WRITE_PIXEL(PB, X, Y+1, Z, fog0);
#define YMAJOR_PLOT(X,Y) PB_WRITE_PIXEL(PB, X, Y, Z, fog0); \
/* unstippled, any width */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define WIDE 1
#define PLOT(X,Y) PB_WRITE_PIXEL(PB, X, Y, Z, fog0);
#include "s_linetemp.h"
/* stippled */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_TEX 1
#define WIDE 1
#define STIPPLE 1
/* unstippled */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_TEX 1
#define WIDE 1
#define PLOT(X,Y) \
/* stippled */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_RGB 1
#define INTERP_ALPHA 1
#define INTERP_TEX 1
/* unstippled */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_RGB 1
#define INTERP_ALPHA 1
#define INTERP_TEX 1
/* stippled */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_RGB 1
#define INTERP_SPEC 1
#define INTERP_ALPHA 1
/* unstippled */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_RGB 1
#define INTERP_SPEC 1
#define INTERP_ALPHA 1
/* stippled */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_ALPHA 1
#define INTERP_MULTITEX 1
#define WIDE 1
/* unstippled */
#define INTERP_XY 1
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_ALPHA 1
#define INTERP_MULTITEX 1
#define WIDE 1
-/* $Id: s_linetemp.h,v 1.5 2001/02/07 18:36:52 brianp Exp $ */
+/* $Id: s_linetemp.h,v 1.6 2001/03/08 17:33:33 brianp Exp $ */
/*
* Mesa 3-D graphics library
*
* The following macros may be defined to indicate what auxillary information
* must be interplated along the line:
- * INTERP_Z - if defined, interpolate Z and FOG values
+ * INTERP_Z - if defined, interpolate Z values
+ * INTERP_FOG - if defined, interpolate FOG values
* INTERP_RGB - if defined, interpolate RGB values
* INTERP_SPEC - if defined, interpolate specular RGB values
* INTERP_ALPHA - if defined, interpolate Alpha values
GLint zPtrXstep, zPtrYstep;
DEPTH_TYPE *zPtr;
# endif
+#endif
+#ifdef INTERP_FOG
GLfixed fog0 = FloatToFixed(vert0->fog);
GLfixed dfog = FloatToFixed(vert1->fog) - fog0;
#endif
GLint errorDec = error-dx;
#ifdef INTERP_Z
dz = (z1-z0) / dx;
+#endif
+#ifdef INTERP_FOG
dfog /= dx;
#endif
#ifdef INTERP_RGB
zPtr = (DEPTH_TYPE *) ((GLubyte*) zPtr + zPtrXstep);
# endif
z0 += dz;
+#endif
+#ifdef INTERP_FOG
fog0 += dfog;
#endif
#ifdef INTERP_RGB
GLint errorDec = error-dy;
#ifdef INTERP_Z
dz = (z1-z0) / dy;
+#endif
+#ifdef INTERP_FOG
dfog /= dy;
#endif
#ifdef INTERP_RGB
zPtr = (DEPTH_TYPE *) ((GLubyte*) zPtr + zPtrYstep);
# endif
z0 += dz;
+#endif
+#ifdef INTERP_FOG
fog0 += dfog;
#endif
#ifdef INTERP_RGB
#undef INTERP_XY
#undef INTERP_Z
+#undef INTERP_FOG
#undef INTERP_RGB
#undef INTERP_SPEC
#undef INTERP_ALPHA
-/* $Id: s_triangle.c,v 1.16 2001/03/08 15:23:46 brianp Exp $ */
+/* $Id: s_triangle.c,v 1.17 2001/03/08 17:33:33 brianp Exp $ */
/*
* Mesa 3-D graphics library
}
+
/*
* Render a flat-shaded color index triangle.
*/
const SWvertex *v2 )
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
const SWvertex *v2 )
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define INTERP_INDEX 1
#define INNER_LOOP( LEFT, RIGHT, Y ) \
const SWvertex *v2 )
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define INTERP_ALPHA 1
const SWvertex *v2 )
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_INT_TEX 1
#define S_SCALE twidth
const SWvertex *v2 )
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define INTERP_ALPHA 1
#define BIAS 4096.0F
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define INTERP_ALPHA 1
const SWvertex *v2 )
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define INTERP_ALPHA 1
const SWvertex *v2 )
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define INTERP_ALPHA 1
GLchan spec[MAX_WIDTH][4] )
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define INTERP_SPEC 1
GLfloat u[MAX_WIDTH] )
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define INTERP_ALPHA 1
GLfloat u[MAX_WIDTH] )
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define INTERP_SPEC 1
GLfloat u[MAX_TEXTURE_UNITS][MAX_WIDTH])
{
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define INTERP_ALPHA 1
#define DO_OCCLUSION_TEST
#define INTERP_Z 1
+#define INTERP_FOG 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
-/* $Id: s_tritemp.h,v 1.12 2001/03/07 05:06:12 brianp Exp $ */
+/* $Id: s_tritemp.h,v 1.13 2001/03/08 17:33:33 brianp Exp $ */
/*
* Mesa 3-D graphics library
* The following macros may be defined to indicate what auxillary information
* must be interplated across the triangle:
* INTERP_Z - if defined, interpolate Z values
+ * INTERP_FOG - if defined, interpolate fog values
* INTERP_RGB - if defined, interpolate RGB values
- * INTERP_SPEC - if defined, interpolate specular RGB values
* INTERP_ALPHA - if defined, interpolate Alpha values
+ * INTERP_SPEC - if defined, interpolate specular RGB values
* INTERP_INDEX - if defined, interpolate color index values
* INTERP_INT_TEX - if defined, interpolate integer ST texcoords
* (fast, simple 2-D texture mapping)
GLint ltor; /* true if scanning left-to-right */
#ifdef INTERP_Z
GLfloat dzdx, dzdy; GLfixed fdzdx;
+#endif
+#ifdef INTERP_FOG
GLfloat dfogdx, dfogdy; GLfixed fdfogdx;
#endif
#ifdef INTERP_RGB
else
fdzdx = (GLint) dzdx;
}
+#endif
+#ifdef INTERP_FOG
{
GLfloat eMaj_dfog, eBot_dfog;
eMaj_dfog = (vMax->fog - vMin->fog) * 256;
int dZRowOuter, dZRowInner; /* offset in bytes */
# endif
GLfixed fz, fdzOuter, fdzInner;
+#endif
+#ifdef INTERP_FOG
GLfixed ffog, fdfogOuter, fdfogInner;
#endif
#ifdef INTERP_RGB
dZRowOuter = (ctx->DrawBuffer->Width + idxOuter) * sizeof(DEPTH_TYPE);
# endif
}
- {
- ffog = FloatToFixed(vLower->fog * 256 + dfogdx * adjx + dfogdy * adjy) + FIXED_HALF;
- fdfogOuter = SignedFloatToFixed(dfogdy + dxOuter * dfogdx);
- }
+#endif
+#ifdef INTERP_FOG
+ ffog = FloatToFixed(vLower->fog * 256 + dfogdx * adjx
+ + dfogdy * adjy) + FIXED_HALF;
+ fdfogOuter = SignedFloatToFixed(dfogdy + dxOuter * dfogdx);
#endif
#ifdef INTERP_RGB
fr = (GLfixed)(IntToFixed(vLower->color[0])
dZRowInner = dZRowOuter + sizeof(DEPTH_TYPE);
# endif
fdzInner = fdzOuter + fdzdx;
+#endif
+#ifdef INTERP_FOG
fdfogInner = fdfogOuter + fdfogdx;
#endif
#ifdef INTERP_RGB
GLint right = FixedToInt(fxRightEdge);
#ifdef INTERP_Z
GLfixed ffz = fz;
+#endif
+#ifdef INTERP_FOG
GLfixed fffog = ffog;
#endif
#ifdef INTERP_RGB
zRow = (DEPTH_TYPE *) ((GLubyte*)zRow + dZRowOuter);
# endif
fz += fdzOuter;
+#endif
+#ifdef INTERP_FOG
ffog += fdfogOuter;
#endif
#ifdef INTERP_RGB
zRow = (DEPTH_TYPE *) ((GLubyte*)zRow + dZRowInner);
# endif
fz += fdzInner;
+#endif
+#ifdef INTERP_FOG
ffog += fdfogInner;
#endif
#ifdef INTERP_RGB
#undef PIXEL_ADDRESS
#undef INTERP_Z
+#undef INTERP_FOG
#undef INTERP_RGB
#undef INTERP_SPEC
#undef INTERP_ALPHA