fixed Voodoo1/2/ stride problem in fxDDReadPixels()
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 31 Mar 2000 05:49:08 +0000 (05:49 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Fri, 31 Mar 2000 05:49:08 +0000 (05:49 +0000)
src/mesa/drivers/glide/fxdd.c

index bd571d415c3a0b3fd38b94b3554e3032d5ace10e..01e70951418524672ff9416559a0ca5705501be9 100644 (file)
@@ -543,8 +543,12 @@ static GLboolean fxDDReadPixels( GLcontext *ctx, GLint x, GLint y,
                   &info)) {
       const GLint winX = fxMesa->x_offset;
       const GLint winY = fxMesa->y_offset + fxMesa->height - 1;
+#ifdef XF86DRI
       const GLint srcStride = (fxMesa->glCtx->Color.DrawBuffer == GL_FRONT)
-                            ? (fxMesa->screen_width) : (info.strideInBytes / 2);
+                          ? (fxMesa->screen_width) : (info.strideInBytes / 2);
+#else
+      const GLint srcStride = info.strideInBytes / 2; /* stride in GLushorts */
+#endif
       const GLushort *src = (const GLushort *) info.lfbPtr
                           + (winY - y) * srcStride + (winX + x);
       GLubyte *dst = (GLubyte *) _mesa_image_address(packing, dstImage,