-/* $Id: s_context.c,v 1.29 2002/02/02 21:40:33 brianp Exp $ */
+/* $Id: s_context.c,v 1.30 2002/04/19 00:38:27 brianp Exp $ */
/*
* Mesa 3-D graphics library
RasterMask |= ALPHABUF_BIT;
if ( ctx->Viewport.X < 0
- || ctx->Viewport.X + ctx->Viewport.Width > ctx->DrawBuffer->Width
+ || ctx->Viewport.X + ctx->Viewport.Width > (GLint) ctx->DrawBuffer->Width
|| ctx->Viewport.Y < 0
- || ctx->Viewport.Y + ctx->Viewport.Height > ctx->DrawBuffer->Height) {
+ || ctx->Viewport.Y + ctx->Viewport.Height > (GLint) ctx->DrawBuffer->Height) {
RasterMask |= CLIP_BIT;
}
-/* $Id: s_copypix.c,v 1.35 2002/04/12 15:39:59 brianp Exp $ */
+/* $Id: s_copypix.c,v 1.36 2002/04/19 00:38:27 brianp Exp $ */
/*
* Mesa 3-D graphics library
if (SWRAST_CONTEXT(ctx)->_RasterMask == 0
&& !zoom
&& destx >= 0
- && destx + width <= ctx->DrawBuffer->Width) {
+ && destx + width <= (GLint) ctx->DrawBuffer->Width) {
quick_draw = GL_TRUE;
}
else {
/* write row to framebuffer */
dy = desty + row;
- if (quick_draw && dy >= 0 && dy < ctx->DrawBuffer->Height) {
+ if (quick_draw && dy >= 0 && dy < (GLint) ctx->DrawBuffer->Height) {
(*swrast->Driver.WriteRGBASpan)( ctx, width, destx, dy,
(const GLchan (*)[4])span.color.rgba, NULL );
}
if (SWRAST_CONTEXT(ctx)->_RasterMask == 0
&& !zoom
&& destx >= 0
- && destx + width <= ctx->DrawBuffer->Width) {
+ && destx + width <= (GLint) ctx->DrawBuffer->Width) {
quick_draw = GL_TRUE;
}
else {
_swrast_pixel_texture(ctx, &span);
}
- if (quick_draw && dy >= 0 && dy < ctx->DrawBuffer->Height) {
+ if (quick_draw && dy >= 0 && dy < (GLint) ctx->DrawBuffer->Height) {
(*swrast->Driver.WriteRGBASpan)( ctx, width, destx, dy,
(const GLchan (*)[4])span.color.rgba, NULL );
}
-/* $Id: s_depth.c,v 1.21 2002/04/18 14:57:00 brianp Exp $ */
+/* $Id: s_depth.c,v 1.22 2002/04/19 00:38:27 brianp Exp $ */
/*
* Mesa 3-D graphics library
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- if (y < 0 || y >= ctx->DrawBuffer->Height ||
- x + (GLint) n <= 0 || x >= ctx->DrawBuffer->Width) {
+ if (y < 0 || y >= (GLint) ctx->DrawBuffer->Height ||
+ x + (GLint) n <= 0 || x >= (GLint) ctx->DrawBuffer->Width) {
/* span is completely outside framebuffer */
GLint i;
for (i = 0; i < n; i++)
n -= dx;
depth += dx;
}
- if (x + n > ctx->DrawBuffer->Width) {
- GLint dx = x + n - ctx->DrawBuffer->Width;
+ if (x + n > (GLint) ctx->DrawBuffer->Width) {
+ GLint dx = x + n - (GLint) ctx->DrawBuffer->Width;
GLint i;
for (i = 0; i < dx; i++)
depth[n - i - 1] = 0;
SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLfloat scale = 1.0F / ctx->DepthMaxF;
- if (y < 0 || y >= ctx->DrawBuffer->Height ||
- x + (GLint) n <= 0 || x >= ctx->DrawBuffer->Width) {
+ if (y < 0 || y >= (GLint) ctx->DrawBuffer->Height ||
+ x + (GLint) n <= 0 || x >= (GLint) ctx->DrawBuffer->Width) {
/* span is completely outside framebuffer */
GLint i;
for (i = 0; i < n; i++)
n -= dx;
x = 0;
}
- if (x + n > ctx->DrawBuffer->Width) {
- GLint dx = x + n - ctx->DrawBuffer->Width;
+ if (x + n > (GLint) ctx->DrawBuffer->Width) {
+ GLint dx = x + n - (GLint) ctx->DrawBuffer->Width;
GLint i;
for (i = 0; i < dx; i++)
depth[n - i - 1] = 0.0F;
-/* $Id: s_lines.c,v 1.27 2002/04/12 15:39:59 brianp Exp $ */
+/* $Id: s_lines.c,v 1.28 2002/04/19 00:38:27 brianp Exp $ */
/*
* Mesa 3-D graphics library
start = width / 2 - 1;
if (xMajor) {
- GLuint i, w;
+ GLuint i;
+ GLint w;
for (w = 0; w < width; w++) {
if (w == 0) {
for (i = 0; i < span->end; i++)
}
}
else {
- GLuint i, w;
+ GLuint i;
+ GLint w;
for (w = 0; w < width; w++) {
if (w == 0) {
for (i = 0; i < span->end; i++)
-/* $Id: s_readpix.c,v 1.13 2002/01/12 16:12:52 brianp Exp $ */
+/* $Id: s_readpix.c,v 1.14 2002/04/19 00:38:27 brianp Exp $ */
/*
* Mesa 3-D graphics library
readWidth += srcX;
srcX = 0;
}
- if (srcX + readWidth > ctx->ReadBuffer->Width)
- readWidth -= (srcX + readWidth - ctx->ReadBuffer->Width);
+ if (srcX + readWidth > (GLint) ctx->ReadBuffer->Width)
+ readWidth -= (srcX + readWidth - (GLint) ctx->ReadBuffer->Width);
if (readWidth <= 0)
return GL_TRUE;
readHeight += srcY;
srcY = 0;
}
- if (srcY + readHeight > ctx->ReadBuffer->Height)
- readHeight -= (srcY + readHeight - ctx->ReadBuffer->Height);
+ if (srcY + readHeight > (GLint) ctx->ReadBuffer->Height)
+ readHeight -= (srcY + readHeight - (GLint) ctx->ReadBuffer->Height);
if (readHeight <= 0)
return GL_TRUE;
-/* $Id: s_span.c,v 1.38 2002/04/12 15:39:59 brianp Exp $ */
+/* $Id: s_span.c,v 1.39 2002/04/19 00:38:27 brianp Exp $ */
/*
* Mesa 3-D graphics library
#ifdef DEBUG
if (span->arrayMask & SPAN_XY) {
- int i;
+ GLuint i;
for (i = 0; i < span->end; i++) {
if (span->mask[i]) {
assert(span->xArray[i] >= ctx->DrawBuffer->_Xmin);
#ifdef DEBUG
if (span->arrayMask & SPAN_XY) {
- int i;
+ GLuint i;
for (i = 0; i < span->end; i++) {
if (span->mask[i]) {
assert(span->xArray[i] >= ctx->DrawBuffer->_Xmin);
monoColor = GL_FALSE;
}
else if (ctx->Color.BlendEnabled) {
+ printf("blending\n");
_mesa_blend_span(ctx, span, span->color.rgba);
monoColor = GL_FALSE;
}
#ifdef DEBUG
if (span->arrayMask & SPAN_XY) {
- int i;
+ GLuint i;
for (i = 0; i < span->end; i++) {
if (span->mask[i]) {
assert(span->xArray[i] >= ctx->DrawBuffer->_Xmin);
GLuint n, GLint x, GLint y, GLchan rgba[][4] )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- if (y < 0 || y >= buffer->Height
- || x + (GLint) n < 0 || x >= buffer->Width) {
+ const GLint bufWidth = (GLint) buffer->Width;
+ const GLint bufHeight = (GLint) buffer->Width;
+
+ if (y < 0 || y >= bufHeight || x + (GLint) n < 0 || x >= bufWidth) {
/* completely above, below, or right */
/* XXX maybe leave undefined? */
BZERO(rgba, 4 * n * sizeof(GLchan));
/* completely left of window */
return;
}
- if (length > buffer->Width) {
- length = buffer->Width;
+ if (length > bufWidth) {
+ length = bufWidth;
}
}
- else if ((GLint) (x + n) > buffer->Width) {
+ else if ((GLint) (x + n) > bufWidth) {
/* right edge clipping */
skip = 0;
- length = buffer->Width - x;
+ length = bufWidth - x;
if (length < 0) {
/* completely to right of window */
return;
GLuint n, GLint x, GLint y, GLuint indx[] )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- if (y < 0 || y >= buffer->Height
- || x + (GLint) n < 0 || x >= buffer->Width) {
+ const GLint bufWidth = (GLint) buffer->Width;
+ const GLint bufHeight = (GLint) buffer->Width;
+
+ if (y < 0 || y >= bufHeight || x + (GLint) n < 0 || x >= bufWidth) {
/* completely above, below, or right */
BZERO(indx, n * sizeof(GLuint));
}
/* completely left of window */
return;
}
- if (length > buffer->Width) {
- length = buffer->Width;
+ if (length > bufWidth) {
+ length = bufWidth;
}
}
- else if ((GLint) (x + n) > buffer->Width) {
+ else if ((GLint) (x + n) > bufWidth) {
/* right edge clipping */
skip = 0;
- length = buffer->Width - x;
+ length = bufWidth - x;
if (length < 0) {
/* completely to right of window */
return;
-/* $Id: s_stencil.c,v 1.22 2002/03/19 16:47:05 brianp Exp $ */
+/* $Id: s_stencil.c,v 1.23 2002/04/19 00:38:27 brianp Exp $ */
/*
* Mesa 3-D graphics library
GLint n, GLint x, GLint y, GLstencil stencil[] )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- if (y < 0 || y >= ctx->DrawBuffer->Height ||
- x + n <= 0 || x >= ctx->DrawBuffer->Width) {
+ const GLint bufWidth = (GLint) ctx->DrawBuffer->Width;
+ const GLint bufHeight = (GLint) ctx->DrawBuffer->Width;
+
+ if (y < 0 || y >= bufHeight || x + n <= 0 || x >= bufWidth) {
/* span is completely outside framebuffer */
return; /* undefined values OK */
}
n -= dx;
stencil += dx;
}
- if (x + n > ctx->DrawBuffer->Width) {
- GLint dx = x + n - ctx->DrawBuffer->Width;
+ if (x + n > bufWidth) {
+ GLint dx = x + n - bufWidth;
n -= dx;
}
if (n <= 0) {
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLstencil *ssrc = stencil;
+ const GLint bufWidth = (GLint) ctx->DrawBuffer->Width;
+ const GLint bufHeight = (GLint) ctx->DrawBuffer->Width;
- if (y < 0 || y >= ctx->DrawBuffer->Height ||
- x + n <= 0 || x >= ctx->DrawBuffer->Width) {
+ if (y < 0 || y >= bufHeight || x + n <= 0 || x >= bufWidth) {
/* span is completely outside framebuffer */
return; /* undefined values OK */
}
n -= dx;
ssrc += dx;
}
- if (x + n > ctx->DrawBuffer->Width) {
- GLint dx = x + n - ctx->DrawBuffer->Width;
+ if (x + n > bufWidth) {
+ GLint dx = x + n - bufWidth;
n -= dx;
}
if (n <= 0) {
-/* $Id: s_texture.c,v 1.60 2002/04/12 21:17:28 brianp Exp $ */
+/* $Id: s_texture.c,v 1.61 2002/04/19 00:38:27 brianp Exp $ */
/*
* Mesa 3-D graphics library
result = 0;
break;
case GL_NEVER:
- result = CHAN_MAXF;
+ result = CHAN_MAX;
break;
case GL_NONE:
/* ordinary bilinear filtering */
-/* $Id: s_zoom.c,v 1.14 2002/04/12 15:39:59 brianp Exp $ */
+/* $Id: s_zoom.c,v 1.15 2002/04/19 00:38:27 brianp Exp $ */
/*
* Mesa 3-D graphics library
GLint r0, r1, row;
GLint c0, c1, skipCol;
GLint i, j;
- const GLint maxWidth = MIN2( ctx->DrawBuffer->Width, MAX_WIDTH );
+ const GLuint maxWidth = MIN2( ctx->DrawBuffer->Width, MAX_WIDTH );
GLchan rgbaSave[MAX_WIDTH][4];
GLuint indexSave[MAX_WIDTH];
struct sw_span zoomed;
*/
if (r1 < 0) /* below window */
return;
- if (r0 >= ctx->DrawBuffer->Height) /* above window */
+ if (r0 >= (GLint) ctx->DrawBuffer->Height) /* above window */
return;
if (c1 < 0) /* left of window */
return;
- if (c0 >= ctx->DrawBuffer->Width) /* right of window */
+ if (c0 >= (GLint) ctx->DrawBuffer->Width) /* right of window */
return;
/* zoom the span horizontally */
if (format == GL_RGBA) {
if (ctx->Pixel.ZoomX == -1.0F) {
/* common case */
- for (j = zoomed.start; j < zoomed.end; j++) {
+ for (j = (GLint) zoomed.start; j < (GLint) zoomed.end; j++) {
i = span->end - (j + skipCol) - 1;
COPY_CHAN4(zoomed.color.rgba[j], rgba[i]);
}
else {
/* general solution */
const GLfloat xscale = 1.0F / ctx->Pixel.ZoomX;
- for (j = zoomed.start; j < zoomed.end; j++) {
+ for (j = (GLint) zoomed.start; j < (GLint) zoomed.end; j++) {
i = (GLint) ((j + skipCol) * xscale);
if (i < 0)
i = span->end + i - 1;
else if (format == GL_RGB) {
if (ctx->Pixel.ZoomX == -1.0F) {
/* common case */
- for (j = zoomed.start; j < zoomed.end; j++) {
+ for (j = (GLint) zoomed.start; j < (GLint) zoomed.end; j++) {
i = span->end - (j + skipCol) - 1;
zoomed.color.rgba[j][0] = rgb[i][0];
zoomed.color.rgba[j][1] = rgb[i][1];
else {
/* general solution */
const GLfloat xscale = 1.0F / ctx->Pixel.ZoomX;
- for (j = zoomed.start; j < zoomed.end; j++) {
+ for (j = (GLint) zoomed.start; j < (GLint) zoomed.end; j++) {
i = (GLint) ((j + skipCol) * xscale);
if (i < 0)
i = span->end + i - 1;
else if (format == GL_COLOR_INDEX) {
if (ctx->Pixel.ZoomX == -1.0F) {
/* common case */
- for (j = zoomed.start; j < zoomed.end; j++) {
+ for (j = (GLint) zoomed.start; j < (GLint) zoomed.end; j++) {
i = span->end - (j + skipCol) - 1;
zoomed.color.index[j] = indexes[i];
}
else {
/* general solution */
const GLfloat xscale = 1.0F / ctx->Pixel.ZoomX;
- for (j = zoomed.start; j < zoomed.end; j++) {
+ for (j = (GLint) zoomed.start; j < (GLint) zoomed.end; j++) {
i = (GLint) ((j + skipCol) * xscale);
if (i < 0)
i = span->end + i - 1;
/* below window */
return;
}
- if (r0>=ctx->DrawBuffer->Height && r1>=ctx->DrawBuffer->Height) {
+ if (r0 >= (GLint) ctx->DrawBuffer->Height &&
+ r1 >= (GLint) ctx->DrawBuffer->Height) {
/* above window */
return;
}