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

Re: Pixmap update.




 The XPM files take up about twice as much space as the bitmap files.
Phil's value for space is not quite correct.  This is because the XPM
files is stored as a character array.  With about 96 printable characters,
the size will not increase dramatically until you go beyond that (at
which point it will use 2 characters/pixel, doubling the size.)  There
is about 40 characters added for each color.

 The main difference is that since the bitmaps can be stored in binary
form (ie, the crossfire.cfb file), and this is pretty much the most
compressed form pixmaps can have, a large space difference is created there.

 The crossfire.cfb file is about 130K.  The crossfire.pix file is about 1.45
M.  This is because the crossfire.cfb file is in binary format (ie,
0xff type thing that is used for bitmaps can be turned into 1 byte when
stored (about a 4 times reduction), where as nothing can really done
(be done) with the pixmaps to do the same thing..

 By storing the bitmaps in binary form, it also makes their creation faster,
as they are now in the form needed when using the XCreateBitmapFromData.
All the XPM creation routines expect the pixmap to be in the text
format (there are functions to go from pixmap to ximage, but that doesn't
do much good.)

 I changed the program so that only the top object and the floor is
drawn (floor first, of course).  I added another field to the mapstruct
to contain the floors (I am assuming that floors can not change (or
at least they should not).  Is there a case where this is false?

 Performance is reasonable.  It is not that much slower on my sun 3/60,
so on a fast machine, speed difference should be very minor.

 The main slow portion right now is loading all the pixmaps.  Even with
all of them in one file, it still takes about 1 minute.  I am testing
to see if having them in a .c file that is compiled is any faster.  This
is a tradeoff of load time vs. memory consumption.  But the data would
likely be swapped out shortly after load in any case.

 It would be nice if an option like -noanimations could be given.  In
this way, for those with slow machines or who do want animations do not
need to see them.

 I'll probably ship off the patches for the color pixmaps sometime in the
next week or two to Frank.  They are pretty extensive, because many files
needed to be changed.

   Mark Wedel
master@rahul.net