wok diff xbattle/stuff/pseudo_color.u @ rev 25464

httpfs2-fuse: update bdeps
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Sep 30 09:07:42 2022 +0000 (2022-09-30)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xbattle/stuff/pseudo_color.u	Fri Sep 30 09:07:42 2022 +0000
     1.3 @@ -0,0 +1,71 @@
     1.4 +--- window.c
     1.5 ++++ window.c
     1.6 +@@ -708,8 +708,7 @@
     1.7 +   unsigned long valuemask;
     1.8 +   XSetWindowAttributes attrib;
     1.9 +   XVisualInfo vinfo;
    1.10 +-  long event_mask,
    1.11 +-       full_depth;
    1.12 ++  long event_mask;
    1.13 +   Atom wm_delete_window;
    1.14 + 
    1.15 +   /** Open display and screen **/
    1.16 +@@ -742,36 +741,11 @@
    1.17 +   /** Set bitplane depth to default **/
    1.18 + 
    1.19 +   xwindow->depth = DefaultDepth (xwindow->display, xwindow->screen);
    1.20 +-  full_depth = xwindow->depth;
    1.21 + 
    1.22 +   /** Get a visual **/
    1.23 + 
    1.24 +   visual = DefaultVisual (xwindow->display, xwindow->screen);
    1.25 + 
    1.26 +-  /** Try to force the display to 8 planes **/
    1.27 +-
    1.28 +-  if (xwindow->depth != 8)
    1.29 +-  {
    1.30 +-    if (XMatchVisualInfo
    1.31 +-		(xwindow->display, xwindow->screen, 8, PseudoColor, &vinfo))
    1.32 +-    {
    1.33 +-      visual = vinfo.visual;
    1.34 +-      xwindow->depth = 8;
    1.35 +-    }
    1.36 +-  }
    1.37 +-
    1.38 +-  /** If couldn't find an 8 bit visual, try a 16 bit visual **/
    1.39 +-
    1.40 +-  if (xwindow->depth != 8)
    1.41 +-  {
    1.42 +-    if (XMatchVisualInfo
    1.43 +-		(xwindow->display, xwindow->screen, 16, PseudoColor, &vinfo))
    1.44 +-    {
    1.45 +-      visual = vinfo.visual;
    1.46 +-      xwindow->depth = 16;
    1.47 +-    }
    1.48 +-  }
    1.49 +-
    1.50 +   /** If have less than 8 planes, just use a single plane **/
    1.51 + 
    1.52 +   if (xwindow->depth < 8)
    1.53 +@@ -790,20 +764,8 @@
    1.54 + #else
    1.55 +     /** Allocate existing colormap **/
    1.56 + 
    1.57 +-    if (full_depth > 8)
    1.58 ++    if (xwindow->depth > 8)
    1.59 +     {
    1.60 +-      /** XBattle won't work for 24 bit displays with no optional	**/
    1.61 +-      /** visuals with 8 or 16 bits.  This may be the case on some PCs.	**/
    1.62 +-      /** In these cases, it may be possible to reconfigure the display	**/
    1.63 +-      /** to 8 or 16 bits.						**/
    1.64 +-
    1.65 +-      if (xwindow->depth > 16)
    1.66 +-      {
    1.67 +-        throw_warning ("No PseudoColor visual available\n%s",
    1.68 +-		"         Try changing display to <= 16 bits");
    1.69 +-        throw_error ("Unable to continue without colormap", NULL);
    1.70 +-      }
    1.71 +-
    1.72 +       /** If display is 24 bit, have to create a dedicated colormap **/
    1.73 + 
    1.74 +       xwindow->cmap = XCreateColormap (xwindow->display,