fixed stride problem in read_R5G6B5_span
authorBrian Paul <brian.paul@tungstengraphics.com>
Tue, 11 Apr 2000 03:06:07 +0000 (03:06 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Tue, 11 Apr 2000 03:06:07 +0000 (03:06 +0000)
src/mesa/drivers/glide/fxddspan.c

index 8939b1eea6ffd5c450264d8a10e7ad6e57460a0b..c6fcb2ea2e5db7c75ca37c3fe4ba94a0b4dcc475 100644 (file)
@@ -370,10 +370,14 @@ static void read_R5G6B5_span(const GLcontext *ctx,
                 &info)) {
     const GLint winX = fxMesa->x_offset;
     const GLint winY = fxMesa->y_offset + fxMesa->height - 1;
-    const GLint dstStride = (fxMesa->glCtx->Color.DrawBuffer == GL_FRONT)
+#ifdef XF86DRI
+    const GLint srcStride = (fxMesa->glCtx->Color.DrawBuffer == GL_FRONT)
                           ? (fxMesa->screen_width) : (info.strideInBytes / 2);
+#else
+    const GLint srcStride = info.strideInBytes / 2; /* stride in GLushorts */
+#endif
     const GLushort *data16 = (const GLushort *) info.lfbPtr
-                           + (winY - y) * dstStride
+                           + (winY - y) * srcStride
                            + (winX + x);
     const GLuint *data32 = (const GLuint *) data16;
     GLuint i, j;