-SUBDIRS = src
+SUBDIRS = src doc/man
+DISTCLEANFILES = pkg_err_file pkg_rpt_file
AC_CONFIG_FILES([
Makefile
src/Makefile
+ doc/man/Makefile
])
AC_OUTPUT
--- /dev/null
+dist_man_MANS = lbxtool.1 lbximg.1
--- /dev/null
+.Dd January 4, 2008
+.Os liblbx
+.Dt LBXIMG \&1 "2ooM Reference Manual"
+.Sh NAME
+.Nm lbximg
+.Nd inspect and decode LBX images
+.Sh SYNOPSIS
+.Nm
+.Op Fl i Ns | Ns Fl d
+.Op Fl v
+.Op Fl p Ar palette_file
+.Op Fl O Ar override_file
+.Op Fl f Ar path
+.Op Ar frameno ...
+.Sh DESCRIPTION
+.Nm
+identifies and decodes LBX image files, using
+.Em liblbx .
+LBX images are multi-frame, 256-colour paletted images with transparency.
+.Nm
+can be used to convert some or all of the frames of an LBX image to PNG.
+.Sh OPTIONS
+.Bl -tag -width indent
+.It Fl i , -ident
+Sets the operating mode to identify the image format.
+.It Fl d , -decode
+Sets the operating mode to decode frames to PNG.
+.It Fl v , -verbose
+Output additional information on standard output.
+.It Fl f , -file Ar path
+Read from the specified
+.Ar path
+instead of standard input. If
+.Ar path
+is -,
+.Nm
+will read from standard input anyway.
+.It Fl p , -palette Ar palette_file
+Read the base palette from
+.Ar palette_file .
+In Moo2, these files are found in
+.Pa fonts.lbx .
+Without this option, the base palette is filled with a nice hot pink. Colours
+in the base palette are superseded by those in the embedded palette and the
+override palette.
+.It Fl O , -override Ar override_file
+Use the embedded palette of an LBX image specified by
+.Ar override_file
+as the override palette. In Moo2, this is notably used to select the player
+colour for ship images. Colours in the override palette supersede those in
+both the base palette and the embedded palette.
+.It Ar frameno ...
+Specifies the frames to decode as a sequence of intervals, with frames indexing
+from zero. By default, all frames are decoded. Multiplicity is ignored, as is
+the order in which frames are specified. For example:
+.Bl -tag -width
+.It Nm Li -d 3 6
+Decode frames 3 and 6.
+.It Nm Li -d 4-9
+Decode frames 4 through 9, inclusive
+.It Nm Li -d 6-9 1-4
+Decode frames 1 through 9, except for frame 5.
+.It Nm Li -d 3-
+Decode all frames except the first 3.
+.El
+.El
--- /dev/null
+.Dd January 4, 2008
+.Os liblbx
+.Dt LBXTOOL \&1 "2ooM Reference Manual"
+.Sh NAME
+.Nm lbxtool
+.Nd manipulate LBX archives
+.Sh SYNOPSIS
+.Nm
+.Op Fl l Ns | Ns Fl x
+.Op Fl v
+.Op Fl f Ar path
+.Op Ar
+.Sh DESCRIPTION
+.Nm
+lists and extracts files from LBX archives (the format used by Moo2),
+using
+.Em liblbx .
+.Sh OPTIONS
+.Bl -tag -width indent
+.It Fl l , -list
+Sets the operating mode to list files in the archive.
+.It Fl x , -extract
+Sets the operating mode to extract files from the archive.
+.It Fl v , -verbose
+Output additional information on standard output.
+.It Fl f , -file Ar path
+Read from the specified
+.Ar path
+instead of standard input. If
+.Ar path
+is -,
+.Nm
+will read from standard input anyway.
+.It Ar
+Limit the operation to these files in the archive. By default, all files are
+selected. Supports common shell globbing features.
+.El
+.Sh CAVEATS
+When extracting from an archive read from standard input, be sure to specify
+files in the order that they appear in the archive. This limitation will
+hopefully be lifted in the future.
lib_LTLIBRARIES = liblbx.la
bin_PROGRAMS = lbxtool lbximg
-include_HEADERS = lbx.h
+
+lbxdir = $(includedir)/lbx
+lbx_HEADERS = lbx.h image.h
liblbx_la_SOURCES = byteorder.h misc.h misc.c lbx.c image.c
static const char *sopts = "idvf:p:O:";
static const struct option lopts[] = {
- { "info", 0, NULL, 'i' },
+ { "ident", 0, NULL, 'i' },
{ "decode", 0, NULL, 'd' },
{ "verbose", 0, NULL, 'v' },
{ "file", 1, NULL, 'f' },