Go で書き直した Ikemen
Révision | 604b73cbcf832bea49354e549884660530f7047e (tree) |
---|---|
l'heure | 2018-11-14 18:20:52 |
Auteur | neatunsou <sisiy4excite@gmai...> |
Commiter | neatunsou |
explodのspaceに対応
airのangleがfacingを参照していなかったのを修正
airのtimeが0だとスプライトを読み込まないようにした
ポーズ時にズームアウトが止まらないようにした
explodのScreen系のpostypeの挙動をMUGEN1.1基準に修正
screenposを修正
angleの処理をglrotateに変更
@@ -463,7 +463,7 @@ func (a *Animation) UpdateSprite() { | ||
463 | 463 | a.time, a.newframe, a.current = 0, true, 0 |
464 | 464 | } |
465 | 465 | } |
466 | - if a.newframe && a.sff != nil { | |
466 | + if a.newframe && a.sff != nil && a.frames[a.current].Time != 0 { | |
467 | 467 | a.spr = a.sff.GetSprite(a.curFrame().Group, a.curFrame().Number) |
468 | 468 | } |
469 | 469 | a.newframe, a.drawidx = false, a.current |
@@ -634,20 +634,20 @@ func (a *Animation) pal(pfx *PalFX, neg bool) (p []uint32) { | ||
634 | 634 | } |
635 | 635 | return pfx.getFxPal(p, neg) |
636 | 636 | } |
637 | -func (a *Animation) drawSub1(angle float32) (h, v, agl float32) { | |
637 | +func (a *Animation) drawSub1(angle, facing float32) (h, v, agl float32) { | |
638 | 638 | h, v = float32(a.frames[a.drawidx].H), float32(a.frames[a.drawidx].V) |
639 | 639 | agl = float32(float64(angle) * math.Pi / 180) |
640 | 640 | h *= a.scale_x |
641 | 641 | v *= a.scale_y |
642 | - agl += a.angle | |
642 | + agl += a.angle * facing | |
643 | 643 | return |
644 | 644 | } |
645 | 645 | func (a *Animation) Draw(window *[4]int32, x, y, xcs, ycs, xs, xbs, ys, |
646 | - rxadd, angle, rcx float32, pfx *PalFX, old bool) { | |
646 | + rxadd, angle, rcx float32, pfx *PalFX, old bool, facing float32) { | |
647 | 647 | if a.spr == nil || a.spr.Tex == nil { |
648 | 648 | return |
649 | 649 | } |
650 | - h, v, angle := a.drawSub1(angle) | |
650 | + h, v, angle := a.drawSub1(angle, facing) | |
651 | 651 | xs *= xcs * h |
652 | 652 | ys *= ycs * v |
653 | 653 | x = xcs*x + xs*(float32(a.frames[a.drawidx].X)+a.interpolate_offset_x)*(1/a.scale_x) |
@@ -698,11 +698,12 @@ func (a *Animation) Draw(window *[4]int32, x, y, xcs, ycs, xs, xbs, ys, | ||
698 | 698 | trans, window, rcx, rcy, pfx) |
699 | 699 | } |
700 | 700 | func (a *Animation) ShadowDraw(x, y, xscl, yscl, vscl, angle float32, |
701 | - pfx *PalFX, old bool, color uint32, alpha int32) { | |
701 | + pfx *PalFX, old bool, color uint32, alpha int32, facing float32) { | |
702 | 702 | if a.spr == nil || a.spr.Tex == nil { |
703 | 703 | return |
704 | 704 | } |
705 | - h, v, angle := a.drawSub1(angle) | |
705 | + h, v, angle := a.drawSub1(angle, facing) | |
706 | + angle = -angle | |
706 | 707 | x += xscl * h * (float32(a.frames[a.drawidx].X) + a.interpolate_offset_x) |
707 | 708 | y += yscl * vscl * v * (float32(a.frames[a.drawidx].Y) + a.interpolate_offset_y) |
708 | 709 | var draw func(int32) |
@@ -795,6 +796,7 @@ type SprData struct { | ||
795 | 796 | screen bool |
796 | 797 | bright bool |
797 | 798 | oldVer bool |
799 | + facing float32 | |
798 | 800 | } |
799 | 801 | type DrawList []*SprData |
800 | 802 |
@@ -849,7 +851,7 @@ func (dl DrawList) draw(x, y, scl float32) { | ||
849 | 851 | (y - s.pos[1])} |
850 | 852 | } |
851 | 853 | s.anim.Draw(&sys.scrrect, p[0], p[1], cs, cs, s.scl[0], s.scl[0], |
852 | - s.scl[1], 0, s.angle, float32(sys.gameWidth)/2, s.fx, s.oldVer) | |
854 | + s.scl[1], 0, s.angle, float32(sys.gameWidth)/2, s.fx, s.oldVer, s.facing) | |
853 | 855 | sys.brightness = ob |
854 | 856 | } |
855 | 857 | } |
@@ -910,8 +912,8 @@ func (sl ShadowList) draw(x, y, scl float32) { | ||
910 | 912 | s.anim.ShadowDraw(sys.cam.Offset[0]-(x-s.pos[0])*scl, |
911 | 913 | sys.cam.GroundLevel()+sys.cam.Offset[1]-sys.envShake.getOffset()- |
912 | 914 | (y+s.pos[1]*sys.stage.sdw.yscale-s.offsetY)*scl, |
913 | - scl*s.scl[0], scl*-s.scl[1], sys.stage.sdw.yscale, -s.angle, | |
914 | - &sys.bgPalFX, s.oldVer, uint32(color), intensity) | |
915 | + scl*s.scl[0], scl*-s.scl[1], sys.stage.sdw.yscale, s.angle, | |
916 | + &sys.bgPalFX, s.oldVer, uint32(color), intensity, s.facing) | |
915 | 917 | } |
916 | 918 | } |
917 | 919 | func (sl ShadowList) drawReflection(x, y, scl float32) { |
@@ -937,7 +939,7 @@ func (sl ShadowList) drawReflection(x, y, scl float32) { | ||
937 | 939 | s.anim.Draw(&sys.scrrect, sys.cam.Offset[0]/scl-(x-s.pos[0]), |
938 | 940 | (sys.cam.GroundLevel()+sys.cam.Offset[1]-sys.envShake.getOffset())/scl- |
939 | 941 | (y+s.pos[1]-s.offsetY), scl, scl, s.scl[0], s.scl[0], -s.scl[1], 0, |
940 | - -s.angle, float32(sys.gameWidth)/2, s.fx, s.oldVer) | |
942 | + -s.angle, float32(sys.gameWidth)/2, s.fx, s.oldVer, s.facing) | |
941 | 943 | } |
942 | 944 | } |
943 | 945 |
@@ -988,6 +990,6 @@ func (a *Anim) Draw() { | ||
988 | 990 | if !sys.frameSkip { |
989 | 991 | a.anim.Draw(&a.window, a.x+float32(sys.gameWidth-320)/2, |
990 | 992 | a.y+float32(sys.gameHeight-240), 1, 1, a.xscl, a.xscl, a.yscl, |
991 | - 0, 0, 0, nil, false) | |
993 | + 0, 0, 0, nil, false, 1) | |
992 | 994 | } |
993 | 995 | } |
@@ -1105,9 +1105,9 @@ func (be BytecodeExp) run(c *Char) BytecodeValue { | ||
1105 | 1105 | case OC_screenheight: |
1106 | 1106 | sys.bcStack.PushF(sys.screenHeight() / oc.localscl) |
1107 | 1107 | case OC_screenpos_x: |
1108 | - sys.bcStack.PushF(c.screenPosX()) | |
1108 | + sys.bcStack.PushF((c.screenPosX()) / oc.localscl) | |
1109 | 1109 | case OC_screenpos_y: |
1110 | - sys.bcStack.PushF(c.screenPosY()) | |
1110 | + sys.bcStack.PushF((c.screenPosY()) / oc.localscl) | |
1111 | 1111 | case OC_screenwidth: |
1112 | 1112 | sys.bcStack.PushF(sys.screenWidth() / oc.localscl) |
1113 | 1113 | case OC_selfanimexist: |
@@ -2245,6 +2245,7 @@ const ( | ||
2245 | 2245 | explod_xangle |
2246 | 2246 | explod_ignorehitpause |
2247 | 2247 | explod_bindid |
2248 | + explod_space | |
2248 | 2249 | ) |
2249 | 2250 | |
2250 | 2251 | func (sc explod) Run(c *Char, _ []int32) bool { |
@@ -2294,6 +2295,8 @@ func (sc explod) Run(c *Char, _ []int32) bool { | ||
2294 | 2295 | } |
2295 | 2296 | case explod_postype: |
2296 | 2297 | e.postype = PosType(exp[0].evalI(c)) |
2298 | + case explod_space: | |
2299 | + e.space = Space(exp[0].evalI(c)) | |
2297 | 2300 | case explod_velocity: |
2298 | 2301 | e.velocity[0] = exp[0].evalF(c) |
2299 | 2302 | if len(exp) > 1 { |
@@ -171,9 +171,10 @@ func (c *Camera) action(x, y *float32, leftest, rightest, lowest, highest, | ||
171 | 171 | sclMul = MinF(4.0/3, Pow((Pow(2, c.ZoomSpeed)+3)/Pow(2, c.ZoomSpeed)- |
172 | 172 | sclMul, 64)) |
173 | 173 | } |
174 | - if pause { | |
175 | - sclMul = 1 | |
176 | - } else if sclMul > 1 { | |
174 | + //if pause { | |
175 | + // sclMul = 1 | |
176 | + //} else if sclMul > 1 { | |
177 | + if sclMul > 1 { | |
177 | 178 | sclMul = (sclMul-1)*Pow(c.zoomdelay, 8) + 1 |
178 | 179 | if tmp*sclMul > sys.xmax-sys.xmin { |
179 | 180 | sclMul = (sys.xmax - sys.xmin) / tmp |
@@ -80,6 +80,14 @@ const ( | ||
80 | 80 | PT_N |
81 | 81 | ) |
82 | 82 | |
83 | +type Space int32 | |
84 | + | |
85 | +const ( | |
86 | + Space_none Space = iota | |
87 | + Space_stage | |
88 | + Space_screen | |
89 | +) | |
90 | + | |
83 | 91 | type ClsnRect [][4]float32 |
84 | 92 | |
85 | 93 | func (cr *ClsnRect) Add(clsn []float32, x, y, xs, ys float32) { |
@@ -775,7 +783,7 @@ func (ai *AfterImage) recAndCue(sd *SprData, rec bool) { | ||
775 | 783 | img := &ai.imgs[(ai.imgidx-i)&63] |
776 | 784 | sys.sprites.add(&SprData{&img.anim, &ai.palfx[i/ai.framegap-1], img.pos, |
777 | 785 | img.scl, ai.alpha, sd.priority - 2, img.angle, img.ascl, |
778 | - false, sd.bright, sd.oldVer}, 0, 0, 0, 0) | |
786 | + false, sd.bright, sd.oldVer, sd.facing}, 0, 0, 0, 0) | |
779 | 787 | } |
780 | 788 | if rec { |
781 | 789 | ai.recAfterImg(sd) |
@@ -793,6 +801,7 @@ type Explod struct { | ||
793 | 801 | accel [2]float32 |
794 | 802 | sprpriority int32 |
795 | 803 | postype PosType |
804 | + space Space | |
796 | 805 | offset [2]float32 |
797 | 806 | relativef int32 |
798 | 807 | pos [2]float32 |
@@ -817,7 +826,7 @@ type Explod struct { | ||
817 | 826 | |
818 | 827 | func (e *Explod) clear() { |
819 | 828 | *e = Explod{id: IErr, scale: [...]float32{1, 1}, removetime: -2, |
820 | - postype: PT_P1, relativef: 1, facing: 1, vfacing: 1, localscl: 1, | |
829 | + postype: PT_P1, relativef: 1, facing: 1, vfacing: 1, localscl: 1, space: Space_none, | |
821 | 830 | alpha: [...]int32{-1, 0}, playerId: -1, bindId: -1, ignorehitpause: true} |
822 | 831 | } |
823 | 832 | func (e *Explod) setX(x float32) { |
@@ -839,47 +848,69 @@ func (e *Explod) setPos(c *Char) { | ||
839 | 848 | lPos := func() { |
840 | 849 | e.setX(sys.cam.ScreenPos[0]/e.localscl + e.offset[0]/sys.cam.Scale) |
841 | 850 | e.setY(sys.cam.ScreenPos[1]/e.localscl + e.offset[1]/sys.cam.Scale) |
851 | + if e.bindtime == 0 { | |
852 | + e.bindtime = 1 | |
853 | + } | |
842 | 854 | } |
843 | 855 | rPos := func() { |
844 | 856 | e.setX(sys.cam.ScreenPos[0]/e.localscl + |
845 | 857 | (float32(sys.gameWidth)/e.localscl + e.offset[0]/sys.cam.Scale)) |
846 | 858 | e.setY(sys.cam.ScreenPos[1]/e.localscl + e.offset[1]/sys.cam.Scale) |
847 | - } | |
848 | - switch e.postype { | |
849 | - case PT_P1: | |
850 | - pPos(c) | |
851 | - case PT_P2: | |
852 | - if p2 := sys.charList.enemyNear(c, 0, true); p2 != nil { | |
853 | - pPos(p2) | |
859 | + if e.bindtime == 0 { | |
860 | + e.bindtime = 1 | |
854 | 861 | } |
855 | - case PT_F, PT_B: | |
856 | - e.facing = c.facing * float32(e.relativef) | |
857 | - // front と back はバインドの都合で left か right になおす | |
858 | - if c.facing > 0 && e.postype == PT_F || c.facing < 0 && e.postype == PT_B { | |
859 | - if e.postype == PT_B { | |
860 | - e.offset[0] *= -1 | |
862 | + } | |
863 | + if e.space >= Space_stage { | |
864 | + e.postype = PT_N | |
865 | + } | |
866 | + if e.space <= Space_none { | |
867 | + switch e.postype { | |
868 | + case PT_P1: | |
869 | + pPos(c) | |
870 | + case PT_P2: | |
871 | + if p2 := sys.charList.enemyNear(c, 0, true); p2 != nil { | |
872 | + pPos(p2) | |
861 | 873 | } |
862 | - e.postype = PT_R | |
863 | - rPos() | |
864 | - } else { | |
865 | - // explod の postype = front はキャラの向きで pos が反転しない | |
866 | - if e.postype == PT_F && c.gi().ver[0] != 1 { | |
874 | + case PT_F, PT_B: | |
875 | + e.facing = c.facing * float32(e.relativef) | |
876 | + // front と back はバインドの都合で left か right になおす | |
877 | + if c.facing > 0 && e.postype == PT_F || c.facing < 0 && e.postype == PT_B { | |
878 | + if e.postype == PT_B { | |
879 | + e.offset[0] *= -1 | |
880 | + } | |
881 | + e.postype = PT_R | |
882 | + rPos() | |
883 | + } else { | |
884 | + // explod の postype = front はキャラの向きで pos が反転しない | |
885 | + //if e.postype == PT_F && c.gi().ver[0] != 1 { | |
867 | 886 | // 旧バージョンだと front は キャラの向きが facing に反映されない |
887 | + // 1.1でも反映されてない模様 | |
868 | 888 | e.facing = float32(e.relativef) |
889 | + //} | |
890 | + e.postype = PT_L | |
891 | + lPos() | |
869 | 892 | } |
870 | - e.postype = PT_L | |
893 | + case PT_L: | |
894 | + e.facing = float32(e.relativef) | |
871 | 895 | lPos() |
896 | + case PT_R: | |
897 | + e.facing = float32(e.relativef) | |
898 | + rPos() | |
899 | + case PT_N: | |
900 | + e.facing = float32(e.relativef) | |
901 | + e.setX(e.offset[0]) | |
902 | + e.setY(e.offset[1]) | |
903 | + } | |
904 | + } else { | |
905 | + switch e.space { | |
906 | + case Space_screen: | |
907 | + e.facing = float32(e.relativef) | |
908 | + lPos() | |
909 | + case Space_stage: | |
910 | + e.facing = float32(e.relativef) | |
911 | + e.setX(e.offset[0]) | |
912 | + e.setY(e.offset[1]) | |
872 | 913 | } |
873 | - case PT_L: | |
874 | - e.facing = float32(e.relativef) | |
875 | - lPos() | |
876 | - case PT_R: | |
877 | - e.facing = float32(e.relativef) | |
878 | - rPos() | |
879 | - case PT_N: | |
880 | - e.facing = float32(e.relativef) | |
881 | - e.setX(e.offset[0]) | |
882 | - e.setY(e.offset[1]) | |
883 | 914 | } |
884 | 915 | } |
885 | 916 | func (e *Explod) matchId(eid, pid int32) bool { |
@@ -916,14 +947,21 @@ func (e *Explod) update(oldVer bool, playerNo int) { | ||
916 | 947 | } |
917 | 948 | } |
918 | 949 | screen := false |
950 | + if e.space == Space_screen || e.postype >= PT_L && e.postype != PT_N { | |
951 | + screen = true | |
952 | + } | |
919 | 953 | if e.bindtime != 0 { |
920 | - if e.postype == PT_N && e.bindId < 0 { | |
954 | + if e.space == Space_screen { | |
955 | + e.pos[0] = e.offset[0] | |
956 | + e.pos[1] = e.offset[1] | |
957 | + e.pos[0] -= float32(sys.gameWidth) / e.localscl / 2 | |
958 | + } else if e.postype == PT_N && e.bindId < 0 { | |
921 | 959 | e.pos[0] = e.offset[0] |
922 | 960 | e.pos[1] = e.offset[1] |
961 | + e.bindtime = 0 | |
923 | 962 | } else if e.postype >= PT_L && e.postype != PT_N { |
924 | 963 | e.pos[0] = e.offset[0] |
925 | 964 | e.pos[1] = e.offset[1] |
926 | - screen = true | |
927 | 965 | if e.postype == PT_L { |
928 | 966 | e.pos[0] -= float32(sys.gameWidth) / e.localscl / 2 |
929 | 967 | } else { |
@@ -973,24 +1011,30 @@ func (e *Explod) update(oldVer bool, playerNo int) { | ||
973 | 1011 | var epos = [2]float32{e.pos[0] * e.localscl, e.pos[1] * e.localscl} |
974 | 1012 | sprs.add(&SprData{e.anim, pfx, epos, [...]float32{e.facing * e.scale[0] * e.localscl, |
975 | 1013 | e.vfacing * e.scale[1] * e.localscl}, alp, e.sprpriority, agl, [...]float32{1, 1}, |
976 | - screen, playerNo == sys.superplayer, oldVer}, | |
1014 | + screen, playerNo == sys.superplayer, oldVer, e.facing}, | |
977 | 1015 | e.shadow[0]<<16|e.shadow[1]&0xff<<8|e.shadow[0]&0xff, sdwalp, 0, 0) |
978 | 1016 | if sys.tickNextFrame() { |
979 | 1017 | if e.bindtime > 0 { |
980 | 1018 | e.bindtime-- |
981 | - if screen && e.bindtime == 0 { | |
982 | - switch e.postype { | |
983 | - case PT_L: | |
984 | - for i := range e.pos { | |
985 | - e.pos[i] = sys.cam.ScreenPos[i] + e.offset[i]/sys.cam.Scale | |
986 | - } | |
987 | - case PT_R: | |
988 | - e.pos[0] = sys.cam.ScreenPos[0] + | |
989 | - (float32(sys.gameWidth)+e.offset[0])/sys.cam.Scale | |
990 | - e.pos[1] = sys.cam.ScreenPos[1] + e.offset[1]/sys.cam.Scale | |
991 | - } | |
992 | - } | |
993 | 1019 | } |
1020 | + //if screen && e.bindtime == 0 { | |
1021 | + // if e.space <= Space_none { | |
1022 | + // switch e.postype { | |
1023 | + // case PT_L: | |
1024 | + // for i := range e.pos { | |
1025 | + // e.pos[i] = sys.cam.ScreenPos[i] + e.offset[i]/sys.cam.Scale | |
1026 | + // } | |
1027 | + // case PT_R: | |
1028 | + // e.pos[0] = sys.cam.ScreenPos[0] + | |
1029 | + // (float32(sys.gameWidth)+e.offset[0])/sys.cam.Scale | |
1030 | + // e.pos[1] = sys.cam.ScreenPos[1] + e.offset[1]/sys.cam.Scale | |
1031 | + // } | |
1032 | + // } else if e.space == Space_screen { | |
1033 | + // for i := range e.pos { | |
1034 | + // e.pos[i] = sys.cam.ScreenPos[i] + e.offset[i]/sys.cam.Scale | |
1035 | + // } | |
1036 | + // } | |
1037 | + //} | |
994 | 1038 | if act { |
995 | 1039 | if e.bindtime == 0 { |
996 | 1040 | e.oldPos = e.pos |
@@ -1261,7 +1305,7 @@ func (p *Projectile) cueDraw(oldVer bool, playerNo int) { | ||
1261 | 1305 | sd := &SprData{p.ani, p.palfx, [...]float32{p.pos[0] * p.localscl, p.pos[1] * p.localscl}, |
1262 | 1306 | [...]float32{p.facing * p.scale[0] * p.localscl, p.scale[1] * p.localscl}, [2]int32{-1}, |
1263 | 1307 | p.sprpriority, 0, [...]float32{1, 1}, false, playerNo == sys.superplayer, |
1264 | - sys.cgi[playerNo].ver[0] != 1} | |
1308 | + sys.cgi[playerNo].ver[0] != 1, p.facing} | |
1265 | 1309 | p.aimg.recAndCue(sd, sys.tickNextFrame() && notpause) |
1266 | 1310 | sys.sprites.add(sd, |
1267 | 1311 | p.shadow[0]<<16|p.shadow[1]&255<<8|p.shadow[2]&255, 256, 0, 0) |
@@ -2443,10 +2487,10 @@ func (c *Char) roundState() int32 { | ||
2443 | 2487 | } |
2444 | 2488 | } |
2445 | 2489 | func (c *Char) screenPosX() float32 { |
2446 | - return (c.pos[0] - sys.cam.ScreenPos[0]/c.localscl) * sys.cam.Scale | |
2490 | + return (c.pos[0]*c.localscl - sys.cam.ScreenPos[0]) // * sys.cam.Scale | |
2447 | 2491 | } |
2448 | 2492 | func (c *Char) screenPosY() float32 { |
2449 | - return (c.pos[1] - sys.cam.ScreenPos[1]/c.localscl) * sys.cam.Scale | |
2493 | + return (c.pos[1]*c.localscl - sys.cam.ScreenPos[1]) // * sys.cam.Scale | |
2450 | 2494 | } |
2451 | 2495 | func (c *Char) selfAnimExist(anim BytecodeValue) BytecodeValue { |
2452 | 2496 | if anim.IsSF() { |
@@ -4454,7 +4498,7 @@ func (c *Char) cueDraw() { | ||
4454 | 4498 | sdf := func() *SprData { |
4455 | 4499 | sd := &SprData{c.anim, c.getPalfx(), pos, |
4456 | 4500 | scl, c.alpha, c.sprPriority, agl, c.angleScalse, false, |
4457 | - c.playerNo == sys.superplayer, c.gi().ver[0] != 1} | |
4501 | + c.playerNo == sys.superplayer, c.gi().ver[0] != 1, c.facing} | |
4458 | 4502 | if !c.sf(CSF_trans) { |
4459 | 4503 | sd.alpha[0] = -1 |
4460 | 4504 | } |
@@ -580,7 +580,7 @@ func (l *Layout) DrawAnim(r *[4]int32, x, y, scl float32, ln int16, | ||
580 | 580 | a.Draw(r, x+l.offset[0], y+l.offset[1]+float32(sys.gameHeight-240), |
581 | 581 | scl, scl, l.scale[0]*float32(l.facing), l.scale[0]*float32(l.facing), |
582 | 582 | l.scale[1]*float32(l.vfacing), |
583 | - 0, 0, float32(sys.gameWidth-320)/2, nil, false) | |
583 | + 0, 0, float32(sys.gameWidth-320)/2, nil, false, 1) | |
584 | 584 | } |
585 | 585 | } |
586 | 586 | func (l *Layout) DrawText(x, y, scl float32, ln int16, |
@@ -2762,6 +2762,26 @@ func (c *Compiler) paramPostye(is IniSection, sc *StateControllerBase, | ||
2762 | 2762 | return nil |
2763 | 2763 | }) |
2764 | 2764 | } |
2765 | + | |
2766 | +func (c *Compiler) paramSpace(is IniSection, sc *StateControllerBase, | |
2767 | + id byte) error { | |
2768 | + return c.stateParam(is, "space", func(data string) error { | |
2769 | + if len(data) <= 1 { | |
2770 | + return Error("値が指定されていません") | |
2771 | + } | |
2772 | + var sp Space | |
2773 | + if len(data) >= 2 { | |
2774 | + if strings.ToLower(data[:2]) == "st" { | |
2775 | + sp = Space_stage | |
2776 | + } else if strings.ToLower(data[:2]) == "sc" { | |
2777 | + sp = Space_screen | |
2778 | + } | |
2779 | + } | |
2780 | + sc.add(id, sc.iToExp(int32(sp))) | |
2781 | + return nil | |
2782 | + }) | |
2783 | +} | |
2784 | + | |
2765 | 2785 | func (c *Compiler) paramTrans(is IniSection, sc *StateControllerBase, |
2766 | 2786 | prefix string, id byte, afterImage bool) error { |
2767 | 2787 | return c.stateParam(is, prefix+"trans", func(data string) error { |
@@ -3443,6 +3463,9 @@ func (c *Compiler) explodSub(is IniSection, | ||
3443 | 3463 | if err := c.paramPostye(is, sc, explod_postype); err != nil { |
3444 | 3464 | return err |
3445 | 3465 | } |
3466 | + if err := c.paramSpace(is, sc, explod_space); err != nil { | |
3467 | + return err | |
3468 | + } | |
3446 | 3469 | f := false |
3447 | 3470 | if err := c.stateParam(is, "vel", func(data string) error { |
3448 | 3471 | f = true |
@@ -232,10 +232,20 @@ func rmTileSub(w, h uint16, x, y float32, tl *[4]int32, | ||
232 | 232 | pers = AbsF(xbs) / AbsF(xts) |
233 | 233 | } |
234 | 234 | if agl != 0 { |
235 | - kaiten(&x1, &y1, float64(agl), rcx, rcy, vs) | |
236 | - kaiten(&x2, &y2, float64(agl), rcx, rcy, vs) | |
237 | - kaiten(&x3, &y3, float64(agl), rcx, rcy, vs) | |
238 | - kaiten(&x4, &y4, float64(agl), rcx, rcy, vs) | |
235 | + // kaiten(&x1, &y1, float64(agl), rcx, rcy, vs) | |
236 | + // kaiten(&x2, &y2, float64(agl), rcx, rcy, vs) | |
237 | + // kaiten(&x3, &y3, float64(agl), rcx, rcy, vs) | |
238 | + // kaiten(&x4, &y4, float64(agl), rcx, rcy, vs) | |
239 | + if vs != 1 { | |
240 | + y1 = rcy + ((y - ys*float32(h)) - rcy) | |
241 | + y2 = y1 | |
242 | + y3 = rcy + (y - rcy) | |
243 | + y4 = y3 | |
244 | + } | |
245 | + gl.Translated(float64(rcx), float64(rcy), 0) | |
246 | + gl.Scaled(1, float64(vs), 1) | |
247 | + gl.Rotated(float64(agl/(math.Pi/180)), 0, 0, 1) | |
248 | + gl.Translated(float64(-rcx), float64(-rcy), 0) | |
239 | 249 | drawQuads(x1, y1, x2, y2, x3, y3, x4, y4, r, g, b, a, pers) |
240 | 250 | return |
241 | 251 | } |
@@ -378,7 +378,7 @@ func (bg backGround) draw(pos [2]float32, scl, bgscl, lclscl float32, | ||
378 | 378 | rect[3] = int32(math.Floor(float64(startrect1 + (float32(rect[3]) * sys.heightScale * wscl[1]) - float32(rect[1])))) |
379 | 379 | 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, |
380 | 380 | xras*x/(AbsF(ys*ys3)*lscl[1]*float32(bg.anim.spr.Size[1]))*sclx_recip, |
381 | - 0, float32(sys.gameWidth)/2, &sys.bgPalFX, true) | |
381 | + 0, float32(sys.gameWidth)/2, &sys.bgPalFX, true, 1) | |
382 | 382 | } |
383 | 383 | |
384 | 384 | type bgCtrl struct { |
@@ -3,10 +3,6 @@ package main | ||
3 | 3 | import ( |
4 | 4 | "bufio" |
5 | 5 | "fmt" |
6 | - "github.com/go-gl/gl/v2.1/gl" | |
7 | - "github.com/go-gl/glfw/v3.2/glfw" | |
8 | - "github.com/timshannon/go-openal/openal" | |
9 | - "github.com/yuin/gopher-lua" | |
10 | 6 | "io/ioutil" |
11 | 7 | "log" |
12 | 8 | "math" |
@@ -15,6 +11,11 @@ import ( | ||
15 | 11 | "strings" |
16 | 12 | "sync" |
17 | 13 | "time" |
14 | + | |
15 | + "github.com/go-gl/gl/v2.1/gl" | |
16 | + "github.com/go-gl/glfw/v3.2/glfw" | |
17 | + "github.com/timshannon/go-openal/openal" | |
18 | + "github.com/yuin/gopher-lua" | |
18 | 19 | ) |
19 | 20 | |
20 | 21 | const ( |
@@ -776,7 +777,7 @@ func (s *System) action(x, y *float32, scl float32) (leftest, rightest, | ||
776 | 777 | if s.superanim != nil { |
777 | 778 | s.topSprites.add(&SprData{s.superanim, &s.superpmap, s.superpos, |
778 | 779 | [...]float32{s.superfacing, 1}, [2]int32{-1}, 5, 0, [2]float32{}, |
779 | - false, true, s.cgi[s.superplayer].ver[0] != 1}, 0, 0, 0, 0) | |
780 | + false, true, s.cgi[s.superplayer].ver[0] != 1, 1}, 0, 0, 0, 0) | |
780 | 781 | if s.superanim.loopend { |
781 | 782 | s.superanim = nil |
782 | 783 | } |