                      ----------------------__  -------
                       \   / \  ~~~\| \  |~~~\ \ \   /
                        | |   | |__,   | |    | | | |
                        | |   | ___|   | |    | | | |
                        | |   | |  `   | |    | | | |
                        | |  /  |__/| /  |___/ / /   \
                     /\_| | -----------------~~ -------
                   /______/
     ------- ,------  ------------ __-----__ ------------------------ TM
      \   / / /  \   \ \   / \   / /  /---\ |  \   / \   / |/~~| |~~\|
       | |/ /     |   \ | |   | | |  |      '   | |___| |      | |
       |   \      | |\  \ |   | | |  |   \~~~/  |  ___  |      | |
       | |\  \    | | \   |   | | |  |    | |   | |   | |      | |
      /   \ \  \ /   \ \  |  /   \ \  \---  |  /   \ /   \    /   \
     ------- '--------- \ | ------- ~~----~~  -------------  -------
                         `'
                          MAT MASTER v. 1.01 beta

              programmed by Peter Klassen of the Code Alliance

              report any bugs/suggestions under ppklassen@aol.com

                The Code Alliance page: http://www.darkjedi.com

Requirements: Windows 95, 256c/HiColor mode.
I tested it on 800x600, it could be that the program won't look right
on LargeFonts. The colors of the palette (when editing color MATs),
will be dithered on 256 color modes.

History
--------

Version 1.01 
--------------
Bugfixes from Version 1.0
Fixed: major bug when converting Texture MTM to MAT
Fixed: Automipping works now
Fixed: Bug with reconverting MultiMipMap MTM to MAT
Fixed: When converting a BMP, the MTM Contents list will be cleared now
Fixed: Transparency is fixed now
Fixed: Remap Palette cb behavior with Color/TX mode


Version 1
----------
    Bugfix: bug at changing output fname after selecting textures
            has been fixed.
    Bugfix: Now Mat Master also supports Photoshop BMPs (0.8 made 4 too many
            pixels offset to the right of the data begin)

    Added: Transparent MATs supported now
    Added: Palette conversion when converting to MAT

Version 0.8
------------
First release ever.


What this program is for:
-------------------------
You should use MatMaster as a tool to decompile/recompile Jedi Knight(tm)
material (MAT) files. Therefore it is a tool to create own textures as well
edit already available ones (don't forget about LEC's legal claims etc.!:-) )

What Mat Master supports:
-------------------------
Mat Master supports all MAT formats known to me: single/multiple texture,
single/multiple color, Mipmap textures, transparent textures.
As to explain: MAP files can either contain textures or simple colors. Colors
are used e.g. for sparkles and smoke particles; multiple textures are used
for animated signs like for example neon signs in Nar Shaddaa.
MipMap textures means that instead of one texture, several ones are stored,
whereas the next one is 1/4 of the previous one. They are used to switch
the textures to low detail at higher distances, as you probably have seen.
You can also combine multiple textures with mipmaps (what LEC did not do
AFAIK), but it works. Color textures do not contain any mipmaps, they are
single colors, like smoke particles. Transparent textures are those which
has the color 0 transparent (like lotsa grids in JK).

How it works:
-------------
If you convert a MAP file, it is converted into a MAP MASTER project file
(MTM) and, if the source file is a texture MAT, into one or several BMP files.
The MTM file is a text file you can view with a text viewer; the BMP files
are Windows 256 color, uncompressed standard BMP files. However, one limi-
tation: like in Dark Forces, the textures in JK must have extents as a power
of 2: like 64x128, 32x32 etc.
To convert a MAT, you have to specify a palette and an output name (normally,
same as input but with ".MTM" extension). Then click onto "Convert" to start
the conversion.

To create a MAT, you can either select a BMP file as an input file and click
onto "Convert"(thereby creating a simple one-texture non-mipmapped MAT),
or, for more complicated options, you can either open an available MTM or
create a MAP in the memory (button left to the "MTM contents" listbox).
If you specified a MTM file as input, the "MTM contents" box is filled by
the MTM file contents. These are numbers if the MAT-to-be is a color one,
or filenames, if it's a texture one. If many filenames follow each other
in one line, separated by "|", then this is a MipMap texture.
If you have a small "x" left to a texture, this means that this texture
is transparent.

If you click with your right mouse button onto the "MTM contents" list box,
you can either select a color (Color MAT; needs a palette), or textures.
By selecting textures, you open a MipMap editor: there, you can either specify
the textures (right click->Select File) which will be your MipMap texture,
or you can let the program generate the mipmaps automatically. 
That means, you only select one texture, specify the mipmaps to be generated
automatically, select a depth level (2 to 4), and the program will create
the smaller mipmaps by itself.
By marking"Transparent (color 0)" you define this texture as transparent
(or not, if you uncheck it).
When your editing is finished, specify an output file name, and click onto
"Convert". If there are errors, you will be notified.

As palette files, you must use the JK colormap files (you can extract
them from the JK GOBs using some JK GOB utility like ConMan). I included
UICOLORM.CMP from the JK package so you haven't to search for it.
Please notice that I removed all the irrelevant data from this colormap
file (like light level and transparency info) so that I can keep the ZIP
small. The palette is needed for editing Color MATs or decompiling any MAPs
to BMP. If you convert MATs with UICOLORM.CMP and the colors look weird,
try selecting a proper palette. Hint: the level in which a texture is
used, is mostly signified by its 2 front numbers: 01 for Level 1, 02
for Level 2 etc. The palettes are signified similarly, too.
Now MAT MASTER also has back palette conversion, that means, if you take a
BMP which wasn't a JK texture before and therefore has a wrong color palette,
MAT MASTER will automatically remap the colors (if you check the box "Remap
palette"). If you check it but do not specify a valid JK CMP file, the program
won't remap any colors.

This program does not make any changes to your registry nor to your system
INI files. It only requires files contained in this package to work properly.

This program is Freeware. (C) Peter Klassen, 1997. The Code Alliance are:
Dave Lovejoy, Alex Novikov, Frank Krueger, Jereth Kok, Peter Klassen.
The author is not responsible for any damage done by this program to your
system. You may distribute it freely via diskettes, BBS, Internet or CDs, sup-
posed that you keep the package intact and w/o modifying any files of it.
No charges must be taken for this program, except evtl. charges for the
online time.

Thanks go to:
-------------
Matthias Welander for cracking on MAT files,
Dave Lovejoy for trusting me with this task,
Alex Novikov and
Yves Borckmans for help,
Borland Intl. for Delphi,
JK team for a great game.
All the people which feedback'ed MAT MASTER.

Portions of the BMP converter are (C) Yves Borckmans.

Special Thanks to
George the Mighty,

Legal stuff:

Dark Forces and Jedi Knight are (C) & (TM) LucasArts Entertainment Company.
Delphi is a trademark of Borland International.

