… | |
… | |
637 | } |
637 | } |
638 | |
638 | |
639 | sub map_scroll { |
639 | sub map_scroll { |
640 | my ($self, $dx, $dy) = @_; |
640 | my ($self, $dx, $dy) = @_; |
641 | |
641 | |
642 | $self->{map}->scroll ($dx, $dy); |
642 | $self->{map_widget}->scroll ($dx, $dy); |
643 | } |
643 | } |
644 | |
644 | |
645 | sub feed_map1a { |
645 | sub feed_map1a { |
646 | my ($self, $data) = @_; |
646 | my ($self, $data) = @_; |
647 | |
647 | |
… | |
… | |
694 | my $data = $self->{map}->get_rect ($x, $y, $w, $h); |
694 | my $data = $self->{map}->get_rect ($x, $y, $w, $h); |
695 | |
695 | |
696 | if ($data ne $$rdata) { |
696 | if ($data ne $$rdata) { |
697 | $map_info->[1] = \$data; |
697 | $map_info->[1] = \$data; |
698 | my $cdata = Compress::LZF::compress $data; |
698 | my $cdata = Compress::LZF::compress $data; |
699 | warn "db_put $hash $x $y ", length $data, " > ", length $cdata; |
|
|
700 | DC::DB::put $self->{mapcache} => $hash => $cdata, sub { }; |
699 | DC::DB::put $self->{mapcache} => $hash => $cdata, sub { }; |
701 | } |
700 | } |
702 | } |
701 | } |
703 | } |
702 | } |
704 | |
703 | |
… | |
… | |
742 | |
741 | |
743 | my $map_info = $self->{map_cache}{$hash} = [$hash, \"", $x, $y, $w, $h]; |
742 | my $map_info = $self->{map_cache}{$hash} = [$hash, \"", $x, $y, $w, $h]; |
744 | |
743 | |
745 | my $cb = sub { |
744 | my $cb = sub { |
746 | $map_info->[1] = \$_[0]; |
745 | $map_info->[1] = \$_[0]; |
747 | |
|
|
748 | return if 2505 == length $_[0];#d# |
|
|
749 | warn "map_cache $hash $x $y $w $h ", length $_[0];#d# |
|
|
750 | |
746 | |
751 | my $inprogress = @{ $self->{bg_fetch} || [] }; |
747 | my $inprogress = @{ $self->{bg_fetch} || [] }; |
752 | unshift @{ $self->{bg_fetch} }, $self->{map}->set_rect ($x, $y, $_[0]); |
748 | unshift @{ $self->{bg_fetch} }, $self->{map}->set_rect ($x, $y, $_[0]); |
753 | $self->bg_fetch unless $inprogress; |
749 | $self->bg_fetch unless $inprogress; |
754 | }; |
750 | }; |