[Freeciv-Dev] loading compressed XPM files
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Trying again, this time with the patch attached.
Compressing the XPM files using gzip reduces the size of the freeciv-1.12.0
share directory by about 75% (1.6 rather than 6.4 Mb). This patch, applied
to the gui-gtk client (client/gui-gtk/graphics.c) from the released 1.12.0,
lets the GTK client read gzipped XPM files. Apply the patch, install as
usual, then go to share/freeciv and:
gzip -9 `find . -name \*.xpm`
Ideally, the makefile would do that automagically.
The patch checks for HAVE_LIBZ ; if you don't have it, this patch only has
the effect of copying and freeing an additional string (because gdk takes a
char*, and I'm paranoid about passing const char* in where char* is
required). Obviously, if you don't have it, you also can't read
compressed xpm.
The patch hooks into the mechanism that already existed to first try one
filetype, and if it doesn't work, try another. So if there's no compressed
xpm file, we use a non-compressed one.
TODO 1: have the makefile automatically gzip the xpm files
TODO 2: extend this to work with all clients
TODO 3: extend this to have all the share files be gzipped. The marginal
benefit of that is much less, but we still save another 600 Kb.
ISSUE: should xpm.gz be before or after xpm?
-- Benoît
compress_xpm.patch
Description: Text document
- [Freeciv-Dev] loading compressed XPM files, Benoit Hudson, 2001/09/16
- [Freeciv-Dev] Re: loading compressed XPM files, Raimar Falke, 2001/09/17
- [Freeciv-Dev] Re: loading compressed XPM files, Benoit Hudson, 2001/09/17
- [Freeciv-Dev] Re: loading compressed XPM files, Raimar Falke, 2001/09/17
- [Freeciv-Dev] Re: loading compressed XPM files, Andreas Kemnade, 2001/09/17
- [Freeciv-Dev] Re: loading compressed XPM files, Benoit Hudson, 2001/09/17
- [Freeciv-Dev] Re: loading compressed XPM files, Vasco Alexandre Da Silva Costa, 2001/09/17
- [Freeciv-Dev] Re: loading compressed XPM files, Andreas Kemnade, 2001/09/18
- [Freeciv-Dev] loading compressed XPM files,
Benoit Hudson <=
|
|