… | |
… | |
177 | my $base = new_pixbuf $size + $shadow, $size + $shadow, 1, 0x00000000; |
177 | my $base = new_pixbuf $size + $shadow, $size + $shadow, 1, 0x00000000; |
178 | |
178 | |
179 | # zeroeth the shadow |
179 | # zeroeth the shadow |
180 | if ($mark & (MARK_B | MARK_W)) { |
180 | if ($mark & (MARK_B | MARK_W)) { |
181 | $::black_img[0]->composite ( |
181 | $::black_img[0]->composite ( |
182 | $base, $shadow, $shadow, $size, $size, $shadow-0.5, $shadow-0.5, |
182 | $base, $shadow, $shadow, $size, $size, $shadow, $shadow, |
183 | $size / $stone->get_width, $size / $stone->get_height, |
183 | $size / $stone->get_width, $size / $stone->get_height, |
184 | $::config->{speed} ? INTERP_NEAREST : INTERP_BILINEAR, 128 |
184 | $::config->{speed} ? INTERP_NEAREST : INTERP_BILINEAR, 192 |
185 | ); |
185 | ); |
186 | } |
186 | } |
187 | |
187 | |
188 | # first the big stones (handicap stones different for effect) |
188 | # first the big stones (handicap stones different for effect) |
189 | for ([MARK_B, $mark & MARK_MOVE ? 255 : 192], |
189 | for ([MARK_B, $mark & MARK_MOVE ? 255 : 192], |
… | |
… | |
191 | [MARK_GRAY_B, 128], |
191 | [MARK_GRAY_B, 128], |
192 | [MARK_GRAY_W, 128]) { |
192 | [MARK_GRAY_W, 128]) { |
193 | my ($mask, $alpha) = @$_; |
193 | my ($mask, $alpha) = @$_; |
194 | if ($mark & $mask) { |
194 | if ($mark & $mask) { |
195 | $stone->composite ( |
195 | $stone->composite ( |
196 | $base, 0, 0, $size, $size, -0.5, -0.5, |
196 | $base, 0, 0, $size, $size, 0, 0, |
197 | $size / $stone->get_width, $size / $stone->get_height, |
197 | $size / $stone->get_width, $size / $stone->get_height, |
198 | $::config->{speed} ? INTERP_NEAREST : INTERP_BILINEAR, $alpha |
198 | $::config->{speed} ? INTERP_NEAREST : INTERP_BILINEAR, $alpha |
199 | ); |
199 | ); |
200 | } |
200 | } |
201 | } |
201 | } |
202 | |
202 | |
203 | # then the samll stones |
203 | # then the small stones |
204 | for ([MARK_SMALL_B, $::black_img[$rand % @::black_img]], |
204 | for ([MARK_SMALL_B, $::black_img[$rand % @::black_img]], |
205 | [MARK_SMALL_W, $::white_img[$rand % @::white_img]]) { |
205 | [MARK_SMALL_W, $::white_img[$rand % @::white_img]]) { |
206 | my ($mask, $img) = @$_; |
206 | my ($mask, $img) = @$_; |
207 | if ($mark & $mask) { |
207 | if ($mark & $mask) { |
208 | $img->composite ( |
208 | $img->composite ( |
209 | $base, ($size / 4) x2, (int ($size / 2 + 0.5)) x2, ($size / 4 - 0.5) x 2, |
209 | $base, ($size / 4) x2, (int ($size / 2 + 0.5)) x2, ($size / 4) x 2, |
210 | $size / $img->get_width / 2, $size / $img->get_height / 2, |
210 | $size / $img->get_width / 2, $size / $img->get_height / 2, |
211 | $::config->{speed} ? INTERP_NEAREST : INTERP_BILINEAR, 192 |
211 | $::config->{speed} ? INTERP_NEAREST : INTERP_BILINEAR, 192 |
212 | ); |
212 | ); |
213 | } |
213 | } |
214 | } |
214 | } |