A couple of small fixes to my bitmap patch.
diff --git a/graphics/x11drv/bitmap.c b/graphics/x11drv/bitmap.c index 128a32e..6c46061 100644 --- a/graphics/x11drv/bitmap.c +++ b/graphics/x11drv/bitmap.c
@@ -28,11 +28,6 @@ GC BITMAP_monoGC = 0, BITMAP_colorGC = 0; -#define BITMAP_WIDTH_BYTES(width,bpp) \ - (((bpp) == 24) ? (width) * 4 : ( ((bpp) == 15) ? (width) * 2 : \ - ((width) * (bpp) + 15) / 16 * 2 )) - - /*********************************************************************** * X11DRV_BITMAP_Init */ @@ -371,6 +366,8 @@ XImage *image; LPBYTE sbuf, tmpbuffer; int w, h, pad, widthbytes; + + TRACE(x11drv, "(bmp=%p, bits=%p, count=%lx)\n", bmp, bits, count); pad = BITMAP_GetBitsPadding(bmp->bitmap.bmWidth, bmp->bitmap.bmBitsPixel); @@ -381,9 +378,12 @@ widthbytes = (((bmp->bitmap.bmWidth * bmp->bitmap.bmBitsPixel) + 31) / 32) * 4; - height = bmp->bitmap.bmHeight; + height = count / bmp->bitmap.bmWidthBytes; tmpbuffer = (LPBYTE)xmalloc(widthbytes*height); + TRACE(x11drv, "h=%ld, w=%d, wb=%d\n", height, bmp->bitmap.bmWidth, + widthbytes); + EnterCriticalSection( &X11DRV_CritSection ); image = XCreateImage( display, DefaultVisualOfScreen(screen), bmp->bitmap.bmBitsPixel, ZPixmap, 0, tmpbuffer,