… | |
… | |
173 | |
173 | |
174 | (my $base = $stem) =~ s/^.*\///; |
174 | (my $base = $stem) =~ s/^.*\///; |
175 | |
175 | |
176 | my $fi = $FACEINFO{$base}; |
176 | my $fi = $FACEINFO{$base}; |
177 | unless ($fi) { |
177 | unless ($fi) { |
178 | warn "$path: <$base> not referenced by any archetype, skipping.\n"; |
178 | #warn "$path: <$base> not referenced by any archetype, skipping.\n"; |
179 | next; |
179 | #next; |
180 | } |
180 | } |
181 | |
181 | |
182 | my $arc = $FACEINFO{$base}{arc} |
182 | my $arc = $fi->{arc} || { }; |
183 | or die "FATAL: internal error <$base>, cannot continue"; |
|
|
184 | |
183 | |
185 | unless ($path =~ /~$/) { |
184 | unless ($path =~ /~$/) { |
186 | # possibly enlarge |
185 | # possibly enlarge |
187 | if (0 > aio_stat "$stem.64x64.png") { |
186 | if (0 > aio_stat "$stem.64x64.png") { |
188 | my $other = "$stem.64x64.png~"; |
187 | my $other = "$stem.64x64.png~"; |
… | |
… | |
425 | facings => $facings, |
424 | facings => $facings, |
426 | frames => \@frames, |
425 | frames => \@frames, |
427 | }; |
426 | }; |
428 | } |
427 | } |
429 | |
428 | |
430 | for my $face ($o->{face} || (), @{$anim || []}) { |
429 | for ($o->{face} || (), @{$anim || []}) { |
431 | next if $face =~ /^facings\s/; |
430 | next if /^facings\s/; |
|
|
431 | |
|
|
432 | my $face = $_; |
|
|
433 | $face =~ s/\+\d+\+\d+$//; # remove tile offset coordinates |
432 | |
434 | |
433 | my $info = $FACEINFO{$face} ||= { }; |
435 | my $info = $FACEINFO{$face} ||= { }; |
434 | $info->{arc} = $o; |
436 | $info->{arc} = $o; |
435 | |
437 | |
436 | next if $face =~ /^blank.x11$|^empty.x11$/; |
438 | next if $face =~ /^blank.x11$|^empty.x11$/; |
… | |
… | |
492 | my ($dir, $file, $type) = @$job; |
494 | my ($dir, $file, $type) = @$job; |
493 | |
495 | |
494 | my $data; |
496 | my $data; |
495 | aio_load "$dir/$file", $data; |
497 | aio_load "$dir/$file", $data; |
496 | |
498 | |
|
|
499 | |
497 | my $meta = load_cached "$dir/meta", sub { JSON::XS::from_json shift }; |
500 | my $meta = load_cached "$dir/meta", sub { JSON::XS->new->utf8->relaxed->decode (shift) }; |
498 | |
501 | |
499 | next if $meta && !exists $meta->{$file}; |
502 | utf8::decode $dir; |
|
|
503 | utf8::decode $file; |
|
|
504 | |
|
|
505 | # a meta file for resources is now mandatory |
|
|
506 | unless (exists $meta->{$file}) { |
|
|
507 | warn "skipping $dir/$file\n" if $VERBOSE >= 3; |
|
|
508 | next; |
|
|
509 | } |
500 | |
510 | |
501 | $meta = { |
511 | $meta = { |
502 | %{ $meta->{"" } || {} }, |
512 | %{ $meta->{"" } || {} }, |
503 | %{ $meta->{$file} || {} }, |
513 | %{ $meta->{$file} || {} }, |
504 | }; |
514 | }; |