### base blitter
package blitter;

sub new 
{
    my $class = shift;
    my $self = {
               };
                
    bless $self, $class;
    return $self;
}

sub blit 
{
	my ($self, $gfxbuffer) = @_;

	my $len = length($gfxbuffer);
	my $vvlen = 0 - $len;

	while (--$len >= 0) {
		my $el = $gfxbuffer->{bytes}[-$vvlen++];
		$gfxbufferwriter->write_byte($el);
	}

	if ($len != 0) {
		print "*** blitter : gfxbuffer not fully run through";
		print "*** may crash or exit\n";

		return -1;
	} else {
		return 0;
	}
}

1;
