idtech2-tools/tga2spr.txt
2021-08-25 00:20:01 +02:00

83 lines
3.1 KiB
Text

This tool converts 24-bit, uncompressed Targa files into Quake sprites.
You just have to give it a few more infos.
Syntax:
.\tga2spr sprite.qc
In which "sprite.qc" is a plaintext file containing a number of commands.
Notice that you can also pop in a palette.lmp from whatever mod you're
targetting into the same directory. By default it uses Quake's palette.
It will not add any dithering.
If you want any dithering during palettization, use an external tool.
The GNU Image Manipulation Program provides that feature.
Just remember to export it as a 24-bit image again.
================
LIST OF COMMANDS
================
output [STRING]
Specifies the output sprite. E.g. flame.spr
identifer [CHARS]
Specifies the magic number. In case you use some modded engine that allows
that. Default: IDSP
version [INT]
Specifies the sprite version. Default 1.
type [INT]
Specifies the sprite type. Used for orientation. Default is 0.
0: parallel upright
1: facing upright
2: parallel
3: oriented
4: parallel oriented
radius [FLOAT]
Default is 1.0. Not sure if even used.
synctype [INT]
Default is 0. If not 0, animation starts at random offsets.
maxwidth [INT]
Used for the visible bounding box. Use the width value of the largest frame.
maxheight [INT]
Used for the visible bounding box. Use the height value of the largest
frame.
reserved [INT]
Unused in default Quake. Kurok uses this I believe. Default is 0.
frame [TGANAME] [OFFSET X] [OFFSET Y]
Single frame. Loads for [TGANAME] (e.g. flame1.tga) and specifies an offset
in INT form (X and Y)
anim [TGATITLE] [NUMFRAMES] [OFFSET X] [OFFSET Y] [...FPS*FRAME]
An entire animationgroup. TGATITLE is the Targa name without extension.
E.g. if you specify "flame" it will look for flame_1.tga, flame_2.tga and so
on.
You then specify the number of frames and offset of that group and a
frame-delay for each frame in the animation. Play with it.
Keep in mind that some engines ignore variable framerates in sprites.
You don't have to use ALL available parameters.
For example you have a sprite that's 64x64 in size.
3 Targa images, One is static (wow.tga) and the two others are meant to be an
animation sequence (face_1.tga, face_2.tga).
Then you'd have this:
output test.spr
maxwidth 64
maxheight 64
frame wow 0 0
anim face 2 0 0 8 5
For every frame inside the anim parameter, you should append a FPS number.
Otherwise a value of 1 is assumed for each frame.
In the above exmaple, face_1 will skip to the next at 8 fps, while the
other will do so at 5 fps.
Despite the somewhat in-complete implementation of the SPR spec in most engines.
I hope this tool will be of use to somebody.
Use the program as-is. If you notice any glaring problems feel free
to mail me (marco at icculus dot org) and we can talk about them.
Due to the way it's written, it doesn't allocate much memory, it streams it from
the input right to the output. This is by design. This way you can export large
sprites (gigabytes worth) even on DOS. Use at your own risk.
Copyright (c) 2016-2019 Marco "eukara" Hladik <marco at icculus.org>
Released under the MIT License.