wok annotate xbattle/stuff/pseudo_color.u @ rev 15195

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