mksprite.1
2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
.TH mksprite 1P local "Silicon Graphics, Inc."
.SH NAME
mksprite, mksprite32, mkisprite \- .rgb file converter to C Sprite data structure
.SH SYNOPSIS
\f3mksprite\f1 spname img.rgb tx ty overlap > ../sp_spname.h
.PP
\f3mksprite32\f1 spname img.rgb tx ty overlap > ../sp_spname.h
.PP
\f3mkisprite\f1 spname img.rgb tx ty overlap > ../sp_spname.h
.SH DESCRIPTION
The
.I mksprite\^
family of programs converts large images into smaller pieces (tiles)
that can be loaded individually into TMEM and drawn next to each other
using the sprite library of functions (see sp(3p)). Currently there are
two fully functional texel types supported: 32-bit RGBA (use mksprite32),
and 16-bit RGBA (5:5:5:1) (use mksprite). Also supported for small image
sizes (single tiles), is 8-bit Color Index (CI) mode (use mkisprite).
Support for other texel types could be added, but since these commands
are just csh scripts, customization is relatively easy.
.PP
The current application framework assumes that sprite textures are stored
in a subdirectory called "Texture". These commands are assumed to be
run in this subdirectory, in which case, their output file "../sp_basename.h"
will be in the application directory.
.PP
Command line options are:
.RS 5
.TP 12
.B spname
All created files and declared structures and arrays are
prefixed with this basename. This keeps the names of sprite
components distinct.
.TP
.B img.rgb
SGI format image file. This is the basic texture that will
get drawn when the generated sprite is drawn. If this is
a 4-channel (RGBA) image, then the indicated alpha will be
used, otherwise it is assumed that alpha=1.0 for the while
image.
.TP
.B tx
Width of the basic tile. This does not include the overlap,
if any, with the horizontally adjacent tile. Also, the rightmost
column of tiles may have a smaller width.
.TP
.B ty
Height of the basic tile. This does not include the overlap,
if any, with the vertically adjacent tile. Also, the bottommost
row of tiles may have a smaller height.
.TP
.B overlap
This parameter indicates how many extra texels will be added to
the right and bottom of each tile. Sprites that will be used in
SP_FASTCOPY mode should use overlap of 0. Sprites that will be
scaled or shifted by fractional amounts should have an overlap
of 1 to ensure seamless transitions from one tile to the next.
.TP
.B ../sp_spname.h
This is the recommended filename for the generated Sprite structure.
.SH "SEE ALSO"
.TP 10
.IR rgb2c (1P)
.IR sp (3P)