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

Pixmaps.




 I've done some work into implementing them.  In fact, it is largely
completed.

 As of right now, the pixmap files are stored as the same name as
the bitmap files, with a ".pix" added to the end.  I believe this will
lenghten the names beyond some limit that was set for portability reasons,
but this naming convention made it easy to write a script to convert
the bitmaps to pixmaps.

 This also allows me to use the bmaps.paths file to load the pixmaps
(at present time, they are loaded one by one, so that editing of the individual
pixmaps is easier - don't need to re-build the data file.)  This is
pretty slow, however.  But there is nothing really preventing the
speedup putting the raw data in a file like is done for bitmaps to speed
things up.

 I added the command line option "-ci" to use color pixmaps (color
images).  What would be better would be if the present option -pixmaps
was called -bitmaps instead (which is probably more accurate), and then
color pixmaps could be called -pixmaps.

 A couple variables were added to determine if color pixmaps are being
used.

 I have not really checked performance of pixmaps vs bitmaps.  However,
there should be very little loss if you decided not to use pixmaps
and use bitmaps (just an if statement - added to the draw_face macro
in global.h)

 I looked over teh xpm library docs, and there are some nice things
supported.  For any pixmap, you have what colors each pixel is.  You then
have what grey those would be on a grayscale system, and whether it would
be black or white on a monochrome system.  In this way, color pixmaps
could be used on any display system, and not look any different than the
bitmaps already in place.

 Symbolic colors are also supported, which can then be changed by the
program.  This would add in support for coloring the pixmaps the same
color as bitmaps are colored right now.

 The problem I see with this is that if peopel do go and re-color the
pixmaps, then there might be several symbolic colors that need to be
changed for different objects.  This could be a really pain to implement. So
I think the best solution would be for different objects using the same
face to have multiple faces around, if those faces need to be colored
differently.

 Pixmaps also support shape masks, which are returned upon creation of
the actual Pixmap for the program use.  I have yet to implement this
feature.

 All in all, I think using pixmaps gains a lot, but loses nothing.

 As for space, right now the 2 color pixmaps take about twice the space
as the bitmaps.  If space (for distribution) is a problem, the pixmaps
could be a separate file one gets when ftp'ing (like the maps).   Optionally,
the bitmaps could be derived from the pixmaps.

 Also, before I finish this message, I am using the xpm library.  So you
could get a copy yourself (available on most sites that have the X
contrib directory) and look over the docs.

 --Mark