diff options
Diffstat (limited to 'graphics/hpscan/files/patch-ab')
-rw-r--r-- | graphics/hpscan/files/patch-ab | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/graphics/hpscan/files/patch-ab b/graphics/hpscan/files/patch-ab index 8ce8ea7b9fee..9b56b399e0be 100644 --- a/graphics/hpscan/files/patch-ab +++ b/graphics/hpscan/files/patch-ab @@ -175,58 +175,3 @@ diff -u old/colour.c colour.c + pix_best = colours[(r_best/8)*1024 + (g_best/8)*32 + (b_best/8)]; } } - -diff -u old/gui.c gui.c ---- old/gui.c Thu Jul 28 14:53:01 1994 -+++ gui.c Fri Jan 12 17:25:53 1996 -@@ -129,6 +129,7 @@ - - display = XtDisplay(shell); - screen = XtScreen(shell); -+ screendepth = DefaultDepthOfScreen(screen); - root = RootWindowOfScreen(screen); - - form = -@@ -555,21 +556,39 @@ - XImage *im; - unsigned char *newdata, *p; - int x, y; -+ int pad; - -+ switch(screendepth) -+ { -+ case 1: -+ case 8: -+ pad = 8; break; -+ case 15: -+ case 16: -+ pad = 16; break; -+ case 24: -+ case 32: -+ pad = 32; break; -+ default: -+ fprintf(stderr, "Don't know how to handle depth %d\n", screendepth); -+ return 0; -+ } -+ - if(!raw) - return 0; - - switch(raw->type) - { - case 5: /* 24 bit colour */ -- newdata = malloc(raw->width * raw->height); -+ newdata = malloc(raw->width * raw->height * (pad / 8)); - if(!newdata) - { - fprintf(stderr, "Can't malloc %d bytes\n", raw->width*raw->height); - return 0; - } -- im = XCreateImage(display, visual, 8, ZPixmap, 0, newdata, -- raw->width, raw->height, 8, raw->width); -+ im = XCreateImage(display, visual, screendepth, ZPixmap, 0, newdata, -+ raw->width, raw->height, pad, -+ raw->width * (pad/8)); - - /* Convert to fixed colour map using simple error propagation */ - |