… | |
… | |
463 | $a->{_face} = $face->{idx}; |
463 | $a->{_face} = $face->{idx}; |
464 | |
464 | |
465 | if ($face->{w} > 1 || $face->{h} > 1) { |
465 | if ($face->{w} > 1 || $face->{h} > 1) { |
466 | # bigfaces |
466 | # bigfaces |
467 | |
467 | |
468 | my $more = $a->{_more} = []; |
|
|
469 | for my $ox (0 .. $face->{w} - 1) { |
468 | for my $ox (0 .. $face->{w} - 1) { |
470 | for my $oy (0 .. $face->{h} - 1) { |
469 | for my $oy (0 .. $face->{h} - 1) { |
471 | next unless $x || $oy; |
470 | next unless $x || $oy; |
472 | push @$more, [$x+$ox, $y+$oy]; |
471 | push @{ $a->{_more} }, [$x+$ox, $y+$oy]; |
473 | push @{ $data->[$x+$ox][$y+$oy] }, { |
472 | push @{ $data->[$x+$ox][$y+$oy] }, { |
474 | _virtual => $a, |
473 | _virtual => $a, |
475 | _virtual_x => $x, |
474 | _virtual_x => $x, |
476 | _virtual_y => $y, |
475 | _virtual_y => $y, |
477 | _face => $face->{idx} + $ox + $oy * $face->{w}, |
476 | _face => $face->{idx} + $ox + $oy * $face->{w}, |
… | |
… | |
480 | } |
479 | } |
481 | |
480 | |
482 | } elsif ($o->{more}) { |
481 | } elsif ($o->{more}) { |
483 | # linked faces, slowest and most annoying |
482 | # linked faces, slowest and most annoying |
484 | |
483 | |
485 | my $more = $a->{_more} = []; |
|
|
486 | while ($o = $o->{more}) { |
484 | while ($o = $o->{more}) { |
487 | my $face = $FACE{$o->{face}} |
485 | my $face = $FACE{$o->{face}} |
488 | or (warn "no gfx found for arch '$a->{_name}' at ($x*|$y*)\n"), next; |
486 | or (warn "no gfx found for arch '$a->{_name}' at ($x*|$y*)\n"), next; |
489 | |
487 | |
490 | $x1 = min $x1, $x+$o->{x}; $y1 = min $y1, $y+$o->{y}; |
488 | $x1 = min $x1, $x+$o->{x}; $y1 = min $y1, $y+$o->{y}; |
491 | $x2 = max $x2, $x+$o->{x}; $y2 = max $y2, $y+$o->{y}; |
489 | $x2 = max $x2, $x+$o->{x}; $y2 = max $y2, $y+$o->{y}; |
492 | |
490 | |
493 | push @$more, [$x+$o->{x}, $y+$o->{y}]; |
491 | push @{ $a->{_more} }, [$x+$o->{x}, $y+$o->{y}]; |
494 | push @{ $data->[$x+$o->{x}][$y+$o->{y}] }, { |
492 | push @{ $data->[$x+$o->{x}][$y+$o->{y}] }, { |
495 | _virtual => $a, |
493 | _virtual => $a, |
496 | _virtual_x => $x, |
494 | _virtual_x => $x, |
497 | _virtual_y => $y, |
495 | _virtual_y => $y, |
498 | _face => $face->{idx}, |
496 | _face => $face->{idx}, |