summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/x11
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2001-01-29 22:40:23 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2001-01-29 22:40:23 +0000
commit326f9ddd8ae215173de18827ffe60939961a1e3b (patch)
tree16fbef06e1f2c70a3e68632a4bbc12ecc186d723 /src/mesa/drivers/x11
parentba70e59e829b9ef0db0ce6fbf8227d3911f0e43c (diff)
fixed inverted Y coord for dithering in write_span_DITHER_5R6G5B_ximage()
Diffstat (limited to 'src/mesa/drivers/x11')
-rw-r--r--src/mesa/drivers/x11/xm_span.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mesa/drivers/x11/xm_span.c b/src/mesa/drivers/x11/xm_span.c
index 623762f205..714fcaf31e 100644
--- a/src/mesa/drivers/x11/xm_span.c
+++ b/src/mesa/drivers/x11/xm_span.c
@@ -1,10 +1,10 @@
-/* $Id: xm_span.c,v 1.6 2001/01/24 00:04:59 brianp Exp $ */
+/* $Id: xm_span.c,v 1.7 2001/01/29 22:40:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -1507,10 +1507,11 @@ static void write_span_DITHER_5R6G5B_ximage( RGBA_SPAN_ARGS )
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
register GLuint i;
register GLushort *ptr = PIXELADDR2( xmesa->xm_buffer, x, y );
+ const GLint y2 = FLIP(xmesa->xm_buffer, y);
if (mask) {
for (i=0;i<n;i++,x++) {
if (mask[i]) {
- PACK_TRUEDITHER( ptr[i], x, y, rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] );
+ PACK_TRUEDITHER( ptr[i], x, y2, rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] );
}
}
}
@@ -1522,16 +1523,16 @@ static void write_span_DITHER_5R6G5B_ximage( RGBA_SPAN_ARGS )
n -= extraPixel;
for (i = 0; i < n; i += 2, x += 2) {
GLuint p0, p1;
- PACK_TRUEDITHER( p0, x, y, rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] );
- PACK_TRUEDITHER( p1, x+1, y, rgba[i+1][RCOMP], rgba[i+1][GCOMP], rgba[i+1][BCOMP] );
+ PACK_TRUEDITHER( p0, x, y2, rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] );
+ PACK_TRUEDITHER( p1, x+1, y2, rgba[i+1][RCOMP], rgba[i+1][GCOMP], rgba[i+1][BCOMP] );
*ptr32++ = (p1 << 16) | p0;
}
if (extraPixel) {
- PACK_TRUEDITHER( ptr[n], x+n, y, rgba[n][RCOMP], rgba[n][GCOMP], rgba[n][BCOMP]);
+ PACK_TRUEDITHER( ptr[n], x+n, y2, rgba[n][RCOMP], rgba[n][GCOMP], rgba[n][BCOMP]);
}
#else
for (i = 0; i < n; i++, x++) {
- PACK_TRUEDITHER( ptr[i], x, y, rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]);
+ PACK_TRUEDITHER( ptr[i], x, y2, rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]);
}
#endif
}