Re: [Freeciv-Dev] Tiles graphics format (xpm)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Thu, 4 Mar 1999, Per Mathisen wrote:
> On Wed, 3 Mar 1999, Martin Willemoes Hansen wrote:
> > I was wondering why we still are using the xpm format
> > when there is better ones out there!
> >
> > If it would be posible I suggest that we move to a
> > better format when working on the 1.9.x version.
>
> I'd just like to chime in that PNG just recently became a stable standard,
> and that many systems ship broken PNG libraries. It is for this reason
> that Mozilla ships its own PNG library.
If the size of the client distribution is a concern, here it is with PNG
file instead of XPM files.
-rw-r--r-- 1 xyzzy users 844019 Mar 4 05:03 freeciv-png.tar.bz2
-rw-r--r-- 1 xyzzy users 824145 Mar 4 05:08 freeciv-xpm.tar.bz2
Once compressed, the png files are only 20k smaller. Uncompressed there is
about a 1620k difference.
3908 freeciv-png
5532 freeciv-xpm
Of course, a real PNG enable freeciv client would need lots of extra code to
read in the PNG files, so it would probably actually be larger than the XPM
version.
Reading in a PNG file is somewhat more difficult that one might thing. Using
libpng getting the file uncompressed isn't hard, but that's only one small
step. Then the images have to loading into pixmaps on the X server. Getting
that right in all possible combinations of visual types, byte orders and color
depths isn't easy. Then you have to worry about sharing the colormap with the
rest of the client. Writing all that from scratch would not be fun.
Much easier would be to use something like imlib to read in the graphics and
load them into the X server. But imlib and imagemagik and all the stuff they
need is HUGE. For people who aren't using linux where those libraries are
often part of the system, it a major pain in the ass to get it running. I bet
a lot of university students don't even have enough of a disk quota to compile
it all.
|
|