# HG changeset patch # User Pascal Bellard # Date 1356524179 -3600 # Node ID b62c4bce1f6faca95dc70369f67013821f59f645 # Parent 1e2ad144e0dbfc52fe00bfacd11077ea4c96e369 xbattle: add 24bits colors patch diff -r 1e2ad144e0db -r b62c4bce1f6f xbattle/receipt --- a/xbattle/receipt Wed Dec 26 11:05:26 2012 +0100 +++ b/xbattle/receipt Wed Dec 26 13:16:19 2012 +0100 @@ -16,6 +16,7 @@ compile_rules() { cd $src + patch -p0 < $stuff/pseudo_color.u xmkmf make && make DESTDIR=$DESTDIR install } @@ -24,4 +25,5 @@ genpkg_rules() { cp -a $install/usr $fs + cp -a $stuff/*/ $fs } diff -r 1e2ad144e0db -r b62c4bce1f6f xbattle/stuff/pseudo_color.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xbattle/stuff/pseudo_color.u Wed Dec 26 13:16:19 2012 +0100 @@ -0,0 +1,71 @@ +--- window.c ++++ window.c +@@ -708,8 +708,7 @@ + unsigned long valuemask; + XSetWindowAttributes attrib; + XVisualInfo vinfo; +- long event_mask, +- full_depth; ++ long event_mask; + Atom wm_delete_window; + + /** Open display and screen **/ +@@ -742,36 +741,11 @@ + /** Set bitplane depth to default **/ + + xwindow->depth = DefaultDepth (xwindow->display, xwindow->screen); +- full_depth = xwindow->depth; + + /** Get a visual **/ + + visual = DefaultVisual (xwindow->display, xwindow->screen); + +- /** Try to force the display to 8 planes **/ +- +- if (xwindow->depth != 8) +- { +- if (XMatchVisualInfo +- (xwindow->display, xwindow->screen, 8, PseudoColor, &vinfo)) +- { +- visual = vinfo.visual; +- xwindow->depth = 8; +- } +- } +- +- /** If couldn't find an 8 bit visual, try a 16 bit visual **/ +- +- if (xwindow->depth != 8) +- { +- if (XMatchVisualInfo +- (xwindow->display, xwindow->screen, 16, PseudoColor, &vinfo)) +- { +- visual = vinfo.visual; +- xwindow->depth = 16; +- } +- } +- + /** If have less than 8 planes, just use a single plane **/ + + if (xwindow->depth < 8) +@@ -790,20 +764,8 @@ + #else + /** Allocate existing colormap **/ + +- if (full_depth > 8) ++ if (xwindow->depth > 8) + { +- /** XBattle won't work for 24 bit displays with no optional **/ +- /** visuals with 8 or 16 bits. This may be the case on some PCs. **/ +- /** In these cases, it may be possible to reconfigure the display **/ +- /** to 8 or 16 bits. **/ +- +- if (xwindow->depth > 16) +- { +- throw_warning ("No PseudoColor visual available\n%s", +- " Try changing display to <= 16 bits"); +- throw_error ("Unable to continue without colormap", NULL); +- } +- + /** If display is 24 bit, have to create a dedicated colormap **/ + + xwindow->cmap = XCreateColormap (xwindow->display, diff -r 1e2ad144e0db -r b62c4bce1f6f xbattle/stuff/usr/share/applications/xbattle.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xbattle/stuff/usr/share/applications/xbattle.desktop Wed Dec 26 13:16:19 2012 +0100 @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Encoding=UTF-8 +Name=Xbattle +Exec=xbattle -black me -white unix -armies 4 -bases 2 -towns 2 -militia 2 -hills 7 +Terminal=false +Categories=Application;Game; +Comment=Concurrent multi-player battle strategy game