@c -*-texinfo-*-
@node mdl2spr, 3D Sprites, md32spr Tutorial, Working with Engine Content
@section Quake Model Converter (@code{mdl2spr})
@cindex @file{mdl2spr}
@cindex Applications, @file{mdl2spr}

@emph{By Nathaniel Saint Martin, @email{noote@@bigfoot.com}.
Back seam fix and skin resizing by Seth Galbraith,
@email{sgalbrai@@linknet.kitsap.lib.wa.us}.
Project overhauled by Eric Sunshine, @email{sunshine@@sunshineco.com}.}

@file{mdl2spr} is a model converter for Quake1 @sc{mdl} and Quake2 @sc{md2}
files.  It converts these files into Crystal Space's sprite format.  If the
Quake1 @sc{mdl} contains skins, they are extracted and saved as @sc{png} image
files.  If skin height or width is not a power of two, it will be resized.

@subheading Usage

@file{mdl2spr} is invoked from the command line, and is given the name of an
input @file{.mdl} or @file{.md2} model file, as well as the name of the
desired output sprite file.

@example
mdl2spr [@var{options}] @var{model-file} @var{output-sprite-name}
@end example

Both @samp{@var{model-file}} and @samp{@var{output-sprite-name}} are required.
@samp{@var{model-file}} is the filename of the input @file{.mdl} or
@file{.md2} model file, and @samp{@var{output-sprite-name}} is the name of the
output sprite without the trailing @file{.spr} extension (which will be
appended automatically by @file{mdl2spr}).

If a skin is extracted from a @sc{mdl} file, then it will be written to a file
named @file{@var{output-srite-name}.png}.  If more than one skin exists within
the model, then each skin will be placed in its own @sc{png} file and a number
(and possibly letter) will be appended to the sprite name before the
@file{.png} extension.

Here is a summary of the options understood by @file{mdl2spr}:

@table @code
@item -h
Display usage and option summary.

@item -s <@var{float}>
Set the global scale of model based upon the floating point number
@samp{@var{float}}.  Default is 0.025.

@item -d <@var{int}>
Specify the frame delay in Quake ticks from @samp{@var{int}} for frames which
don't otherwise have a built-in delay.  Default is 100.

@item -n
Disable automatic naming of action frame sets.  Enabled by default.

@item -x <@var{float}>
Set center of sprite on X axis from @samp{@var{float}}.  Default is 0.0.

@item -y <@var{float}>
Set center of sprite on Y axis from @samp{@var{float}}.  Default is 0.0.

@item -z <@var{float}>
Set center of sprite on Z axis from @samp{@var{float}}.  Default is 0.0.

@item -r
Disable automatic power-of-2 skin resizing.  Enabled by default.  This option
only applies to Quake1 @sc{mdl} files (not Quake2 @sc{md2} files).
@end table

@subheading Future Plans

This is a list of planned future enhancements to @file{mdl2spr}.

@itemize @bullet
@item
Add a command-line option so user can manually specify a replacement
@file{palette.lmp} file rather than using the built-in one.
@end itemize
