summaryrefslogtreecommitdiff
path: root/x11/xearth
diff options
context:
space:
mode:
authortron <tron@pkgsrc.org>1999-05-27 07:40:29 +0000
committertron <tron@pkgsrc.org>1999-05-27 07:40:29 +0000
commit772f4d3b50345839793897489bc819ab9e6c233b (patch)
tree4d8c73ab18a9aaeabf8fb663f9190636f68fc37c /x11/xearth
parentb6f0b0412d03194f38049b30eebef5db7252fba3 (diff)
downloadpkgsrc-772f4d3b50345839793897489bc819ab9e6c233b.tar.gz
Rework patch so that 32BPP displays still work.
XXX 24BPP display need to be tested again.
Diffstat (limited to 'x11/xearth')
-rw-r--r--x11/xearth/patches/patch-aa111
1 files changed, 54 insertions, 57 deletions
diff --git a/x11/xearth/patches/patch-aa b/x11/xearth/patches/patch-aa
index a89a2b01b5f..8798ae8e452 100644
--- a/x11/xearth/patches/patch-aa
+++ b/x11/xearth/patches/patch-aa
@@ -1,18 +1,21 @@
-$NetBSD: patch-aa,v 1.2 1999/05/26 23:11:41 tron Exp $
+$NetBSD: patch-aa,v 1.3 1999/05/27 07:40:29 tron Exp $
---- x11.c.orig Tue Nov 11 09:14:40 1997
-+++ x11.c Tue Nov 11 09:23:59 1997
-@@ -62,6 +62,9 @@
- #define MONO_32 (5)
- #define COLOR_32 (6)
+--- x11.c.orig Mon Sep 25 02:12:44 1995
++++ x11.c Thu May 27 09:36:30 1999
+@@ -59,8 +59,10 @@
+ #define COLOR_8 (2)
+ #define MONO_16 (3)
+ #define COLOR_16 (4)
+-#define MONO_32 (5)
+-#define COLOR_32 (6)
++#define MONO_24 (5)
++#define COLOR_24 (6)
++#define MONO_32 (7)
++#define COLOR_32 (8)
-+#define MONO_24 (7)
-+#define COLOR_24 (9)
-+
#define LABEL_LEFT_FLUSH (1<<0)
#define LABEL_TOP_FLUSH (1<<1)
-
-@@ -76,6 +79,7 @@
+@@ -76,6 +78,7 @@
static void pack_mono_1 _P((u16or32 *, u_char *));
static void pack_8 _P((u16or32 *, Pixel *, u_char *));
static void pack_16 _P((u16or32 *, Pixel *, u_char *));
@@ -20,50 +23,47 @@ $NetBSD: patch-aa,v 1.2 1999/05/26 23:11:41 tron Exp $
static void pack_32 _P((u16or32 *, Pixel *, u_char *));
static void x11_row _P((u_char *));
static void x11_cleanup _P((void));
-@@ -358,6 +362,11 @@
+@@ -715,16 +718,29 @@
+ xbuf_size);
- case 24:
- /* try to pack ximage data 32 bits/pixel */
-+ x_type = mono ? MONO_24 : COLOR_24;
-+ break;
+ if (xim->bits_per_pixel != bits_per_pixel)
+- {
+- fflush(stdout);
+- fprintf(stderr,
+- "xearth %s: fatal - unexpected bits/pixel for depth %d\n",
+- VersionString, dpth);
+- fprintf(stderr,
+- " (expected %d bits/pixel, actual value is %d)\n",
+- bits_per_pixel, xim->bits_per_pixel);
+- exit(1);
+- }
++ if ((xim->bits_per_pixel == 24) && (bits_per_pixel == 32))
++ {
++ x_type = mono ? MONO_24 : COLOR_24;
+
-+ case 32:
-+ /* try to pack ximage data 32 bits/pixel */
- x_type = mono ? MONO_32 : COLOR_32;
- break;
-
-@@ -376,6 +385,7 @@
- case MONO_1:
- case MONO_8:
- case MONO_16:
-+ case MONO_24:
- case MONO_32:
- mono_dither_setup();
- pels = (Pixel *) malloc((unsigned) sizeof(Pixel) * 2);
-@@ -386,6 +396,7 @@
-
- case COLOR_8:
- case COLOR_16:
-+ case COLOR_24:
- case COLOR_32:
- if (XAllocNamedColor(dsply, cmap, "red", &xc, &junk) != 0)
- hlight = xc.pixel;
-@@ -689,6 +700,14 @@
- bits_per_pixel = 16;
- break;
-
-+ /* added this. -wsr */
-+ case MONO_24:
-+ case COLOR_24:
-+ dith_size = wdth;
-+ xbuf_size = dith_size * 3;
-+ bits_per_pixel = 24;
-+ break;
++ xbuf_size = dith_size * 3;
++ bits_per_pixel = 24;
+
- case MONO_32:
- case COLOR_32:
- dith_size = wdth;
-@@ -817,6 +836,43 @@
++ XDestroyImage(xim);
++ xim = XCreateImage(dsply, visl, (unsigned) dpth, ZPixmap, 0,
++ (char *) xbuf, (unsigned) wdth, 1, 8,
++ xbuf_size);
++ }
++ else
++ {
++ fflush(stdout);
++ fprintf(stderr,
++ "xearth %s: fatal - unexpected bits/pixel for depth %d\n",
++ VersionString, dpth);
++ fprintf(stderr,
++ " (expected %d bits/pixel, actual value is %d)\n",
++ bits_per_pixel, xim->bits_per_pixel);
++ exit(1);
++ }
+
+ if (x_type == MONO_1)
+ {
+@@ -817,6 +833,43 @@
}
@@ -107,7 +107,7 @@ $NetBSD: patch-aa,v 1.2 1999/05/26 23:11:41 tron Exp $
/* pack pixels into ximage format (assuming bits_per_pixel == 32)
*/
static void pack_32(src, map, dst)
-@@ -876,6 +932,11 @@
+@@ -876,6 +929,11 @@
pack_16(dith, pels, xbuf);
break;
@@ -119,7 +119,7 @@ $NetBSD: patch-aa,v 1.2 1999/05/26 23:11:41 tron Exp $
case MONO_32:
mono_dither_row(row, dith);
pack_32(dith, pels, xbuf);
-@@ -889,6 +950,11 @@
+@@ -889,6 +947,11 @@
case COLOR_16:
dither_row(row, dith);
pack_16(dith, pels, xbuf);
@@ -131,6 +131,3 @@ $NetBSD: patch-aa,v 1.2 1999/05/26 23:11:41 tron Exp $
break;
case COLOR_32:
-
-
-