Go で書き直した Ikemen
修订版 | bc923fd469bf51ce4d655692b10504a70c9b1ecc (tree) |
---|---|
时间 | 2018-12-20 23:13:11 |
作者 | neatunsou <sisiy4excite@gmai...> |
Commiter | neatunsou |
ミスがあったので修正
@@ -539,6 +539,9 @@ func (a *Animation) UpdateSprite() { | ||
539 | 539 | if a.drawidx+1 == i { |
540 | 540 | a.interpolate_blend_srcalpha += (float32(a.frames[a.drawidx+1].SrcAlpha) - a.interpolate_blend_srcalpha) / float32(a.curFrame().Time) * float32(a.time) |
541 | 541 | a.interpolate_blend_dstalpha += (float32(a.frames[a.drawidx+1].DstAlpha) - a.interpolate_blend_dstalpha) / float32(a.curFrame().Time) * float32(a.time) |
542 | + if byte(a.interpolate_blend_srcalpha) == 1 && byte(a.interpolate_blend_dstalpha) == 255 { | |
543 | + a.interpolate_blend_srcalpha = 0 | |
544 | + } | |
542 | 545 | break |
543 | 546 | } |
544 | 547 | } |
@@ -600,9 +603,6 @@ func (a *Animation) alpha() int32 { | ||
600 | 603 | } else { |
601 | 604 | sa = byte(a.interpolate_blend_srcalpha) |
602 | 605 | da = byte(a.interpolate_blend_dstalpha) |
603 | - if sa == 1 && da == 255 { | |
604 | - sa = 0 | |
605 | - } | |
606 | 606 | } |
607 | 607 | if sa == 1 && da == 255 { |
608 | 608 | return -2 |