… | |
… | |
345 | my $ov = $self->{face} ||= []; |
345 | my $ov = $self->{face} ||= []; |
346 | my $ext = $self->{face_extents} ||= []; |
346 | my $ext = $self->{face_extents} ||= []; |
347 | |
347 | |
348 | # extend update area as neccessary to include all bigfaces |
348 | # extend update area as neccessary to include all bigfaces |
349 | # that overlap the update area |
349 | # that overlap the update area |
|
|
350 | for (;;) { |
|
|
351 | my $redo; |
350 | for my $x ($x1 .. $x2) { |
352 | for my $x ($x1 .. $x2) { |
351 | my $col = $ext->[$x] ||= []; |
353 | my $col = $ext->[$x] ||= []; |
352 | for my $y ($y1 .. $y2) { |
354 | for my $y ($y1 .. $y2) { |
353 | if (my $ext = $col->[$y]) { |
355 | if (my $ext = $col->[$y]) { |
354 | $x1 = $ext->[0] if $ext->[0] < $x1; |
356 | ($redo = 1), ($x1 = $ext->[0]) if $ext->[0] < $x1; |
355 | $y1 = $ext->[1] if $ext->[1] < $y1; |
357 | ($redo = 1), ($y1 = $ext->[1]) if $ext->[1] < $y1; |
356 | $x2 = $ext->[2] if $ext->[2] > $x2; |
358 | ($redo = 1), ($x2 = $ext->[2]) if $ext->[2] > $x2; |
357 | $y2 = $ext->[3] if $ext->[3] > $y2; |
359 | ($redo = 1), ($y2 = $ext->[3]) if $ext->[3] > $y2; |
|
|
360 | } |
|
|
361 | |
|
|
362 | # reset extents |
|
|
363 | $col->[$y] = [$x, $y, $x, $y]; |
358 | } |
364 | } |
359 | |
365 | } |
360 | # reset extents |
366 | $redo or last; |
361 | $col->[$y] = [$x, $y, $x, $y]; |
|
|
362 | } |
|
|
363 | } |
367 | } |
364 | |
368 | |
365 | my $TC = \%Crossfire::Tilecache::TILECACHE; |
369 | my $TC = \%Crossfire::Tilecache::TILECACHE; |
366 | |
370 | |
367 | $self->queue_draw_area ( |
371 | $self->queue_draw_area ( |