
What is it
----------

This is version 0.3 of XmPak, a Motif-based Quake PAK file browser.
It reads a Quake .pak file and displays a tree of the various
objects in the .pak. You can do interesting things with some of
the objects, like play the sounds and view the models.

Author
------

Written by Greg Banks (gnb@tpg.tpg.OZ.AU) in his very sparse spare time.

Acknowledgements
----------------

Thanks to ID Software for writing such a great game, and
even more for making it so open. Thanks to Krist Paquay
for knowing so much about X and creating Xit. Thanks to
Mitch Davis for showing me how wonderful Linux is.

System Requirements
-------------------

An ELF Linux with X-Windows. I use Linux 1.2.11 from a Slackware
distribution, with XFree386 3.12d. You don't need Motif dynamic
libraries, XmPak is statically linked against Motif.

If you want to play sound files, you also need to have an
executable in your $PATH called `play' which takes on the
commandline a filename of a .wav file to play. I use the
Lsox package for this (see your favourite Linux repository).
See below for how to a different program.

To install
----------

 1. Copy the executables into your binary directory.
 2. Copy XmPak.ad into your app-defaults directory.
 3. Copy 50_foreground and *.xpm into your pixmaps directory.

 Or just run the lot from the current directory.

Usage
-----

  xmpak [--owncmap] [--gamma n] [pakfile]

XmPak reads a pakfile and displays the objects within it
in a tree, whose "directories" can be expanded and collapsed.
Individual objects can be extracted to a file, which is
placed in the directory `out'. Objects can also be opened,
which has the following meanings:

  - .wav (Sound files)
    are played. The program used to play these files can be
    controlled with the X resource "?.openCommand_WAV". In
    the value of this resource, the substring `%s' is replaced
    with a filename. The default play command is "play %s".

  - .qc (Quake-C source)
  - .rc (Resources file)
  - .cfg (Config file)
    are displayed in a text window.

  - .mdl (Alias Model)
    are displayed in a separate display window. The models can
    be displayed wireframe or textured, and rotated panned and
    zoomed in 3D. You can display any frame or skin in the .mdl.
    You can export the current frame as a .raw triangle file, and
    the current skin as a .ppm file. Both v3 (qtest1) and v6
    (shareware) .mdl formats are understood.

  - .lmp (Lump Graphics)
    Flat graphics lumps (lumps can also be colour palettes and
    suchlike) are displayed in a separate display window. You
    can export them as a .ppm file.

  - .spr (Sprite)
    are displayed in a separate display window. You can export
    the current frame as a .ppm file.

  - directories
    are expanded if currently collapsed and vice versa.

  - all others are ignored.

The options are:

  --owncmap
    use a private colourmap. This improves the display of
    model files if you don't have many colourmap cells left.
    XmPak won't start unless it found at least 25 colours.

  --gamma n
    Set the gamma correction factor to a number between 0.1
    and 2.3. I use 1.7 for viewing models.

The default pakfile name is id1/pak0.pak, so you can easily
run XmPak from your Quake directory.

  unpak [pakfile [basedir]]

Unpak extracts all the files in the pakfile into a directory
tree rooted at basedir. For instance, if basedir is /my/dir
the object progs/player.mdl will be exported as the file
/my/dir/progs/player.mdl. The default pakfile is `id1/pak0.pak'
and the default basedir is `out'.

  pakls [pakfile]

Pakls lists the names, sizes, and offsets of all the objects
in the pakfile. The default pakfile is `id1/pak0.pak'.

Bugs
----

x  The 50_foreground file needs to be in your pixmap path.
   This is a due to a bug in the special Pixmap converter
   installed by one of the proprietary libraries I used.

x  The colours of pixmaps in the main window are wrong when the
   --owncmap option is used. This is due to a bug in default
   Pixmap converter in Motif 2. Boy I hate pixmap converters.

x  There is no "busy" indication, which can make a difference
   when reading some of the very large .mdl files.

x  There are some bugs with keyboard traversal of menus in the
   .mdl display window.

x  Model and Lump display will not work on anything other than
   an 8-bit PseudoColor visual. If you try xmpak will die with a
   BadMatch X error in X_PutImage. This is because I haven't bothered
   coding for other cases yet; however the other features still work.

Future work
-----------

x  Being able to choose a new .PAK file without restarting

x  Confirmation on Extract command

x  Help

x  A manpage

x  Compiling pixmaps and app-defaults into the binary

x  Handling frame groups and skin groups in .mdl files.

x  Being able to `open' more types of files, in particular
   .wad and .bsp files.

x  Improving the colour allocation algorithm to give
   better results when colours are running low. Currently
   you need a *lot* (like 200) of colours free to see e.g.
   the green armour in its correct colours.

Legal Guff
----------

No restrictions are placed on use of this program. The source
remains copyright (c) 1996 Greg Banks except for some proprietary
libraries. This program is distributed in the hope that it will
be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Greg.
Sat Aug 24 23:28:24 GMT 1996
