diff options
author | Brian Paul <[email protected]> | 2001-01-23 23:39:36 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2001-01-23 23:39:36 +0000 |
commit | b6bcae5698df88f7730d40004ce7ce0462e97a20 (patch) | |
tree | 14c77826b5016293914eb529822e609792150964 /src/mesa/swrast/s_depth.c | |
parent | ab0c886a6c0dd38ac6168c2a239720a761e6578f (diff) |
Replaced struct gl_visual with struct __GLcontextModesRec from glcore.h.
Replace "RGBAMode" with "rgbMode", etc.
Other minor clean-ups.
Diffstat (limited to 'src/mesa/swrast/s_depth.c')
-rw-r--r-- | src/mesa/swrast/s_depth.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c index 1199f67dd88..92a5a12de1a 100644 --- a/src/mesa/swrast/s_depth.c +++ b/src/mesa/swrast/s_depth.c @@ -1,4 +1,4 @@ -/* $Id: s_depth.c,v 1.3 2000/11/13 20:02:57 keithw Exp $ */ +/* $Id: s_depth.c,v 1.4 2001/01/23 23:39:37 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -43,7 +43,7 @@ GLvoid * _mesa_zbuffer_address(GLcontext *ctx, GLint x, GLint y) { - if (ctx->Visual.DepthBits <= 16) + if (ctx->Visual.depthBits <= 16) return (GLushort *) ctx->DrawBuffer->DepthBuffer + ctx->DrawBuffer->Width * y + x; else return (GLuint *) ctx->DrawBuffer->DepthBuffer + ctx->DrawBuffer->Width * y + x; @@ -550,7 +550,7 @@ _mesa_depth_test_span( GLcontext *ctx, GLuint n, GLint x, GLint y, } else { /* software depth buffer */ - if (ctx->Visual.DepthBits <= 16) { + if (ctx->Visual.depthBits <= 16) { GLushort *zptr = (GLushort *) Z_ADDRESS16(ctx, x, y); GLuint passed = depth_test_span16(ctx, n, x, y, zptr, z, mask); return passed; @@ -1310,7 +1310,7 @@ _mesa_depth_test_pixels( GLcontext *ctx, } else { /* software depth testing */ - if (ctx->Visual.DepthBits <= 16) + if (ctx->Visual.depthBits <= 16) software_depth_test_pixels16(ctx, n, x, y, z, mask); else software_depth_test_pixels32(ctx, n, x, y, z, mask); @@ -1365,7 +1365,7 @@ _mesa_read_depth_span( GLcontext *ctx, if (ctx->DrawBuffer->DepthBuffer) { /* read from software depth buffer */ - if (ctx->Visual.DepthBits <= 16) { + if (ctx->Visual.depthBits <= 16) { const GLushort *zptr = Z_ADDRESS16( ctx, x, y ); GLuint i; for (i = 0; i < n; i++) { @@ -1405,7 +1405,7 @@ void _mesa_read_depth_span_float( GLcontext *ctx, GLint n, GLint x, GLint y, GLfloat depth[] ) { - const GLfloat scale = 1.0F / ctx->Visual.DepthMaxF; + const GLfloat scale = 1.0F / ctx->DepthMaxF; if (y < 0 || y >= ctx->DrawBuffer->Height || x + (GLint) n <= 0 || x >= ctx->DrawBuffer->Width) { @@ -1437,7 +1437,7 @@ _mesa_read_depth_span_float( GLcontext *ctx, if (ctx->DrawBuffer->DepthBuffer) { /* read from software depth buffer */ - if (ctx->Visual.DepthBits <= 16) { + if (ctx->Visual.depthBits <= 16) { const GLushort *zptr = Z_ADDRESS16( ctx, x, y ); GLuint i; for (i = 0; i < n; i++) { @@ -1494,7 +1494,7 @@ _mesa_alloc_depth_buffer( GLcontext *ctx ) } /* allocate new depth buffer, but don't initialize it */ - if (ctx->Visual.DepthBits <= 16) + if (ctx->Visual.depthBits <= 16) bytesPerValue = sizeof(GLushort); else bytesPerValue = sizeof(GLuint); @@ -1523,7 +1523,7 @@ _mesa_alloc_depth_buffer( GLcontext *ctx ) void _mesa_clear_depth_buffer( GLcontext *ctx ) { - if (ctx->Visual.DepthBits == 0 + if (ctx->Visual.depthBits == 0 || !ctx->DrawBuffer->DepthBuffer || !ctx->Depth.Mask) { /* no depth buffer, or writing to it is disabled */ @@ -1536,8 +1536,8 @@ _mesa_clear_depth_buffer( GLcontext *ctx ) if (ctx->Scissor.Enabled) { /* only clear scissor region */ - if (ctx->Visual.DepthBits <= 16) { - const GLushort clearValue = (GLushort) (ctx->Depth.Clear * ctx->Visual.DepthMax); + if (ctx->Visual.depthBits <= 16) { + const GLushort clearValue = (GLushort) (ctx->Depth.Clear * ctx->DepthMax); const GLint rows = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; const GLint width = ctx->DrawBuffer->Width; GLushort *dRow = (GLushort *) ctx->DrawBuffer->DepthBuffer @@ -1551,7 +1551,7 @@ _mesa_clear_depth_buffer( GLcontext *ctx ) } } else { - const GLuint clearValue = (GLuint) (ctx->Depth.Clear * ctx->Visual.DepthMax); + const GLuint clearValue = (GLuint) (ctx->Depth.Clear * ctx->DepthMax); const GLint rows = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; const GLint width = ctx->DrawBuffer->Width; GLuint *dRow = (GLuint *) ctx->DrawBuffer->DepthBuffer @@ -1567,8 +1567,8 @@ _mesa_clear_depth_buffer( GLcontext *ctx ) } else { /* clear whole buffer */ - if (ctx->Visual.DepthBits <= 16) { - const GLushort clearValue = (GLushort) (ctx->Depth.Clear * ctx->Visual.DepthMax); + if (ctx->Visual.depthBits <= 16) { + const GLushort clearValue = (GLushort) (ctx->Depth.Clear * ctx->DepthMax); if ((clearValue & 0xff) == (clearValue >> 8)) { if (clearValue == 0) { BZERO(ctx->DrawBuffer->DepthBuffer, @@ -1603,7 +1603,7 @@ _mesa_clear_depth_buffer( GLcontext *ctx ) } else { /* >16 bit depth buffer */ - const GLuint clearValue = (GLuint) (ctx->Depth.Clear * ctx->Visual.DepthMax); + const GLuint clearValue = (GLuint) (ctx->Depth.Clear * ctx->DepthMax); if (clearValue == 0) { BZERO(ctx->DrawBuffer->DepthBuffer, ctx->DrawBuffer->Width*ctx->DrawBuffer->Height*sizeof(GLuint)); |