diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2002-01-08 14:55:48 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2002-01-08 14:55:48 +0000 |
commit | fe1d24754e9ef91199fdd8ac104441bbc72a9c68 (patch) | |
tree | dbe9307ac8a5ec9cb824735221223afcca7ef939 | |
parent | 07269ec37dc973c7af30162331b69972c504ff00 (diff) |
work-around for QNX compiler problem
-rw-r--r-- | src/mesa/main/stencil.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c index 02e805c38c..0d05577fad 100644 --- a/src/mesa/main/stencil.c +++ b/src/mesa/main/stencil.c @@ -1,4 +1,4 @@ -/* $Id: stencil.c,v 1.16.4.4 2001/05/17 20:19:00 brianp Exp $ */ +/* $Id: stencil.c,v 1.16.4.5 2002/01/08 14:55:48 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1181,6 +1181,8 @@ void _mesa_write_stencil_span( GLcontext *ctx, GLint n, GLint x, GLint y, const GLstencil stencil[] ) { + const GLstencil *ssrc = stencil; + if (y < 0 || y >= ctx->DrawBuffer->Height || x + n <= 0 || x >= ctx->DrawBuffer->Width) { /* span is completely outside framebuffer */ @@ -1191,7 +1193,7 @@ _mesa_write_stencil_span( GLcontext *ctx, GLint n, GLint x, GLint y, GLint dx = -x; x = 0; n -= dx; - stencil += dx; + ssrc += dx; } if (x + n > ctx->DrawBuffer->Width) { GLint dx = x + n - ctx->DrawBuffer->Width; @@ -1202,16 +1204,16 @@ _mesa_write_stencil_span( GLcontext *ctx, GLint n, GLint x, GLint y, } if (ctx->Driver.WriteStencilSpan) { - (*ctx->Driver.WriteStencilSpan)( ctx, n, x, y, stencil, NULL ); + (*ctx->Driver.WriteStencilSpan)( ctx, n, x, y, ssrc, NULL ); } else if (ctx->DrawBuffer->Stencil) { GLstencil *s = STENCIL_ADDRESS( x, y ); #if STENCIL_BITS == 8 - MEMCPY( s, stencil, n * sizeof(GLstencil) ); + MEMCPY( s, ssrc, n * sizeof(GLstencil) ); #else GLuint i; for (i=0;i<n;i++) - s[i] = stencil[i]; + s[i] = ssrc[i]; #endif } } |