fprintf(stderr, " specifies an input WAD file. The arguments after the\n");
Pause( "Press any key to see the rest of help...\n" );
fprintf(stderr, " file name specify what to search for in the input wad\n");
fprintf(stderr, " file's directory to extract the pnames and texture data.\n");
fprintf(stderr, " A + or - is required and terminates the list of texture\n");
fprintf(stderr, " resources. If it's a plus and the -owad option is used\n");
fprintf(stderr, " then all resources BESIDES the pname and textures are\n");
fprintf(stderr, " passed through unmodified to the output WAD.\n");
fprintf(stderr, "-obp file specifies an output binary pnames filename\n");
fprintf(stderr, "-obt file specifies an output binary texture filename\n");
fprintf(stderr, "-oap file specifies an output ascii pnames filename\n");
fprintf(stderr, "-oat file specifies an output ascii texture filename\n");
fprintf(stderr, "-owad file pname texture\n");
fprintf(stderr, " specifies an output WAD file. The arguments before the\n");
fprintf(stderr, " file name specify what to call the pnames and texture data\n");
fprintf(stderr, " in the output wad file's directory.\n\n");
}
/* this is where we store the output filenames. */
struct {
char *obp, *obt,
*oap, *oat,
*owad, *pname, *texture;
} outfiles = {
0, 0,
0, 0,
0, 0, 0
};
#define DEMAND_ARGC(off) do { if ((i+off)>=argc) { fprintf(stderr, "Too few arguments to option %s (expected %d)\n", argv[i], off); exit(1); } } while (0)
int main(int argc, char **argv)
{
void *currpnames=0;
INT32 currpnlen;
int i;
fprintf(stderr, "Textures utility version 1.04\n");
fprintf(stderr, "Copyright (C) 1994 Robert Forsman\n");
fprintf(stderr, "Gnu General Public License\n");
fprintf(stderr, "Ported to DOS by Robert Forsman and David Allen\n");
/* parse arguments */
if (argc<2) {
usage(argv[0]);
exit(1);
}
for (i=1; i<argc; i++) {
if (0==strcmp(argv[i], "-argfile")) {
DEMAND_ARGC(1);
argv = load_argfile(argv[0], argv[i+1], &argc);
if (argv==0) {
fprintf(stderr, "argfile load aborting\n");
exit(1);
}
i=0;
} else if (0==strcmp(argv[i], "-bp")) {
DEMAND_ARGC(1);
currpnames = slurp_file(argv[i+1], &currpnlen);
i++;
} else if (0==strcmp(argv[i], "-bt")) {
struct texture_gob *curr = extra_gob();
if (currpnames==0) {
fprintf(stderr, "Must specify at least one pnames resource before specifying a binary\ntexture file. Aborting.\n");