This program is distributed according to the terms of the GNU General Public
License, Version 2. For more information read the file "COPYING". This program can
also be discussed on TTDPatch's mailing list.
Download it
Get the most recent GRFCodec toolset, version 0.9.10:
The source code is available from the TTDPatch Subversion repository (svn rev 819,
http).
Note: If you use the renum.pl script to renumber .nfo files, make sure
to generate the .nfo file with the -t option to disable plain text strings.
The script cannot deal with those correctly at the moment.
Alternatively, try DaleStan's NFORenum tool.
Changes in 0.9.10 (r819):
By DaleStan: fix minor NFO parsing problem
Changes in 0.9.9 (r653):
By patchman:
Check for sprites that extend beyond the end of the PCX file.
Update versioning system to show last-comitted revision for non-release
builds.
By DaleStan:
(devel) Add release targets to the Makefiles
Check the palette of the PCX file before encoding from it.
(Override a failed check with -f)
Introduce several backslash escape sequences; see the wiki for further
information.
(disable with -x or -xx)
Do not apply colormap to sprites that like character glyphs.
(Apply colormap to all sprites with -M instead of -m)
Enable reading of GIMP palette files with -p.
(devel) Terse build mode; get the verbose mode with make V=1.
(devel) Touch version.h if and only if it changes.
Changes in version 0.9.8 (all by DaleStan):
(devel) grfcodec (but not grfdiff or grfmerge) can now be built in
MS Visual Studio 2003.
Slightly change the plaintext quoting algorithm.
(devel) Change several memcpy()s to pointer assignments.
(devel) Plug several memory leaks
(devel) Source code and Makefile changes to grfdiff and grfmerge build
with both Makefiles, on both Cygwin and Linux.
Make code gcc 4 -Wall clean.
Use NFORenum's NFO reading engine:
Sprite numbers are now optional, and need not be correct if present.
Sprite lengths need not be correct. Set to 0 to supress the incorrect
length warnings.
Real sprites are checked for format compliance.
Make 0-byte pseudo sprites an error.
(bugfix) Prevent binary includes from including directories on OSes that
would othewise allow it.
(bugfix) It is now possible for a real sprite to start above the
preceeding sprite (the infamous decreasing ypos bug)
grfcodec now exits with 0 on success.
Changes in version 0.9.7:
support including binary files using " 4 ** data/dingdong.wav" syntax
by Oskar: support // and # comments within pseudo-sprites
fixed incorrect error message while encoding if .nfo file could not be read
(now it reports "Cannot read %s" instead of Creating sprites/: File exists")
made code -Wall clean
remove myalloc stuff
Changes in version 0.9.6 (all by pasky, not Josef):
made it possible to compile grfcodec on Linux
made compatible with gcc 3.x
when decoding, text strings are written in plain text (disable with -t)
supports plain text in .nfo files
fixed bug when first encoding a grf file wouldn't rename .new to .grf
Changes in version 0.9.5:
Self-extracting executables now work on Win2K etc., which doesn't pass
the full path to the C library
GRFMerge will just skip .grf files it can't find, instead of aborting
Making sprites larger didn't work if they're at the right edge; it complained
that ofsx was too large; now it just uses the background colour
GRFDiff didn't work with e.g. "-l 1254" (single value in -l), it complained
that there were no differences and made no output
Allow GRFMerge to read GRFDiff's .exe files, both for -l and other options
Changes in version 0.9.4:
fixed yet another crash while compressing
sprites no longer need correct numbers in the .NFO file; just use "-1" for
each number and it will be assumed to be correct
Changes in version 0.9.3:
fixed crash due to buffer overrun while compressing
slightly improved compression efficiency and speed
GRFCodec now handles spaces in file/directory names properly
GRFCodec now supports comments in .NFO files (from //, ; or # to end of line)
GRF Wizard is a very useful Windows program written by Andrés Zsögön
that takes care of using GRFCodec properly.
It asks you a couple questions about what you want to do and then invokes GRFCodec for you.
First of all, the programs are Windows console programs, which means that you must run them
from the Windows command line prompt.
To install them, simply unzip the grfcodec.zip file into your TTD directory.
All of the programs offer a brief description of their usage and options when called with the
"-h" switch.
Convert trg1.grf into a PCX file which you will find in the SPRITES folder
Edit the PCX file
Simply open your favourite graphics editor and modify the PCX file
grfcodec -e trg1.grf
Convert the PCX file back into trg1.grf. Note that grfcodec will keep a backup copy of your
original GRF file.
To distribute your changes:
grfdiff -x trg1.bak trg1.grf -o description.exe
This will take your modifications and put them in description.exe.
Give that file a useful name, and send it to whoever wants your changes. All they have to do
is copy the .exe file into their TTD folders and run it. Tadaa!
GRFCodec Files
These files are in grfcodec.zip:
grfcodec.exe
A program to convert GRF files into the common PCX format and back
grfdiff.exe
Compares two GRF files and writes the differences into a GRD file
grfmerge.exe
Takes a GRD file from grfdiff and merges the differences back into the GRF file
In addition, it also contains some documentation in text format:
grfcodec.txt
A brief set of instructions on how to use the GRFCodec programs
grftut.txt
A tutorial for editing GRF files using the GRFCodec programs
grf.txt
A technical description of the GRF format
COPYING
The GNU General Public License, the terms under which GRFCodec is distributed