<Start> <Intro> <Install> <Legal> <Screen> <Buffer> <Sprite> <Input> <Misc> <Debug> <Utes> <Author>
Utilities
Overview
Most of the utilities are still under evolving construction, so don't expect too much from them. I've taken the philosophy that if another program
exists to do something, then I might as well use that instead of reinventing the wheel, e.g. I haven't written a sprite drawing program. If you want
to create sprites I suggest you use whatever package you prefer (I recommend Satan Paint and Povray, available free for many platforms), then
convert the output into PCX files and cut them out for inclusion.
The utilities began life when the only targets written were 320x200x256, so they are most useful in that resolution. I copied low resolution
builds of them into my path so I could use them even after I recompiled the library for higher resolution graphics modes.
textmode.exe
This is a very simple utility, it just puts the screen back into text mode. It is not useful under Linux or X11, as if you trash the screen in these
environments something fairly major has probably happened. I use this from DOS with djgpp and Watcom if my program crashes and leaves the
screen in graphics mode.
sprgrab.exe
This program lets you grab sprites from PCX files and stores them in sprite files. It is pretty non user friendly, but it works most of the time.
Sprites are saved with a default bounding rectangle which surrounds the whole sprite.
autograb.exe
This program lets you grab sprites from PCX files automatically, providing that you follow certain conventions. The PCX file containing sprites must be laid out with one background colour, which does not appear in any of the sprites in the picture. The sprites to be cut out should not be bordered by any boxes, just the background colour. Once run, the utility will surround the each suggested sprite with a white rectangle. If you press the Y key, that sprite will be saved out. Any other key causes the sprite to be skipped.
joinspr.exe
This program joins multiple sprite files together. Because the number of sprites in a sprite file is kept at the start of the file, the process involves
more than just concatenating the files together. Sprite files are joined in the order given on the command line. Once you have joined your sprite
files together you can use spr_edit to put them in the correct order for loading into your application.
strippal.exe
This utility takes the palette out of a PCX or .jlb file and puts it into a file suitable for loading by the function pal_load().
td2spr.exe
This converts a "twilight dreams" sprite file into a JLib sprite file. The twilight dreams sprite editor is available by ftp from x2ftp.oulu.fi. It was
written more as an example of how to convert from one format to another than as an incredibly useful utility. I would love to see some other
converters come floating my way (hint, hint).
spr_edit.exe
This is probably the most ill-named utility. Basically this program is designed to add and remove bounding rectangles and reorder sprite files. Its
also handy for seeing if you have cut out sprites correctly. There are a couple of thing to note about this program: You can only edit the bounding
rectangles of the input (left) file. Any changes you make on the left are reflected to the right if the same sprite has been copied to the right. This
is because when it copies, it only copies a pointer and so the right hand sprite is the same as the left.
pcx2jlb.exe
This utility takes a PCX file and converts it into a .jlb file. You will probably find that JLib files are smaller than the same image in a PCX. Also,
you will never have to worry about the image format becoming proprietary (does anyone remember GIF? ).
pal_edit.exe and pal_conv.exe
Undocumented.
Developers Note: I intend to add loading routines that will allow programs to keep sprites, palettes and image files all in one data file and load everything from that. This will be available to all images. Along with this will come some sort of packing ute to put files into one file and corresponding functions to load from it.
Next Section: Improving Performance
<Start> <Intro> <Install> <Legal> <Screen> <Buffer> <Sprite> <Input> <Misc> <Debug> <Utes> <Author>