… | |
… | |
643 | |
643 | |
644 | # create a stack of stones |
644 | # create a stack of stones |
645 | sub create_stack { |
645 | sub create_stack { |
646 | my ($self, $mark, $size, $rand) = @_; |
646 | my ($self, $mark, $size, $rand) = @_; |
647 | |
647 | |
|
|
648 | my $shadow = $size * 0.06; |
|
|
649 | |
648 | my $c = \$self->{stack}{$mark}; |
650 | my $c = \$self->{stack}{$mark}; |
649 | unless ($$c) { |
651 | unless ($$c) { |
650 | for my $stone ($mark & (MARK_W | MARK_GRAY_W) ? @::white_img : @::black_img) { |
652 | for my $stone ($mark & (MARK_W | MARK_GRAY_W) ? @::white_img : @::black_img) { |
651 | my $base = new_pixbuf $size, $size, 1, 1; |
653 | my $base = new_pixbuf $size + $shadow, $size + $shadow, 1, 1; |
|
|
654 | |
|
|
655 | # zeroeth the shadow |
|
|
656 | $::black_img[0]->composite ( |
|
|
657 | $base, $shadow, $shadow, $size, $size, $shadow-0.5, $shadow-0.5, |
|
|
658 | $size / $stone->get_width, $size / $stone->get_height, |
|
|
659 | INTERP_TILES, 128 |
|
|
660 | ); |
652 | |
661 | |
653 | # first the big stones |
662 | # first the big stones |
654 | for ([MARK_B, 255], |
663 | for ([MARK_B, 255], |
655 | [MARK_W, 255], |
664 | [MARK_W, 255], |
656 | [MARK_GRAY_B, 128], |
665 | [MARK_GRAY_B, 128], |
… | |
… | |
798 | |
807 | |
799 | if ($mark) { |
808 | if ($mark) { |
800 | my ($dx, $dy) = ($k[$x] - $ofs, $k[$y] - $ofs); |
809 | my ($dx, $dy) = ($k[$x] - $ofs, $k[$y] - $ofs); |
801 | my $pb = $self->create_stack($mark, $edge, $x * 17 + $y * 11 ); |
810 | my $pb = $self->create_stack($mark, $edge, $x * 17 + $y * 11 ); |
802 | |
811 | |
803 | $pb->composite ($pixbuf, $dx, $dy, $edge, $edge, $dx, $dy, 1, 1, INTERP_NEAREST, 255); |
812 | $pb->composite ($pixbuf, $dx, $dy, $pb->get_width, $pb->get_height, |
|
|
813 | $dx, $dy, 1, 1, INTERP_NEAREST, 255); |
804 | |
814 | |
805 | #my ($pm, $bm) = $self->create_stack($gc, $mark, $edge, $x * 17 + $y * 11 ); |
815 | #my ($pm, $bm) = $self->create_stack($gc, $mark, $edge, $x * 17 + $y * 11 ); |
806 | |
816 | |
807 | #$gc->set_clip_mask ($bm); |
817 | #$gc->set_clip_mask ($bm); |
808 | #$gc->set_clip_origin ($dx, $dy); |
818 | #$gc->set_clip_origin ($dx, $dy); |