Changeset 3597 for trunk/src/opengl/mesa/lnaatemp.h
- Timestamp:
- May 23, 2000, 10:35:01 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/opengl/mesa/lnaatemp.h
r2938 r3597 1 /* $Id: lnaatemp.h,v 1. 1 2000-02-29 00:48:32 sandervlExp $ */1 /* $Id: lnaatemp.h,v 1.2 2000-05-23 20:34:52 jeroen Exp $ */ 2 2 3 3 /* … … 53 53 const struct vertex_buffer *VB = ctx->VB; 54 54 struct pixel_buffer *pb = ctx->PB; 55 GLfloat halfWidth = 0.5F * ctx->Line.Width; /* 0.5 is a bit of a hack*/55 GLfloat halfWidth = 0.5F * ctx->Line.Width; /* 0.5 is a bit of a hack */ 56 56 GLboolean solid = !ctx->Line.StippleFlag; 57 57 GLint x0 = (GLint) VB->Win.data[vert0][0]; … … 63 63 GLint xStep, yStep; 64 64 GLint z0, z1; 65 const GLint depthBits = ctx->Visual->DepthBits; 66 const GLint fixedToDepthShift = depthBits <= 16 ? FIXED_SHIFT : 0; 67 #define FixedToDepth(F) ((F) >> fixedToDepthShift) 65 68 #if INTERP_RGBA 66 69 GLfixed fr, fg, fb, fa; /* fixed-pt RGBA */ … … 99 102 return; 100 103 101 #if DEPTH_BITS==16 102 z0 = FloatToFixed(VB->Win.data[vert0][2]); 103 z1 = FloatToFixed(VB->Win.data[vert1][2]); 104 #else 105 z0 = (int) VB->Win.data[vert0][2]; 106 z1 = (int) VB->Win.data[vert1][2]; 107 #endif 104 if (depthBits <= 16) { 105 z0 = FloatToFixed(VB->Win.data[vert0][2]); 106 z1 = FloatToFixed(VB->Win.data[vert1][2]); 107 } 108 else { 109 z0 = (int) VB->Win.data[vert0][2]; 110 z1 = (int) VB->Win.data[vert1][2]; 111 } 108 112 109 113 #if INTERP_STUV0 … … 195 199 GLint x = x0; 196 200 GLfloat y = VB->Win.data[vert0][1]; 197 GLfloat yStep = (VB->Win.data[vert1][1] - y) / (GLfloat) dx; 198 GLint dz = (z1 - z0) / dx; 199 GLfloat invDx = 1.0F / dx; 200 (void) invDx; 201 const GLfloat invDx = 1.0F / dx; 202 GLfloat yStep = (VB->Win.data[vert1][1] - y) * invDx; 203 GLint dz = (GLint) ((z1 - z0) * invDx); 201 204 #if INTERP_RGBA 202 205 if (ctx->Light.ShadeModel == GL_SMOOTH) { … … 226 229 dhv1 *= invDx; 227 230 #endif 231 #if INTERP_INDEX 232 if (ctx->Light.ShadeModel == GL_SMOOTH) { 233 dfi = (IntToFixed(VB->IndexPtr->data[vert1]) - fi) * invDx; 234 } 235 #endif 236 228 237 for (i = 0; i < dx; i++) { 229 238 if (solid || (ctx->Line.StipplePattern & (1 << ((ctx->StippleCounter/ctx->Line.StippleFactor) & 0xf)))) { … … 250 259 GLuint coverage; 251 260 #endif 252 #if DEPTH_BITS==16 253 GLdepth z = FixedToInt(z0); 254 #else 255 GLdepth z = z0; 256 #endif 261 GLdepth z = FixedToDepth(z0); 257 262 ASSERT(yBoti <= yTopi); 258 263 … … 345 350 GLint y = y0; 346 351 GLfloat x = VB->Win.data[vert0][0]; 347 GLfloat xStep = (VB->Win.data[vert1][0] - x) / (GLfloat) dy; 348 GLint dz = (z1 - z0) / dy; 349 GLfloat invDy = 1.0F / dy; 350 (void) invDy; 352 const GLfloat invDy = 1.0F / dy; 353 GLfloat xStep = (VB->Win.data[vert1][0] - x) * invDy; 354 GLint dz = (GLint) ((z1 - z0) * invDy); 351 355 #if INTERP_RGBA 352 356 if (ctx->Light.ShadeModel == GL_SMOOTH) { … … 378 382 #if INTERP_INDEX 379 383 if (ctx->Light.ShadeModel == GL_SMOOTH) { 380 dfi = (IntToFixed(VB->IndexPtr->data[vert1]) - fi) / dy;384 dfi = (IntToFixed(VB->IndexPtr->data[vert1]) - fi) * invDy; 381 385 } 382 386 #endif … … 404 408 GLuint coverage; 405 409 #endif 406 #if DEPTH_BITS==16 407 GLdepth z = FixedToInt(z0); 408 #else 409 GLdepth z = z0; 410 #endif 410 GLdepth z = FixedToDepth(z0); 411 411 412 412 ASSERT(xLefti < xRight);
Note:
See TracChangeset
for help on using the changeset viewer.