For "full" IWADs, include all patches, instead of only patches found in TEXTURE1.

This commit is contained in:
Simon Howard 2008-03-01 20:29:22 +00:00
parent 8b40c8fde3
commit f043aadecf
2 changed files with 41 additions and 9 deletions

View file

@ -40,8 +40,14 @@ textures/freedm/texture1.txt: textures/combined.txt
textures/shareware/texture1.txt: textures/combined.txt
$(CPP) -DSHAREWARE < $< > $@
textures/%/pnames.txt: textures/%/texture1.txt
textures/shareware/pnames.txt: textures/shareware/texture1.txt
./extract-pnames.pl < $< > $@
textures/doom/pnames.txt: textures/doom/texture1.txt
./extract-pnames.pl -a > $@
textures/doom2/pnames.txt: textures/doom2/texture1.txt
./extract-pnames.pl -a > $@
textures/freedm/pnames.txt: textures/freedm/texture1.txt
./extract-pnames.pl -a > $@
# update wadinfo.txt

View file

@ -3,15 +3,41 @@
use strict;
my %patches;
while (<>) {
# Parse a TEXTURE1 file and generate a list of patches
sub parse_texture_file {
while (<>) {
if (/^\*/) {
my ($name) = /^\*\s+(\w+)/;
$name = uc $name;
$patches{$name} = 1;
}
}
print "; autogenerated patch list\n\n";
foreach (sort keys %patches) { print "$_\n"; }
}
print "; autogenerated patch list\n\n";
# Generate a full list of textures from the files in the
# patches/ directory
foreach (sort keys %patches) { print "$_\n"; }
sub list_all_textures {
print "; autogenerated patch list\n\n";
foreach my $file (glob("patches/*.gif")) {
if ($file =~ /\/(.*)\.gif/) {
print "$1\n";
}
}
}
if (scalar @ARGV == 0) {
parse_texture_file();
} elsif ($ARGV[0] == "-a") {
list_all_textures();
} else {
print "Usage: extract-pnames.pl [-a]\n";
}