mksprite (tool command)

mksprite , mksprite32, mkisprite

Converts .rgb files to the C Sprite data structure


mksprite spname img.rgb tx ty overlap > ../sp_spname.h
mksprite32 spname img.rgb tx ty overlap > ../sp_spname.h
mkisprite spname img.rgb tx ty overlap > ../sp_spname.h


The 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). Currently there are two fully functional texel types supported.

: 32-bit RGBA (use mksprite32)

: 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 has been added, and customization is relatively easy for these commands with csh scripts.

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.

Command Line Options

All created files and declared structures and arrays are prefixed with this basename. This keeps the names of sprite components distinct.

Is the SGI format image file. This is the basic texture that is 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.

Is the 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.

Is the 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.

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 (no overlap). 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.

This is the recommended filename for the generated Sprite structure.

See Also

rgb2c, sp

Revision History

1999/04/30 Changed Format