… | |
… | |
300 | my ($x, $y) = split $;, $xy; |
300 | my ($x, $y) = split $;, $xy; |
301 | |
301 | |
302 | next if $x < 0 || $x >= $mapx |
302 | next if $x < 0 || $x >= $mapx |
303 | || $y < 0 || $y >= $mapy; |
303 | || $y < 0 || $y >= $mapy; |
304 | |
304 | |
305 | # bits is 00XX XXXX YYYY YYFX cccc CCCC BBBB |
305 | # bits is xxxx xxxx yyyy yyyy __fn cccc CCCC bbbb |
306 | # X don't draw |
|
|
307 | # F full tile draw with x|y bigface displacement |
306 | # f full tile draw with x|y bigface displacement |
308 | # c maybe draw these corners |
|
|
309 | # C do not draw these corners |
307 | # n do not draw borders&corners |
|
|
308 | # c draw these corners, but... |
|
|
309 | # C ... not these |
310 | # b draw these borders |
310 | # b draw these borders |
311 | |
311 | |
312 | if ($bits & 0x2000) { |
312 | if ($bits & 0x2000) { |
313 | my $dx = (($bits >> 24) & 0xff) - 128; |
313 | my $dx = (($bits >> 24) & 0xff) - 128; |
314 | my $dy = (($bits >> 16) & 0xff) - 128; |
314 | my $dy = (($bits >> 16) & 0xff) - 128; |
… | |
… | |
367 | my $mapa = read_arch $file; |
367 | my $mapa = read_arch $file; |
368 | my ($pb, $meta) = cfmap_render $mapa, $file; |
368 | my ($pb, $meta) = cfmap_render $mapa, $file; |
369 | $pb->save ("$file.png~", "png"); |
369 | $pb->save ("$file.png~", "png"); |
370 | system "convert", "$file.png~", "-filter" => "lanczos", "-geometry" => "3.125%", "-quality" => 85, "$file.jpg"; |
370 | system "convert", "$file.png~", "-filter" => "lanczos", "-geometry" => "3.125%", "-quality" => 85, "$file.jpg"; |
371 | #system "mogrify", "-colors" => 65536, "$file.png~"; # destroys transparency |
371 | #system "mogrify", "-colors" => 65536, "$file.png~"; # destroys transparency |
372 | system "pngcrush", "-q", "-m" => 7, "-rem", "alla", "-cc", "-reduce", "$file.png~", "$file.png"; |
372 | # system "pngcrush", "-q", "-m" => 7, "-rem", "alla", "-cc", "-reduce", "$file.png~", "$file.png"; |
|
|
373 | system "pngnq <\Q$file.png~\E >\Q$file.png\E"; |
373 | unlink "$file.png~"; |
374 | unlink "$file.png~"; |
374 | Storable::nstore $meta, "$file.pst"; |
375 | Storable::nstore $meta, "$file.pst"; |
375 | } |
376 | } |
376 | |
377 | |
377 | |
378 | |