# # makeFullBackBuffer # # return a fullscreen attribute and a fullscreen text backbuffers using all the miniwins' backbuffer content. sub makeFullBackBuffer { my ($self) = @_; my (@backAtt, @backTxt, $screen, $current, $destCol, $destRow, $active); $screen = $self->{'miniwin'}[0]; for (1..$screen->{'height'}) { push @backTxt, ' ' x $screen->{'width'}; push @backAtt, [(0) x $screen->{'width'}]; } for $active (reverse @{$self->{'winStack'}}) { $current=$self->{'miniwin'}[$active]; for my $row (1..$current->{'height'}) { for my $col (1..$current->{'width'}) { $destCol = $current->{'colTop'} + $col - 2; if ($destCol > $screen->{'width'}) { $destCol = $screen->{'width'}; } $destRow = $current->{'rowTop'} + $row - 2; if ($destRow>$screen->{'height'}) { $destRow = $screen->{'height'}; } $backAtt[$destRow][$destCol] = $current->{'backAtt'}[$row - 1][$col - 1]; $self->{'zBuffer'}[$destRow][$destCol] = $active; substr($backTxt[$destRow], $destCol, 1) = substr($current->{'backTxt'}[$row - 1],$col - 1, 1); } } } return \(@backAtt,@backTxt); }