Skip to content

Commit

Permalink
Merge pull request #1443 from Wftk/Fixes
Browse files Browse the repository at this point in the history
fix: Trans sctrl during hitpause bug
  • Loading branch information
K4thos committed Oct 16, 2023
2 parents 941fbaf + e9ee0d1 commit 2a4c409
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/char.go
Original file line number Diff line number Diff line change
Expand Up @@ -5721,6 +5721,10 @@ func (c *Char) actionPrepare() {
c.angleScale = [...]float32{1, 1}
c.offset = [2]float32{}
}
//Trans reset during hitpause if ignorehitpause = 0 fix
if c.sf(CSF_trans) && c.hitPause() {
c.unsetSF(CSF_trans)
}
}
c.dropTargets()
if c.downHitOffset != 0 {
Expand Down
5 changes: 1 addition & 4 deletions src/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,14 +360,11 @@ func renderWithBlending(render func(eq BlendEquation, src, dst BlendFunc, a floa
//Add1(128,128)
case trans < 255:
Blend = BlendAdd
if (invblend >= 2 || invblend <= -1) && acolor != nil && mcolor != nil {
if !isrgba && (invblend >= 2 || invblend <= -1) && acolor != nil && mcolor != nil {
src, dst := trans&0xff, trans>>10&0xff
//Summ of add components
gc := AbsF(acolor[0]) + AbsF(acolor[1]) + AbsF(acolor[2])
v3, al := MaxF((gc*255)-float32(dst+src), 512)/128, (float32(src+dst) / 255)
if isrgba {
v3 = 1
}
rM, gM, bM := mcolor[0]*al, mcolor[1]*al, mcolor[2]*al
(*mcolor)[0], (*mcolor)[1], (*mcolor)[2] = rM, gM, bM
render(BlendAdd, BlendZero, BlendOneMinusSrcAlpha, al)
Expand Down

0 comments on commit 2a4c409

Please sign in to comment.