• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

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

Go で書き直した Ikemen


コミットメタ情報

リビジョン72a56b9d103b64c74e5232544867925793d88a1b (tree)
日時2019-02-25 20:13:41
作者neatunsou <sisiy4excite@gmai...>
コミッターneatunsou

ログメッセージ

ProjectileがPauseで止まらないのを修正
Explod、Projectile、Helperのremappalが機能するようにした
localcoordが違うキャラにKOされた時吹っ飛び量がおかしいのを修正
Superpauseのデフォルトanim番号が実際は100だったので修正
スクリーンパックが描画されない不具合を修正

変更サマリ

差分

--- a/src/bytecode.go
+++ b/src/bytecode.go
@@ -2220,6 +2220,7 @@ const (
22202220 helper_pausemovetime
22212221 helper_supermovetime
22222222 helper_redirectid
2223+ helper_remappal
22232224 )
22242225
22252226 func (sc helper) Run(c *Char, _ []int32) bool {
@@ -2230,6 +2231,7 @@ func (sc helper) Run(c *Char, _ []int32) bool {
22302231 var f, st int32 = 1, 0
22312232 op := false
22322233 var x, y float32 = 0, 0
2234+ rp := [...]int32{-1, 0}
22332235 StateControllerBase(sc).run(c, func(id byte, exp []BytecodeExp) bool {
22342236 if h == nil {
22352237 if id == helper_redirectid {
@@ -2301,6 +2303,11 @@ func (sc helper) Run(c *Char, _ []int32) bool {
23012303 h.pauseMovetime = exp[0].evalI(c)
23022304 case helper_supermovetime:
23032305 h.superMovetime = exp[0].evalI(c)
2306+ case helper_remappal:
2307+ rp[0] = exp[0].evalI(c)
2308+ if len(exp) > 1 {
2309+ rp[1] = exp[1].evalI(c)
2310+ }
23042311 }
23052312 return true
23062313 })
@@ -2314,7 +2321,7 @@ func (sc helper) Run(c *Char, _ []int32) bool {
23142321 h.localscl = crun.localscl
23152322 h.localcoord = crun.localcoord
23162323 }
2317- crun.helperInit(h, st, pt, x, y, f, op)
2324+ crun.helperInit(h, st, pt, x, y, f, op, rp)
23182325 return false
23192326 }
23202327
@@ -4591,7 +4598,7 @@ func (sc superPause) Run(c *Char, _ []int32) bool {
45914598 crun := c
45924599 var t, mt int32 = 30, 0
45934600 uh := true
4594- sys.superanim, sys.superpmap.remap = crun.getAnim(30, true), nil
4601+ sys.superanim, sys.superpmap.remap = crun.getAnim(100, true), nil
45954602 sys.superpos, sys.superfacing = [...]float32{crun.pos[0] * crun.localscl, crun.pos[1] * crun.localscl}, crun.facing
45964603 sys.superpausebg, sys.superendcmdbuftime, sys.superdarken = true, 0, true
45974604 sys.superp2defmul = sys.super_TargetDefenceMul
--- a/src/char.go
+++ b/src/char.go
@@ -1124,17 +1124,17 @@ func (p *Projectile) setPos(pos [2]float32) {
11241124 p.pos, p.oldPos, p.newPos = pos, pos, pos
11251125 }
11261126 func (p *Projectile) paused(playerNo int) bool {
1127- if !sys.chars[playerNo][0].pause() {
1128- if sys.super > 0 {
1129- if p.supermovetime == 0 {
1130- return true
1131- }
1132- } else if sys.pause > 0 {
1133- if p.pausemovetime == 0 {
1134- return true
1135- }
1127+ //if !sys.chars[playerNo][0].pause() {
1128+ if sys.super > 0 {
1129+ if p.supermovetime == 0 {
1130+ return true
1131+ }
1132+ } else if sys.pause > 0 {
1133+ if p.pausemovetime == 0 {
1134+ return true
11361135 }
11371136 }
1137+ //}
11381138 return false
11391139 }
11401140 func (p *Projectile) update(playerNo int) {
@@ -2854,7 +2854,7 @@ func (c *Char) helperPos(pt PosType, pos [2]float32, facing int32,
28542854 return
28552855 }
28562856 func (c *Char) helperInit(h *Char, st int32, pt PosType, x, y float32,
2857- facing int32, ownpal bool) {
2857+ facing int32, ownpal bool, rp [2]int32) {
28582858 p := c.helperPos(pt, [...]float32{x, y}, facing, &h.facing, h.localscl, false)
28592859 h.setX(p[0])
28602860 h.setY(p[1])
@@ -2864,6 +2864,7 @@ func (c *Char) helperInit(h *Char, st int32, pt PosType, x, y float32,
28642864 tmp := c.getPalfx().remap
28652865 h.palfx.remap = make([]int, len(tmp))
28662866 copy(h.palfx.remap, tmp)
2867+ c.forceRemapPal(h.palfx, rp)
28672868 }
28682869 h.changeStateEx(st, c.playerNo, 0, 1)
28692870 }
@@ -2905,7 +2906,7 @@ func (c *Char) insertExplodEx(i int, rp [2]int32) {
29052906 copy(remap, e.palfx.remap)
29062907 e.palfx = newPalFX()
29072908 e.palfx.remap = remap
2908- c.remapPal(e.palfx, [...]int32{1, 1}, rp)
2909+ c.forceRemapPal(e.palfx, rp)
29092910 }
29102911 if e.ontop {
29112912 td := &sys.topexplDrawlist[c.playerNo]
@@ -3115,7 +3116,7 @@ func (c *Char) projInit(p *Projectile, pt PosType, x, y float32,
31153116 copy(remap, p.palfx.remap)
31163117 p.palfx = newPalFX()
31173118 p.palfx.remap = remap
3118- c.remapPal(p.palfx, [...]int32{1, 1}, [...]int32{rpg, rpn})
3119+ c.forceRemapPal(p.palfx, [...]int32{rpg, rpn})
31193120 }
31203121 }
31213122 func (c *Char) setHitdefDefault(hd *HitDef, proj bool) {
@@ -3794,6 +3795,22 @@ func (c *Char) remapPal(pfx *PalFX, src [2]int32, dst [2]int32) {
37943795 c.gi().sff.palList.SwapPalMap(&pfx.remap)
37953796 }
37963797 }
3798+func (c *Char) forceRemapPal(pfx *PalFX, dst [2]int32) {
3799+ if dst[0] < 0 || dst[1] < 0 {
3800+ return
3801+ }
3802+ di, ok := c.gi().sff.palList.PalTable[[...]int16{int16(dst[0]),
3803+ int16(dst[1])}]
3804+ if !ok {
3805+ return
3806+ }
3807+ if pfx.remap == nil {
3808+ pfx.remap = c.gi().sff.palList.GetPalMap()
3809+ }
3810+ for i := range pfx.remap {
3811+ pfx.remap[i] = di
3812+ }
3813+}
37973814 func (c *Char) inGuardState() bool {
37983815 return c.ss.no == 120 || (c.ss.no >= 130 && c.ss.no <= 132) ||
37993816 c.ss.no == 140 || (c.ss.no >= 150 && c.ss.no <= 155)
@@ -5039,12 +5056,12 @@ func (cl *CharList) clsn(getter *Char, proj bool) {
50395056 }
50405057 if getter.ss.stateType == ST_A {
50415058 if getter.ghv.xvel < 0 {
5042- getter.ghv.xvel -= 2 / c.localscl * getter.localscl
5059+ getter.ghv.xvel -= 2 * getter.localscl
50435060 }
50445061 if getter.ghv.yvel <= 0 {
5045- getter.ghv.yvel -= 2 / c.localscl * getter.localscl
5046- if getter.ghv.yvel > -3 {
5047- getter.ghv.yvel = -3 / c.localscl * getter.localscl
5062+ getter.ghv.yvel -= 2 * getter.localscl
5063+ if getter.ghv.yvel > -3*getter.localscl {
5064+ getter.ghv.yvel = -3 * getter.localscl
50485065 }
50495066 }
50505067 } else {
@@ -5052,12 +5069,12 @@ func (cl *CharList) clsn(getter *Char, proj bool) {
50525069 getter.ghv.xvel *= 0.66
50535070 }
50545071 if getter.ghv.xvel < 0 {
5055- getter.ghv.xvel -= 2.5 / c.localscl * getter.localscl
5072+ getter.ghv.xvel -= 2.5 * getter.localscl
50565073 }
50575074 if getter.ghv.yvel <= 0 {
5058- getter.ghv.yvel -= 2 / c.localscl * getter.localscl
5059- if getter.ghv.yvel > -6 {
5060- getter.ghv.yvel = -6 / c.localscl * getter.localscl
5075+ getter.ghv.yvel -= 2 * getter.localscl
5076+ if getter.ghv.yvel > -6*getter.localscl {
5077+ getter.ghv.yvel = -6 * getter.localscl
50615078 }
50625079 }
50635080 }
--- a/src/compiler.go
+++ b/src/compiler.go
@@ -3471,6 +3471,10 @@ func (c *Compiler) helper(is IniSection, sc *StateControllerBase,
34713471 helper_supermovetime, VT_Int, 1, false); err != nil {
34723472 return err
34733473 }
3474+ if err := c.paramValue(is, sc, "remappal",
3475+ helper_remappal, VT_Int, 2, false); err != nil {
3476+ return err
3477+ }
34743478 return nil
34753479 })
34763480 return *ret, err
--- a/src/render.go
+++ b/src/render.go
@@ -132,8 +132,6 @@ func RenderInit() {
132132 mugenShader = link(vertObj, fragObj)
133133 posattLocation = gl.GetAttribLocationARB(mugenShader, gl.Str("position\x00"))
134134 uvattLocation = gl.GetAttribLocationARB(mugenShader, gl.Str("uv\x00"))
135- gl.EnableVertexAttribArrayARB(uint32(posattLocation))
136- gl.EnableVertexAttribArrayARB(uint32(uvattLocation))
137135 uniformA = gl.GetUniformLocationARB(mugenShader, gl.Str("a\x00"))
138136 uniformPal = gl.GetUniformLocationARB(mugenShader, gl.Str("pal\x00"))
139137 uniformMsk = gl.GetUniformLocationARB(mugenShader, gl.Str("msk\x00"))
@@ -169,6 +167,8 @@ func drawQuads(x1, y1, x2, y2, x3, y3, x4, y4 float32, renderMode int32) {
169167 case 2:
170168 gl.Uniform4fARB(uniformX1x2x4x3, x1, x2, x4, x3)
171169 }
170+ gl.EnableVertexAttribArrayARB(uint32(posattLocation))
171+ gl.EnableVertexAttribArrayARB(uint32(uvattLocation))
172172 gl.VertexAttribPointerARB(uint32(posattLocation), 2, gl.FLOAT, false, 0, unsafe.Pointer(&vertexPosition[0]))
173173 gl.VertexAttribPointerARB(uint32(uvattLocation), 2, gl.FLOAT, false, 0, unsafe.Pointer(&vertexUv[0]))
174174