• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Go で書き直した Ikemen


Commit MetaInfo

Révision69944c7414994b41b670671299fa689e338d81eb (tree)
l'heure2018-10-18 20:14:33
Auteurneatunsou <sisiy4excite@gmai...>
Commiterneatunsou

Message de Log

AIRの透過処理が影に反映されるようにした(MUGEN1.1の仕様)
影に反映される透過の基準をデスティネーションアルファにした
maskwindowの幅が1ドットズレてるのを修正した
windowの縁がズームアウトすると正確でなくなるのを修正した
winmugen仕様キャラと判定するとangledrawでAIRの透過が外れる処理を無くした
(新MUGENでの動作を前提としながらmugenversionをwinmugenのままにしているキャラで不具合が起きるため)

Change Summary

Modification

--- a/src/anim.go
+++ b/src/anim.go
@@ -591,7 +591,7 @@ func (a *Animation) alpha() int32 {
591591 if a.srcAlpha >= 0 {
592592 sa = byte(a.srcAlpha)
593593 if a.dstAlpha < 0 {
594- da = byte((^a.dstAlpha + int16(a.frames[a.drawidx].DstAlpha)) >> 1)
594+ da = byte((^a.dstAlpha + int16(a.interpolate_blend_dstalpha)) >> 1)
595595 if sa == 1 && da == 255 {
596596 sa = 0
597597 }
@@ -885,6 +885,9 @@ func (sl ShadowList) draw(x, y, scl float32) {
885885 for _, s := range sl {
886886 intensity := sys.stage.sdw.intensity
887887 color, alpha := s.shadowColor, s.shadowAlpha
888+ if alpha >= 255 {
889+ alpha = int32(255 - s.anim.interpolate_blend_dstalpha)
890+ }
888891 fend := float32(sys.stage.sdw.fadeend) * sys.stage.localscl
889892 fbgn := float32(sys.stage.sdw.fadebgn) * sys.stage.localscl
890893 if fbgn <= fend {
--- a/src/char.go
+++ b/src/char.go
@@ -962,7 +962,7 @@ func (e *Explod) update(oldVer bool, playerNo int) {
962962 if (e.facing < 0) != (e.vfacing < 0) {
963963 agl *= -1
964964 }
965- sdwalp := alp[0]
965+ sdwalp := 255 - alp[1]
966966 if sdwalp < 0 {
967967 sdwalp = 256
968968 }
@@ -4378,10 +4378,10 @@ func (c *Char) cueDraw() {
43784378 c.aimg.recAfterImg(sdf())
43794379 }
43804380 } else {
4381- if c.gi().ver[0] != 1 && c.sf(CSF_angledraw) && !c.sf(CSF_trans) {
4382- c.setSF(CSF_trans)
4383- c.alpha = [...]int32{255, 0}
4384- }
4381+ //if c.gi().ver[0] != 1 && c.sf(CSF_angledraw) && !c.sf(CSF_trans) {
4382+ // c.setSF(CSF_trans)
4383+ // c.alpha = [...]int32{255, 0}
4384+ //}
43854385 sd := sdf()
43864386 c.aimg.recAndCue(sd, rec)
43874387 if c.ghv.hitshaketime > 0 && c.ss.time&1 != 0 {
@@ -4392,7 +4392,7 @@ func (c *Char) cueDraw() {
43924392 sc = 0
43934393 }
43944394 if c.sf(CSF_trans) {
4395- sa = c.alpha[0]
4395+ sa = 255 - c.alpha[1]
43964396 }
43974397 sys.sprites.add(sd, sc, sa, float32(c.size.shadowoffset), c.offsetY())
43984398 }
--- a/src/render.go
+++ b/src/render.go
@@ -1,9 +1,10 @@
11 package main
22
33 import (
4- "github.com/go-gl/gl/v2.1/gl"
54 "math"
65 "unsafe"
6+
7+ "github.com/go-gl/gl/v2.1/gl"
78 )
89
910 var notiling = [4]int32{0, 0, 0, 0}
--- a/src/stage.go
+++ b/src/stage.go
@@ -266,8 +266,8 @@ func readBackGround(is IniSection, link *backGround,
266266 }
267267 if is.readI32ForStage("maskwindow", &bg.startrect[0], &bg.startrect[1],
268268 &bg.startrect[2], &bg.startrect[3]) {
269- bg.startrect[2] = Max(0, bg.startrect[2]+1-bg.startrect[0])
270- bg.startrect[3] = Max(0, bg.startrect[3]+1-bg.startrect[1])
269+ bg.startrect[2] = Max(0, bg.startrect[2]-bg.startrect[0])
270+ bg.startrect[3] = Max(0, bg.startrect[3]-bg.startrect[1])
271271 bg.notmaskwindow = 0
272272 }
273273 is.readF32ForStage("windowdelta", &bg.windowdelta[0], &bg.windowdelta[1])
@@ -370,15 +370,12 @@ func (bg backGround) draw(pos [2]float32, scl, bgscl, lclscl float32,
370370 bgscl * lscl[i]
371371 }
372372 }
373- rect[0] = int32(math.Floor(float64((float32(rect[0]) -
374- (pos[0]+bg.camstartx)*bg.windowdelta[0] + (float32(sys.gameWidth)/2/sclx - float32(bg.notmaskwindow)*160*(1/lscl[0]))) * sys.widthScale * wscl[0])))
375- rect[1] = int32(math.Floor(float64(((float32(rect[1])-
376- pos[1]*bg.windowdelta[1]+(float32(sys.gameHeight)/scly-240))*wscl[1] - shakeY) *
377- sys.heightScale)))
378- rect[2] = int32(math.Ceil(float64(float32(rect[2]) * sys.widthScale *
379- wscl[0])))
380- rect[3] = int32(math.Ceil(float64(float32(rect[3]) * sys.heightScale *
381- wscl[1])))
373+ startrect0 := (float32(rect[0]) - (pos[0]+bg.camstartx)*bg.windowdelta[0] + (float32(sys.gameWidth)/2/sclx - float32(bg.notmaskwindow)*160*(1/lscl[0]))) * sys.widthScale * wscl[0]
374+ startrect1 := ((float32(rect[1])-pos[1]*bg.windowdelta[1]+(float32(sys.gameHeight)/scly-240))*wscl[1] - shakeY) * sys.heightScale
375+ rect[0] = int32(math.Floor(float64(startrect0)))
376+ rect[1] = int32(math.Floor(float64(startrect1)))
377+ rect[2] = int32(math.Floor(float64(startrect0 + (float32(rect[2]) * sys.widthScale * wscl[0]) - float32(rect[0]))))
378+ rect[3] = int32(math.Floor(float64(startrect1 + (float32(rect[3]) * sys.heightScale * wscl[1]) - float32(rect[1]))))
382379 bg.anim.Draw(&rect, x, y, sclx, scly, bg.xscale[0]*bgscl*(bg.scalestart[0]+xs)*xs3, xbs*bgscl*(bg.scalestart[0]+xs)*xs3, ys*(bg.scalestart[1]+ys2)*ys3,
383380 xras*x/(AbsF(ys*ys3)*lscl[1]*float32(bg.anim.spr.Size[1]))*sclx_recip,
384381 0, float32(sys.gameWidth)/2, &sys.bgPalFX, true)