X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fgfxloader.c;h=c84a3cd711a00b8dd5176894fe907decbeb88cfd;hp=d0bd1cbae59fb299998e9b8c26c3c456344590fd;hb=cf5b3a1e9077e88eb40ce2fb59e985a0ae037c84;hpb=b7d31643c9c84104fb3ebef778e545928610ff65 diff --git a/src/gfxloader.c b/src/gfxloader.c index d0bd1cba..c84a3cd7 100644 --- a/src/gfxloader.c +++ b/src/gfxloader.c @@ -779,10 +779,18 @@ static int ConvertXImageDepth(Display *display, XImage **image) register int dwx, dwy; byte *data; - data = (byte *)malloc(width * height); + data = (byte *)malloc(width * height * depth); old_image = *image; + + /* new_image = XCreateImage(display,visual,depth, ZPixmap,0,data,width,height,8,0); + */ + + new_image = XGetImage(display,RootWindow(display,screen), + 0,0,width,height,0xffffffff,ZPixmap); + + if (!new_image) return(GIF_NoMemory); @@ -811,13 +819,17 @@ static int ConvertXImageDepth(Display *display, XImage **image) } else /* other format change than 8 bit -> 4 bit */ { - register unsigned long pixel_value; + unsigned long pixel_value; for (dwx=0; dwx 0xff) + printf("pixel = %lx", pixel_value); + XPutPixel(new_image, dwx, dwy, pixel_value); } }