Bsp2Wal version 1.2
by Christopher Wise (Christopher.Wise@eng.monash.edu.au)

Description
-----------

Bsp2Wal is a program to extract textures from Quake or Hexen 2 .bsp 
files and output them in the Quake2 .wal format. 


How to use Bsp2Wal
------------------

bsp2wal <filename.bsp>
This will read the textures from filename.bsp and output individual 
.wal files. The filename will be the original texture name stripped 
of non-alphanumeric characters (except for + and _) and converted to
lowercase. The program does not check to see if the file to be created 
already exists so it will overwrite any existing file with the same 
name.

The .wal files created don't have any of the texture flags set.
Use a program like wally to change the values that are stored
in the .wal file.

There must be a file called trans.pcx in the current directory. 
Rename either qtrans.pcx or htrans.pcx to trans.pcx depending on 
whether you want to extract from quake or hexen 2 bsp files.


Explanation of the translation table file
-----------------------------------------
(You don't have to read this section to use the program)

trans.pcx is required by the program and must be in the same
directory as the program.

trans.pcx is used to do the palette conversion.
It must contain exactly 256 pixels. The palette must be that to be 
used by of the output textures. (in this case quake2). The colours 
of the pixels must be the closest match to the corresponding colour 
in the input palette. The first pixel must be coloured with quake 2 
palette's closest match to the first pixel in the hexen 2 palette.

If that sounds confusing I'll explain how I created it and it might 
be clearer. The file hexen2.pcx contains one pixel of each colour in 
the Hexen palette, IN ORDER. I opened this file in paintshop pro and 
chose the menu item Colors|Load Palette and applied the quake 2 
palette with the Nearest Color Matching option.

It's instructive to load hexen2.pcx and trans.pcx side by side so you 
can see what the closest colour will be. The colour in in.pcx will be 
changed to the colour in the same position in trans.pcx. I changed a 
couple of colours by hand because they looked wrong. You might want to 
do a little more hand tweaking of tras.pcx if you think you can do a 
better job, by all means do so, I'm not an artist.

I have made the program this way so it would be flexible. You
should be able to convert the original Quake textures by replacing
trans.pcx with the file qtrans.pcx that is in the misc directory.
Also these textures could be used in future quake2 engine games
that use wal files but have a different palette.


Credits
-------
The pcx file routines are based on source code for John Carmack's
Quake2 utilities.
