wok-current view xbattle/stuff/pseudo_color.u @ rev 20638

updated libcurl (7.60.0 -> 7.61.1)
author Hans-G?nter Theisgen
date Thu Jan 10 14:28:38 2019 +0100 (2019-01-10)
parents
children
line source
1 --- window.c
2 +++ window.c
3 @@ -708,8 +708,7 @@
4 unsigned long valuemask;
5 XSetWindowAttributes attrib;
6 XVisualInfo vinfo;
7 - long event_mask,
8 - full_depth;
9 + long event_mask;
10 Atom wm_delete_window;
12 /** Open display and screen **/
13 @@ -742,36 +741,11 @@
14 /** Set bitplane depth to default **/
16 xwindow->depth = DefaultDepth (xwindow->display, xwindow->screen);
17 - full_depth = xwindow->depth;
19 /** Get a visual **/
21 visual = DefaultVisual (xwindow->display, xwindow->screen);
23 - /** Try to force the display to 8 planes **/
24 -
25 - if (xwindow->depth != 8)
26 - {
27 - if (XMatchVisualInfo
28 - (xwindow->display, xwindow->screen, 8, PseudoColor, &vinfo))
29 - {
30 - visual = vinfo.visual;
31 - xwindow->depth = 8;
32 - }
33 - }
34 -
35 - /** If couldn't find an 8 bit visual, try a 16 bit visual **/
36 -
37 - if (xwindow->depth != 8)
38 - {
39 - if (XMatchVisualInfo
40 - (xwindow->display, xwindow->screen, 16, PseudoColor, &vinfo))
41 - {
42 - visual = vinfo.visual;
43 - xwindow->depth = 16;
44 - }
45 - }
46 -
47 /** If have less than 8 planes, just use a single plane **/
49 if (xwindow->depth < 8)
50 @@ -790,20 +764,8 @@
51 #else
52 /** Allocate existing colormap **/
54 - if (full_depth > 8)
55 + if (xwindow->depth > 8)
56 {
57 - /** XBattle won't work for 24 bit displays with no optional **/
58 - /** visuals with 8 or 16 bits. This may be the case on some PCs. **/
59 - /** In these cases, it may be possible to reconfigure the display **/
60 - /** to 8 or 16 bits. **/
61 -
62 - if (xwindow->depth > 16)
63 - {
64 - throw_warning ("No PseudoColor visual available\n%s",
65 - " Try changing display to <= 16 bits");
66 - throw_error ("Unable to continue without colormap", NULL);
67 - }
68 -
69 /** If display is 24 bit, have to create a dedicated colormap **/
71 xwindow->cmap = XCreateColormap (xwindow->display,