Wad2Tool Version 1.0 Copyright 1996 Richard Felker (Dalias) This program may not be distributed for a profit. Wad2Tool is a program designed to manipulate WAD2 files, which contain the textures for Quake MAP levels. I will include source soon. Just a few more feayures I'd like to add first... It might be helpful in case you would like to look at it or port it (which should be very easy). Wad2Tool is used from the command line. It is not for beginners. All options are CASE-SENSITIVE! (except maybe the name of the file on disk...hehehe :) Usage: wad2tool [options] is the name of the WAD2 you are using. It does not have to exist at first if you will be "-create"ing it. It will be used for all the commands you give Wad2Tool. Options: These options tell Wad2Tool what to do. If none are specified, it will list all the entries in the WAD2 file. -create Creates a new WAD2 file. If already exists, it is overwritten. Use this command with care! -addlump Adds a raw lump to the WAD2 file. The data is read from and it stored in the WAD2 as . is a single character telling the type of data. 'D' = texture and '@' = palette. Look in the Quake specs for more. -extlump Extracts a lump named and saves it as . -dellump Removes the lump named from the WAD2 file. This operation only removes it from the wad directory; it still takes up space. Use -rebuild (not yet implemented) to recover the space. -quick Disables mip mapping of textures. Actually doesn't make much difference in speed. :) -add Generates a texture from a bitmap file, .bmp, and stores is in the WAD2 as . Unless -quick is used, the texture will be automaticly mip mapped. -addfull Generates a texture from 4 bitmap files whose names begin with followed by a number (0,1,2,3) and then the extension ".bmp". The texture is stored in the WAD2 as . -ext Extracts the full-size texture named and saves it as .bmp. -extfull Generates bitmap files from the 4 parts of a texture named . They are saved as ?.bmp, where the ? is a number (0,1,2,3) indicating which size. -rebuild Will clean up any unused space in the WAD2. NOTE: THIS OPERATION IS NOT YET IMPLEMENTED! Until -rebuild is implemented, I recommend re"-create"ing the WAD2 with every change and adding all the data from a batch file. That's the way I use it. Here's an example: Let's assume you have palette.lmp (Quake's palette) and rock.bmp (a texture you made) in a directory together. You coule make a batch file similar to the following to build the WAD2 file, mytex.wad. wad2tool mytex.wad -create -addlump palette.lmp palette @ wad2tool mytex.wad -add rock rock If you had done the mip mapping manually, you could add the 4 versions of a texture like this. Let's assume you have tech0.bmp, tech1.bmp, tech2.bmp, and tech3.bmp (4 versions of a texture you made, 1, 2, and 3 being the smaller manually mip mapped versions of 0 in order of decreasing size). The following command would add them. wad2tool mytex.wad -addfull tech tech NOTE: Extracting a texture to a bitmap requires a palette. The palette should be in a lump named "palette" in the WAD2 file. If it is not, extract it from PAK0.PAK (with an unpacker) and put it in the WAD2 with -addlump. === Revision history === 1.0 Fixed major bug in mip mapping. Added -extfull command. ======================== 0.98 (internal beta) Added real mip mapping. ======================== 0.81 (internal beta) Fixed the bitmap extraction bug. Improved command syntax slightly. ======================== 0.8 The first version! ======================== Possible features for future versions: * Support for 24 bit bitmaps * Texture viewing (non-portable; would be for DOS ver only) * Other stuff :) Oh, one last thing - you use this program at your own risk. I shall not be held responsible for any damages this program causes to your system or to you in any other way. This is free software and I cannot be concerned with guaranteeing that it will function properly. I seriously doubt it will do anything to harm your system, but I cannot guarantee it. If it does, write and tell me and I'll try to help you fix it, if I can. Actually, any bug reports would be greatly appreciated. Dalias 71614.3257@compuserve.com http://www.sprynet.com/sprynet/felker/epicentr.htm