[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-patches
Subject:    PSDRV_StretchDIBits fix
From:       Huw D M Davies <h.davies1 () physics ! ox ! ac ! uk>
Date:       1999-12-21 22:01:53
[Download RAW message or body]

Fix PSDRV_StretchDIBits for non-integer byte src widths (1 & 4bpp).
-- 
   Dr. Huw D M Davies              | Clarendon Laboratory
   h.davies1@physics.ox.ac.uk      | Parks Road
   Tel: +44 1865 272390            | Oxford OX1 3PU
   Fax: +44 1865 272400            | UK

["ps.diff" (text/plain)]

Index: graphics/psdrv/bitmap.c
===================================================================
RCS file: /home/wine/wine/graphics/psdrv/bitmap.c,v
retrieving revision 1.8
diff -u -r1.8 bitmap.c
--- graphics/psdrv/bitmap.c	1999/07/10 10:21:03	1.8
+++ graphics/psdrv/bitmap.c	1999/12/21 22:50:03
@@ -93,8 +93,8 @@
  *	PSDRV_StretchDIBits
  *
  * BUGS
- *  Doesn't work correctly if the DIB bits aren't byte aligned at the start of
- *  a line - this affects 1 and 4 bit depths.
+ *  Doesn't work correctly if xSrc isn't byte aligned - this affects 1 and 4
+ *  bit depths.
  *  Compression not implemented.
  */
 INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst,
@@ -138,10 +138,10 @@
 			       widthSrc, heightSrc);
 	ptr = bits;
 	ptr += (ySrc * widthbytes);
-	if(xSrc & 7 || widthSrc & 7)
+	if(xSrc & 7)
 	    FIXME("This won't work...\n");
         for(line = 0; line < heightSrc; line++, ptr += widthbytes)
-	    PSDRV_WriteBytes(dc, ptr + xSrc/8, widthSrc/8);
+	    PSDRV_WriteBytes(dc, ptr + xSrc/8, (widthSrc+7)/8);
 	break;
 
     case 4:
@@ -150,10 +150,10 @@
 			       widthSrc, heightSrc);
 	ptr = bits;
 	ptr += (ySrc * widthbytes);
-	if(xSrc & 1 || widthSrc & 1)
+	if(xSrc & 1)
 	    FIXME("This won't work...\n");
         for(line = 0; line < heightSrc; line++, ptr += widthbytes)
-	    PSDRV_WriteBytes(dc, ptr + xSrc/2, widthSrc/2);
+	    PSDRV_WriteBytes(dc, ptr + xSrc/2, (widthSrc+1)/2);
 	break;
 
     case 8:


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic