… | |
… | |
53 | -M "$path.pst" < -M $path |
53 | -M "$path.pst" < -M $path |
54 | && Storable::retrieve "$path.pst" |
54 | && Storable::retrieve "$path.pst" |
55 | } or do { |
55 | } or do { |
56 | my %pak; |
56 | my %pak; |
57 | |
57 | |
58 | open my $fh, "<:raw", $path |
58 | open my $fh, "<:raw:perlio", $path |
59 | or die "$_[0]: $!"; |
59 | or die "$_[0]: $!"; |
60 | while (<$fh>) { |
60 | while (<$fh>) { |
61 | my ($type, $id, $len, $path) = split; |
61 | my ($type, $id, $len, $path) = split; |
62 | $path =~ s/.*\///; |
62 | $path =~ s/.*\///; |
63 | read $fh, $pak{$path}, $len; |
63 | read $fh, $pak{$path}, $len; |
… | |
… | |
76 | -M "$path.pst" < -M $path |
76 | -M "$path.pst" < -M $path |
77 | && Storable::retrieve "$path.pst" |
77 | && Storable::retrieve "$path.pst" |
78 | } or do { |
78 | } or do { |
79 | my %smooth; |
79 | my %smooth; |
80 | |
80 | |
81 | open my $fh, "<:raw", $path |
81 | open my $fh, "<:raw:perlio", $path |
82 | or die "$path: $!"; |
82 | or die "$path: $!"; |
83 | while (<$fh>) { |
83 | while (<$fh>) { |
84 | next if /^\s*($|#)/; |
84 | next if /^\s*($|#)/; |
85 | |
85 | |
86 | $smooth{$1} = $2 if /^(\S+)\s+(\S+)$/; |
86 | $smooth{$1} = $2 if /^(\S+)\s+(\S+)$/; |
… | |
… | |
102 | && Storable::retrieve "$path.pst" |
102 | && Storable::retrieve "$path.pst" |
103 | } or do { |
103 | } or do { |
104 | my %arc; |
104 | my %arc; |
105 | my ($more, $prev); |
105 | my ($more, $prev); |
106 | |
106 | |
107 | open my $fh, "<:raw", $path |
107 | open my $fh, "<:utf8", $path |
108 | or die "$path: $!"; |
108 | or die "$path: $!"; |
109 | |
109 | |
110 | my $parse_block; $parse_block = sub { |
110 | my $parse_block; $parse_block = sub { |
111 | my %arc = @_; |
111 | my %arc = @_; |
112 | |
112 | |
… | |
… | |
387 | |
387 | |
388 | for my $file (@ARGV) { |
388 | for my $file (@ARGV) { |
389 | my $mapa = read_arch $file; |
389 | my $mapa = read_arch $file; |
390 | my ($pb, $meta) = cfmap_render $mapa, $file; |
390 | my ($pb, $meta) = cfmap_render $mapa, $file; |
391 | $pb->save ("$file.png~~", "png"); |
391 | $pb->save ("$file.png~~", "png"); |
392 | system "convert", "$file.png~~", "-filter" => "lanczos", "-geometry" => "3.125%", "-quality" => 85, "$file.jpg"; |
392 | system "gm", "convert", "$file.png~~", "-filter" => "lanczos", "-geometry" => "3.125%", "-quality" => 85, "$file.jpg"; |
393 | #system "mogrify", "-colors" => 65536, "$file.png~"; # destroys transparency |
393 | #system "mogrify", "-colors" => 65536, "$file.png~"; # destroys transparency |
394 | system "pngcrush", "-q", "-m" => 7, "-rem", "alla", "-cc", "-reduce", "$file.png~~", "$file.png~"; |
394 | system "pngcrush", "-q", "-m" => 7, "-rem", "alla", "-cc", "-reduce", "$file.png~~", "$file.png~"; |
395 | # system "pngnq <\Q$file.png~\E >\Q$file.png\E"; |
395 | # system "pngnq <\Q$file.png~\E >\Q$file.png\E"; |
396 | unlink "$file.png~~"; |
396 | unlink "$file.png~~"; |
397 | Storable::nstore $meta, "$file.pst"; |
397 | Storable::nstore $meta, "$file.pst"; |