From 4d012782a0d123136cb51735ddaa352bdc0c773c Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Sat, 5 Jan 2008 00:01:23 -0500 Subject: [PATCH] Add man pages for lbxtool and lbximg --- Makefile.am | 3 ++- configure.ac | 1 + doc/man/Makefile.am | 1 + doc/man/lbximg.1 | 66 +++++++++++++++++++++++++++++++++++++++++++++ doc/man/lbxtool.1 | 41 ++++++++++++++++++++++++++++ src/Makefile.am | 4 ++- src/lbximg.c | 2 +- 7 files changed, 115 insertions(+), 3 deletions(-) create mode 100644 doc/man/Makefile.am create mode 100644 doc/man/lbximg.1 create mode 100644 doc/man/lbxtool.1 diff --git a/Makefile.am b/Makefile.am index af437a6..e1c7d3a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1 +1,2 @@ -SUBDIRS = src +SUBDIRS = src doc/man +DISTCLEANFILES = pkg_err_file pkg_rpt_file diff --git a/configure.ac b/configure.ac index 48c392c..5494e25 100644 --- a/configure.ac +++ b/configure.ac @@ -32,6 +32,7 @@ AM_CONDITIONAL([BUILD_LBXIMG], [test x"$have_libpng" = x"yes"]) AC_CONFIG_FILES([ Makefile src/Makefile + doc/man/Makefile ]) AC_OUTPUT diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am new file mode 100644 index 0000000..f0c58f8 --- /dev/null +++ b/doc/man/Makefile.am @@ -0,0 +1 @@ +dist_man_MANS = lbxtool.1 lbximg.1 diff --git a/doc/man/lbximg.1 b/doc/man/lbximg.1 new file mode 100644 index 0000000..cebcef7 --- /dev/null +++ b/doc/man/lbximg.1 @@ -0,0 +1,66 @@ +.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 diff --git a/doc/man/lbxtool.1 b/doc/man/lbxtool.1 new file mode 100644 index 0000000..a5ac319 --- /dev/null +++ b/doc/man/lbxtool.1 @@ -0,0 +1,41 @@ +.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. diff --git a/src/Makefile.am b/src/Makefile.am index f9958b9..ab54c5a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,8 @@ 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 diff --git a/src/lbximg.c b/src/lbximg.c index 921d42b..6151619 100644 --- a/src/lbximg.c +++ b/src/lbximg.c @@ -358,7 +358,7 @@ int main(int argc, char **argv) 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' }, -- 2.43.2