version 1.6 | | version 1.7 |
---|
| | |
"\nWhere ARCHDIR is the directory where you stored the ". | | "\nWhere ARCHDIR is the directory where you stored the ". |
"raw archetypes.\n". | | "raw archetypes.\n". |
"This script will then create these files:\n". | | "This script will then create these files:\n". |
"archetypes,bmaps,bmaps.paths,faces,animations.\n" | | "archetypes,bmaps,bmaps.paths,faces,treasures.bld,animations.\n" |
) | | ) |
} | | } |
} | | } |
| | |
$archetypes = "archetypes"; | | $archetypes = "archetypes"; |
$bmaps = "bmaps"; | | $bmaps = "bmaps"; |
$faces = "faces"; | | $faces = "faces"; |
| | $treasures = "treasures.bld"; |
$animations = "animations"; | | $animations = "animations"; |
$paths = $bmaps."."."paths"; | | $paths = $bmaps."."."paths"; |
$faceExt = "\\.[a-zA-Z0-9][A-Z0-9][A-Z0-9]"; | | $faceExt = "\\.[a-zA-Z0-9][A-Z0-9][A-Z0-9]"; |
| | |
&facesOut; | | &facesOut; |
close(FACES); | | close(FACES); |
| | |
| | &info("$treasures"); |
| | # We still support the old consolidated treasure information |
| | # so copy it over. |
| | open(TREASURES,">".$treasures) || &die("cannot open ".$treasures); |
| | print TREASURES " |
| | # Do not modify this file - any changes will get overwritten. |
| | # instead, modify the treasures file or the .trs file in the |
| | # arch directory.\n |
| | "; |
| | |
| | open(TR, "<treasures"); |
| | while (<TR>) { |
| | print TREASURES $_; |
| | } |
| | close(TR); |
| | print TREASURES "#\n# Start of collected .trs files\n#\n"; |
| | |
| | &treasuresOut; |
| | close(TREASURES); |
| | |
&info("$animations"); | | &info("$animations"); |
open(ANIM,">".$animations) || &die("cannot open ".$animations); | | open(ANIM,">".$animations) || &die("cannot open ".$animations); |
&animOut; | | &animOut; |
| | |
$archsNum++; | | $archsNum++; |
push(@archs,$file);n | | push(@archs,$file);n |
} elsif( $name =~ /(\S+)\.base($faceExt)\.png$/) { # FACE | | } elsif( $name =~ /(\S+)\.base($faceExt)\.png$/) { # FACE |
| | |
$facesNum++; | | $facesNum++; |
$im_name = "$1$2"; | | $im_name = "$1$2"; |
&warn("duplicate face $im_name in ".$dir." and $faces{$im_name}") | | &warn("duplicate face $im_name in ".$dir." and $faces{$im_name}") |
| | |
} elsif ( $file =~ /.*\.face$/) { # Face information file | | } elsif ( $file =~ /.*\.face$/) { # Face information file |
$facesFileNum++; | | $facesFileNum++; |
push(@face_files, $file); | | push(@face_files, $file); |
| | } elsif ( $file =~ /.*\.trs$/) { # Treasure information file |
| | push(@treasure_files, $file); |
} | | } |
elsif ( $file =~ /\.png$/ || $file =~ /\.xpm$/ || $file =~ /$faceExt$/) { | | elsif ( $file =~ /\.png$/ || $file =~ /\.xpm$/ || $file =~ /$faceExt$/) { |
# we cover many files we probably shouldn't, but oh well. | | # we cover many files we probably shouldn't, but oh well. |
| | |
} | | } |
} | | } |
| | |
| | sub treasuresOut { |
| | foreach $treasure (@treasure_files) { |
| | open(TREAS, $treasure) || &die("cannot open ".$treasure); |
| | while(<TREAS>) { |
| | print TREASURES $_; |
| | } |
| | close(FACE); |
| | } |
| | } |
| | |
sub facesOut { | | sub facesOut { |
foreach $face (@face_files) { | | foreach $face (@face_files) { |
open(FACE, $face) || &die("cannot open ".$face); | | open(FACE, $face) || &die("cannot open ".$face); |
| | |
&info(Images.":\t".$facesNum); | | &info(Images.":\t".$facesNum); |
&info(Faces.":\t".$facesFileNum); | | &info(Faces.":\t".$facesFileNum); |
&info(Animations.":\t".$animationsNum); | | &info(Animations.":\t".$animationsNum); |
| | &info(Treasures.":\t".($#treasure_files+1)); |
&info(Trash.":\t".$trashNum); | | &info(Trash.":\t".$trashNum); |
} | | } |