-/* $Id: s_aatritemp.h,v 1.31 2003/01/14 04:55:46 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 5.1
*
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2003 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"),
GLfloat texWidth[MAX_TEXTURE_COORD_UNITS];
GLfloat texHeight[MAX_TEXTURE_COORD_UNITS];
#endif
- GLfloat bf = SWRAST_CONTEXT(ctx)->_backface_sign;
+ GLfloat bf = SWRAST_CONTEXT(ctx)->_BackfaceSign;
INIT_SPAN(span, GL_POLYGON, 0, 0, SPAN_COVERAGE);
const GLfloat botDx = vMid->win[0] - vMin->win[0];
const GLfloat botDy = vMid->win[1] - vMin->win[1];
const GLfloat area = majDx * botDy - botDx * majDy;
- ltor = (GLboolean) (area < 0.0F);
/* Do backface culling */
if (area * bf < 0 || area == 0 || IS_INF_OR_NAN(area))
return;
+ ltor = (GLboolean) (area < 0.0F);
}
#ifndef DO_OCCLUSION_TEST
#endif
#ifdef DO_RGBA
if (ctx->Light.ShadeModel == GL_SMOOTH) {
- compute_plane(p0, p1, p2, v0->color[0], v1->color[0], v2->color[0], rPlane);
- compute_plane(p0, p1, p2, v0->color[1], v1->color[1], v2->color[1], gPlane);
- compute_plane(p0, p1, p2, v0->color[2], v1->color[2], v2->color[2], bPlane);
- compute_plane(p0, p1, p2, v0->color[3], v1->color[3], v2->color[3], aPlane);
+ compute_plane(p0, p1, p2, v0->color[RCOMP], v1->color[RCOMP], v2->color[RCOMP], rPlane);
+ compute_plane(p0, p1, p2, v0->color[GCOMP], v1->color[GCOMP], v2->color[GCOMP], gPlane);
+ compute_plane(p0, p1, p2, v0->color[BCOMP], v1->color[BCOMP], v2->color[BCOMP], bPlane);
+ compute_plane(p0, p1, p2, v0->color[ACOMP], v1->color[ACOMP], v2->color[ACOMP], aPlane);
}
else {
constant_plane(v2->color[RCOMP], rPlane);
#endif
#ifdef DO_SPEC
if (ctx->Light.ShadeModel == GL_SMOOTH) {
- compute_plane(p0, p1, p2, v0->specular[0], v1->specular[0], v2->specular[0],srPlane);
- compute_plane(p0, p1, p2, v0->specular[1], v1->specular[1], v2->specular[1],sgPlane);
- compute_plane(p0, p1, p2, v0->specular[2], v1->specular[2], v2->specular[2],sbPlane);
+ compute_plane(p0, p1, p2, v0->specular[RCOMP], v1->specular[RCOMP], v2->specular[RCOMP], srPlane);
+ compute_plane(p0, p1, p2, v0->specular[GCOMP], v1->specular[GCOMP], v2->specular[GCOMP], sgPlane);
+ compute_plane(p0, p1, p2, v0->specular[BCOMP], v1->specular[BCOMP], v2->specular[BCOMP], sbPlane);
}
else {
constant_plane(v2->specular[RCOMP], srPlane);
#ifdef DO_TEX
{
const struct gl_texture_object *obj = ctx->Texture.Unit[0]._Current;
- const struct gl_texture_image *texImage = obj->Image[obj->BaseLevel];
+ const struct gl_texture_image *texImage = obj->Image[0][obj->BaseLevel];
const GLfloat invW0 = v0->win[3];
const GLfloat invW1 = v1->win[3];
const GLfloat invW2 = v2->win[3];
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
if (ctx->Texture.Unit[u]._ReallyEnabled) {
const struct gl_texture_object *obj = ctx->Texture.Unit[u]._Current;
- const struct gl_texture_image *texImage = obj->Image[obj->BaseLevel];
+ const struct gl_texture_image *texImage = obj->Image[0][obj->BaseLevel];
const GLfloat invW0 = v0->win[3];
const GLfloat invW1 = v1->win[3];
const GLfloat invW2 = v2->win[3];
array->coverage[count] = coverage;
#endif
#ifdef DO_Z
- array->z[count] = (GLdepth) solve_plane(cx, cy, zPlane);
+ array->z[count] = (GLdepth) IROUND(solve_plane(cx, cy, zPlane));
#endif
#ifdef DO_FOG
array->fog[count] = solve_plane(cx, cy, fogPlane);
span.end = (GLuint) ix - (GLuint) startX;
ASSERT(span.interpMask == 0);
#if defined(DO_MULTITEX) || defined(DO_TEX)
- _mesa_write_texture_span(ctx, &span);
+ _swrast_write_texture_span(ctx, &span);
#elif defined(DO_RGBA)
- _mesa_write_rgba_span(ctx, &span);
+ _swrast_write_rgba_span(ctx, &span);
#elif defined(DO_INDEX)
- _mesa_write_index_span(ctx, &span);
+ _swrast_write_index_span(ctx, &span);
#endif
}
}
array->coverage[ix] = coverage;
#endif
#ifdef DO_Z
- array->z[ix] = (GLdepth) solve_plane(cx, cy, zPlane);
+ array->z[ix] = (GLdepth) IROUND(solve_plane(cx, cy, zPlane));
#endif
#ifdef DO_FOG
array->fog[ix] = solve_plane(cx, cy, fogPlane);
GLint j;
for (j = 0; j < (GLint) n; j++) {
#ifdef DO_RGBA
- COPY_4V(array->rgba[j], array->rgba[j + left]);
+ COPY_CHAN4(array->rgba[j], array->rgba[j + left]);
#endif
#ifdef DO_SPEC
- COPY_4V(array->spec[j], array->spec[j + left]);
+ COPY_CHAN4(array->spec[j], array->spec[j + left]);
#endif
#ifdef DO_INDEX
array->index[j] = array->index[j + left];
span.end = n;
ASSERT(span.interpMask == 0);
#if defined(DO_MULTITEX) || defined(DO_TEX)
- _mesa_write_texture_span(ctx, &span);
+ _swrast_write_texture_span(ctx, &span);
#elif defined(DO_RGBA)
- _mesa_write_rgba_span(ctx, &span);
+ _swrast_write_rgba_span(ctx, &span);
#elif defined(DO_INDEX)
- _mesa_write_index_span(ctx, &span);
+ _swrast_write_index_span(ctx, &span);
#endif
}
}