… | |
… | |
20 | use Crossfire; |
20 | use Crossfire; |
21 | use Coro; |
21 | use Coro; |
22 | use Coro::AIO; |
22 | use Coro::AIO; |
23 | use POSIX (); |
23 | use POSIX (); |
24 | use Digest::MD5; |
24 | use Digest::MD5; |
|
|
25 | use Storable; $Storable::canonical = 1; |
25 | |
26 | |
26 | sub usage { |
27 | sub usage { |
27 | warn <<EOF; |
28 | warn <<EOF; |
28 | Usage: cfutil [-v] [-q] [--force] [--cache] |
29 | Usage: cfutil [-v] [-q] [--force] [--cache] |
29 | [--install-arch path] |
30 | [--install-arch path] |
… | |
… | |
75 | warn "'$path' does not look like a maps directory ('regions' file is missing).\n"; |
76 | warn "'$path' does not look like a maps directory ('regions' file is missing).\n"; |
76 | exit 1 unless $FORCE; |
77 | exit 1 unless $FORCE; |
77 | } |
78 | } |
78 | |
79 | |
79 | system $RSYNC, "-av", "$path/.", "$DATADIR/maps/.", "--delete", "--exclude", "CVS", "--delete-excluded" |
80 | system $RSYNC, "-av", "$path/.", "$DATADIR/maps/.", "--delete", "--exclude", "CVS", "--delete-excluded" |
80 | or die "map installation failed.\n"; |
81 | and die "map installation failed.\n"; |
81 | |
82 | |
82 | print "maps installed successfully.\n"; |
83 | print "maps installed successfully.\n"; |
83 | } |
84 | } |
84 | |
85 | |
85 | { |
86 | { |
… | |
… | |
121 | my ($w, $h) = unpack "NN", $1; |
122 | my ($w, $h) = unpack "NN", $1; |
122 | |
123 | |
123 | (my $face = $path) =~ s/^.*\///; |
124 | (my $face = $path) =~ s/^.*\///; |
124 | my $T = 32; |
125 | my $T = 32; |
125 | |
126 | |
126 | unless ($face =~ s/\.base\.(...)\.png$/.$1/) { |
127 | unless ($face =~ s/\.32x32\.png$//) { |
127 | warn "$path: weird filename, skipping.\n"; |
128 | warn "$path: weird filename, skipping.\n"; |
128 | next; |
129 | next; |
129 | } |
130 | } |
130 | |
131 | |
131 | if ($w < $T || $h < $T) { |
132 | if ($w < $T || $h < $T) { |