diff options
Diffstat (limited to 'xc/extras/Mesa/src/lnaatemp.h')
-rw-r--r-- | xc/extras/Mesa/src/lnaatemp.h | 107 |
1 files changed, 53 insertions, 54 deletions
diff --git a/xc/extras/Mesa/src/lnaatemp.h b/xc/extras/Mesa/src/lnaatemp.h index b9e281546..43923e851 100644 --- a/xc/extras/Mesa/src/lnaatemp.h +++ b/xc/extras/Mesa/src/lnaatemp.h @@ -1,4 +1,3 @@ -/* $Id: lnaatemp.h,v 1.1.1.1 2000/01/06 13:26:56 faith Exp $ */ /* * Mesa 3-D graphics library @@ -23,7 +22,7 @@ * 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. */ - +/* $XFree86: xc/extras/Mesa/src/lnaatemp.h,v 1.7 2000/02/18 12:18:45 tsi Exp $ */ /* * Antialiased Line Rasterizer Template @@ -62,22 +61,22 @@ GLint dy = y1 - y0; GLint xStep, yStep; GLint z0, z1; -#if INTERP_RGBA +#ifdef INTERP_RGBA GLfixed fr, fg, fb, fa; /* fixed-pt RGBA */ GLfixed dfr, dfg, dfb, dfa; /* fixed-pt RGBA deltas */ #endif -#if INTERP_SPEC +#ifdef INTERP_SPEC GLfixed fsr, fsg, fsb; /* fixed-pt specular RGBA */ GLfixed dfsr, dfsg, dfsb; /* fixed-pt specular RGBA deltas */ #endif -#if INTERP_INDEX +#ifdef INTERP_INDEX GLfixed fi, dfi; #endif -#if INTERP_STUV0 || INTERP_STUV1 +#if defined(INTERP_STUV0) || defined(INTERP_STUV1) GLfloat invw0 = VB->Win.data[vert0][3]; GLfloat invw1 = VB->Win.data[vert1][3]; #endif -#if INTERP_STUV0 +#ifdef INTERP_STUV0 /* h denotes hyperbolic */ GLfloat hs0 = invw0 * VB->TexCoordPtr[0]->data[vert0][0]; GLfloat dhs = invw1 * VB->TexCoordPtr[0]->data[vert1][0] - hs0; @@ -86,7 +85,7 @@ GLfloat hu0 = 0, dhu = 0; GLfloat hv0 = invw0, dhv = invw1 - invw0; #endif -#if INTERP_STUV1 +#ifdef INTERP_STUV1 GLfloat hs01 = invw0 * VB->TexCoordPtr[1]->data[vert0][0]; GLfloat dhs1 = invw1 * VB->TexCoordPtr[1]->data[vert1][0] - hs01; GLfloat ht01 = invw0 * VB->TexCoordPtr[1]->data[vert0][1]; @@ -106,7 +105,7 @@ z1 = (int) VB->Win.data[vert1][2]; #endif -#if INTERP_STUV0 +#ifdef INTERP_STUV0 if (VB->TexCoordPtr[0]->size > 2) { hu0 = invw0 * VB->TexCoordPtr[0]->data[vert0][2]; dhu = invw1 * VB->TexCoordPtr[0]->data[vert1][2] - hu0; @@ -117,7 +116,7 @@ } #endif -#if INTERP_STUV1 +#ifdef INTERP_STUV1 if (VB->TexCoordPtr[1]->size > 2) { hu01 = invw0 * VB->TexCoordPtr[1]->data[vert0][2]; dhu1 = invw1 * VB->TexCoordPtr[1]->data[vert1][2] - hu01; @@ -128,7 +127,7 @@ } #endif -#if INTERP_RGBA +#ifdef INTERP_RGBA if (ctx->Light.ShadeModel == GL_SMOOTH) { fr = IntToFixed(VB->ColorPtr->data[vert0][0]); fg = IntToFixed(VB->ColorPtr->data[vert0][1]); @@ -143,7 +142,7 @@ dfr = dfg = dfb = dfa = 0; } #endif -#if INTERP_SPEC +#ifdef INTERP_SPEC if (ctx->Light.ShadeModel == GL_SMOOTH) { fsr = IntToFixed(VB->Specular[vert0][0]); fsg = IntToFixed(VB->Specular[vert0][1]); @@ -156,7 +155,7 @@ dfsr = dfsg = dfsb = 0; } #endif -#if INTERP_INDEX +#ifdef INTERP_INDEX if (ctx->Light.ShadeModel == GL_SMOOTH) { fi = IntToFixed(VB->IndexPtr->data[vert0]); } @@ -198,7 +197,7 @@ GLint dz = (z1 - z0) / dx; GLfloat invDx = 1.0F / dx; (void) invDx; -#if INTERP_RGBA +#ifdef INTERP_RGBA if (ctx->Light.ShadeModel == GL_SMOOTH) { dfr = (IntToFixed(VB->ColorPtr->data[vert1][0]) - fr) * invDx; dfg = (IntToFixed(VB->ColorPtr->data[vert1][1]) - fg) * invDx; @@ -206,20 +205,20 @@ dfa = (IntToFixed(VB->ColorPtr->data[vert1][3]) - fa) * invDx; } #endif -#if INTERP_SPEC +#ifdef INTERP_SPEC if (ctx->Light.ShadeModel == GL_SMOOTH) { dfsr = (IntToFixed(VB->Specular[vert1][0]) - fsr) * invDx; dfsg = (IntToFixed(VB->Specular[vert1][1]) - fsg) * invDx; dfsb = (IntToFixed(VB->Specular[vert1][2]) - fsb) * invDx; } #endif -#if INTERP_STUV0 +#ifdef INTERP_STUV0 dhs *= invDx; dht *= invDx; dhu *= invDx; dhv *= invDx; #endif -#if INTERP_STUV1 +#ifdef INTERP_STUV1 dhs1 *= invDx; dht1 *= invDx; dhu1 *= invDx; @@ -233,19 +232,19 @@ GLint yTopi = (GLint) yTop; GLint yBoti = (GLint) yBot; GLint iy; -#if INTERP_RGBA +#ifdef INTERP_RGBA GLubyte red = FixedToInt(fr); GLubyte green = FixedToInt(fg); GLubyte blue = FixedToInt(fb); GLubyte alpha = FixedToInt(fa); GLint coverage; #endif -#if INTERP_SPEC +#ifdef INTERP_SPEC GLubyte specRed = FixedToInt(fsr); GLubyte specGreen = FixedToInt(fsg); GLubyte specBlue = FixedToInt(fsb); #endif -#if INTERP_INDEX +#ifdef INTERP_INDEX GLuint index = FixedToInt(fi) & 0xfffffff0; GLuint coverage; #endif @@ -257,13 +256,13 @@ ASSERT(yBoti <= yTopi); { -#if INTERP_STUV0 +#ifdef INTERP_STUV0 GLfloat invQ = 1.0F / hv0; GLfloat s = hs0 * invQ; GLfloat t = ht0 * invQ; GLfloat u = hu0 * invQ; #endif -#if INTERP_STUV1 +#ifdef INTERP_STUV1 GLfloat invQ1 = 1.0F / hv01; GLfloat s1 = hs01 * invQ1; GLfloat t1 = ht01 * invQ1; @@ -271,30 +270,30 @@ #endif /* bottom pixel of swipe */ -#if INTERP_RGBA +#ifdef INTERP_RGBA coverage = (GLint) (alpha * (1.0F - (yBot - yBoti))); #endif -#if INTERP_INDEX +#ifdef INTERP_INDEX coverage = (GLuint) (15.0F * (1.0F - (yBot - yBoti))); #endif PLOT(x, yBoti); yBoti++; /* top pixel of swipe */ -#if INTERP_RGBA +#ifdef INTERP_RGBA coverage = (GLint) (alpha * (yTop - yTopi)); #endif -#if INTERP_INDEX +#ifdef INTERP_INDEX coverage = (GLuint) (15.0F * (yTop - yTopi)); #endif PLOT(x, yTopi); yTopi--; /* pixels between top and bottom with 100% coverage */ -#if INTERP_RGBA +#ifdef INTERP_RGBA coverage = alpha; #endif -#if INTERP_INDEX +#ifdef INTERP_INDEX coverage = 15; #endif for (iy = yBoti; iy <= yTopi; iy++) { @@ -308,30 +307,30 @@ x += xStep; y += yStep; z0 += dz; -#if INTERP_RGBA +#ifdef INTERP_RGBA fr += dfr; fg += dfg; fb += dfb; fa += dfa; #endif -#if INTERP_SPEC +#ifdef INTERP_SPEC fsr += dfsr; fsg += dfsg; fsb += dfsb; #endif -#if INTERP_STUV0 +#ifdef INTERP_STUV0 hs0 += dhs; ht0 += dht; hu0 += dhu; hv0 += dhv; #endif -#if INTERP_STUV1 +#ifdef INTERP_STUV1 hs01 += dhs1; ht01 += dht1; hu01 += dhu1; hv01 += dhv1; #endif -#if INTERP_INDEX +#ifdef INTERP_INDEX fi += dfi; #endif @@ -348,7 +347,7 @@ GLint dz = (z1 - z0) / dy; GLfloat invDy = 1.0F / dy; (void) invDy; -#if INTERP_RGBA +#ifdef INTERP_RGBA if (ctx->Light.ShadeModel == GL_SMOOTH) { dfr = (IntToFixed(VB->ColorPtr->data[vert1][0]) - fr) * invDy; dfg = (IntToFixed(VB->ColorPtr->data[vert1][1]) - fg) * invDy; @@ -356,26 +355,26 @@ dfa = (IntToFixed(VB->ColorPtr->data[vert1][3]) - fa) * invDy; } #endif -#if INTERP_SPEC +#ifdef INTERP_SPEC if (ctx->Light.ShadeModel == GL_SMOOTH) { dfsr = (IntToFixed(VB->Specular[vert1][0]) - fsr) * invDy; dfsg = (IntToFixed(VB->Specular[vert1][1]) - fsg) * invDy; dfsb = (IntToFixed(VB->Specular[vert1][2]) - fsb) * invDy; } #endif -#if INTERP_STUV0 +#ifdef INTERP_STUV0 dhs *= invDy; dht *= invDy; dhu *= invDy; dhv *= invDy; #endif -#if INTERP_STUV1 +#ifdef INTERP_STUV1 dhs1 *= invDy; dht1 *= invDy; dhu1 *= invDy; dhv1 *= invDy; #endif -#if INTERP_INDEX +#ifdef INTERP_INDEX if (ctx->Light.ShadeModel == GL_SMOOTH) { dfi = (IntToFixed(VB->IndexPtr->data[vert1]) - fi) / dy; } @@ -387,19 +386,19 @@ GLint xRighti = (GLint) xRight; GLint xLefti = (GLint) xLeft; GLint ix; -#if INTERP_RGBA +#ifdef INTERP_RGBA GLubyte red = FixedToInt(fr); GLubyte green = FixedToInt(fg); GLubyte blue = FixedToInt(fb); GLubyte alpha = FixedToInt(fa); GLint coverage; #endif -#if INTERP_SPEC +#ifdef INTERP_SPEC GLubyte specRed = FixedToInt(fsr); GLubyte specGreen = FixedToInt(fsg); GLubyte specBlue = FixedToInt(fsb); #endif -#if INTERP_INDEX +#ifdef INTERP_INDEX GLuint index = FixedToInt(fi) & 0xfffffff0; GLuint coverage; #endif @@ -412,13 +411,13 @@ ASSERT(xLefti < xRight); { -#if INTERP_STUV0 +#ifdef INTERP_STUV0 GLfloat invQ = 1.0F / hv0; GLfloat s = hs0 * invQ; GLfloat t = ht0 * invQ; GLfloat u = hu0 * invQ; #endif -#if INTERP_STUV1 +#ifdef INTERP_STUV1 GLfloat invQ1 = 1.0F / hv01; GLfloat s1 = hs01 * invQ1; GLfloat t1 = ht01 * invQ1; @@ -426,30 +425,30 @@ #endif /* left pixel of swipe */ -#if INTERP_RGBA +#ifdef INTERP_RGBA coverage = (GLint) (alpha * (1.0F - (xLeft - xLefti))); #endif -#if INTERP_INDEX +#ifdef INTERP_INDEX coverage = (GLuint) (15.0F * (1.0F - (xLeft - xLefti))); #endif PLOT(xLefti, y); xLefti++; /* right pixel of swipe */ -#if INTERP_RGBA +#ifdef INTERP_RGBA coverage = (GLint) (alpha * (xRight - xRighti)); #endif -#if INTERP_INDEX +#ifdef INTERP_INDEX coverage = (GLuint) (15.0F * (xRight - xRighti)); #endif PLOT(xRighti, y) xRighti--; /* pixels between top and bottom with 100% coverage */ -#if INTERP_RGBA +#ifdef INTERP_RGBA coverage = alpha; #endif -#if INTERP_INDEX +#ifdef INTERP_INDEX coverage = 15; #endif for (ix = xLefti; ix <= xRighti; ix++) { @@ -462,30 +461,30 @@ x += xStep; y += yStep; z0 += dz; -#if INTERP_RGBA +#ifdef INTERP_RGBA fr += dfr; fg += dfg; fb += dfb; fa += dfa; #endif -#if INTERP_SPEC +#ifdef INTERP_SPEC fsr += dfsr; fsg += dfsg; fsb += dfsb; #endif -#if INTERP_STUV0 +#ifdef INTERP_STUV0 hs0 += dhs; ht0 += dht; hu0 += dhu; hv0 += dhv; #endif -#if INTERP_STUV1 +#ifdef INTERP_STUV1 hs01 += dhs1; ht01 += dht1; hu01 += dhu1; hv01 += dhv1; #endif -#if INTERP_INDEX +#ifdef INTERP_INDEX fi += dfi; #endif if (!solid) |