Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Trans sctrl during hitpause bug #1443

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/char.go
Original file line number Diff line number Diff line change
Expand Up @@ -5720,6 +5720,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
Loading