Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: crashes




|  but even if you have pseudo color, if you have enough space in the
| colormap, it is probably preferable to use the public colormap
| (crossfire only uses about 30-40 colors in XPM mode.)
| 
Why not do it the proper -- user frendly way...

Allocate colors as you have, when you run out THEN call
XCopyColormapAndFree()  to allocate a seperate color map from the
default and continue where you left off.

This way you will use the default color map if you can but
will switch to a private colormap if nessary...

>From the Orielly's Xlib book  ( X Windows R4/R5, Vol 1, page 243 )

XCopyColormapAndFree()
  Moves all of the client's existing colormap entries to a new colormap
  and frees those entries of the old colormap. This is used when colorcell
  allocation fails and some cells have already been allocated. It saves
  needing to create a colormap and start from the beginning allocating
  colors. For applications with special color needs that can't make do,
  they can call XCopyColormapAndFree(), set thier colormap window
  attribute, and continue allocating colors in the new colormap where they
  left off.


  Anthony Thyssen ( System Programmer )   http://www.cit.gu.edu.au/~anthony/
-------------------------------------------------------------------------------
   East takes you out.  Out takes you west.  West takes you in.
   In takes you east.  North and south brings you back.
             - Litany of Orbital Mechanics --- Larry Niven -- "Intergral Trees"
-------------------------------------------------------------------------------