• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

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

Go で書き直した Ikemen


Commit MetaInfo

Revisiondab9d1e7bbb035e336f75ae8e2683dd42635fe2f (tree)
Time2020-04-30 17:35:34
Authorneatunsou <sisiy4excite@gmai...>
Commiterneatunsou

Log Message

ファイル入れ忘れ修正

Change Summary

Incremental Difference

--- a/src/lifebar.go
+++ b/src/lifebar.go
@@ -3,9 +3,9 @@ package main
33 import (
44 "fmt"
55 "math"
6- "strings"
76 "regexp"
87 "sort"
8+ "strings"
99 )
1010
1111 type FinishType int32
@@ -61,6 +61,7 @@ type LbText struct {
6161 lay Layout
6262 palfx *PalFX
6363 }
64+
6465 func newLbText() LbText {
6566 return LbText{font: [...]int32{-1, 0, 0, 255, 255, 255}, palfx: newPalFX()}
6667 }
@@ -69,7 +70,7 @@ func readLbText(pre string, is IniSection, str string, ln int16, f []*Fnt) LbTex
6970 is.ReadI32(pre+"font", &txt.font[0], &txt.font[1], &txt.font[2],
7071 &txt.font[3], &txt.font[4], &txt.font[5])
7172 if _, ok := is[pre+"text"]; ok {
72- txt.text, _ = is.getString(pre+"text")
73+ txt.text, _ = is.getString(pre + "text")
7374 } else {
7475 txt.text = str
7576 }
@@ -88,6 +89,7 @@ type LbBgTextSnd struct {
8889 sndtime int32
8990 cnt int32
9091 }
92+
9193 func newLbBgTextSnd() LbBgTextSnd {
9294 return LbBgTextSnd{snd: [2]int32{-1}}
9395 }
@@ -103,7 +105,7 @@ func readLbBgTextSnd(pre string, is IniSection,
103105 is.ReadI32(pre+"sndtime", &bts.sndtime)
104106 return bts
105107 }
106-func (bts *LbBgTextSnd) step(snd *Snd) {
108+func (bts *LbBgTextSnd) step(snd *Snd) {
107109 if bts.cnt == bts.sndtime {
108110 snd.play(bts.snd)
109111 }
@@ -117,12 +119,12 @@ func (bts *LbBgTextSnd) reset() {
117119 bts.bg.Reset()
118120 }
119121 func (bts *LbBgTextSnd) bgDraw(layerno int16) {
120- if bts.cnt > bts.time && bts.cnt <= bts.time + bts.displaytime {
122+ if bts.cnt > bts.time && bts.cnt <= bts.time+bts.displaytime {
121123 bts.bg.DrawScaled(float32(bts.pos[0])+sys.lifebarOffsetX, float32(bts.pos[1]), layerno, sys.lifebarScale)
122124 }
123125 }
124126 func (bts *LbBgTextSnd) draw(layerno int16, f []*Fnt) {
125- if bts.cnt > bts.time && bts.cnt <= bts.time + bts.displaytime &&
127+ if bts.cnt > bts.time && bts.cnt <= bts.time+bts.displaytime &&
126128 bts.text.font[0] >= 0 && int(bts.text.font[0]) < len(f) {
127129 bts.text.lay.DrawText(float32(bts.pos[0])+sys.lifebarOffsetX, float32(bts.pos[1]), sys.lifebarScale, layerno,
128130 bts.text.text, f[bts.text.font[0]], bts.text.font[1], bts.text.font[2], bts.text.palfx)
@@ -574,7 +576,7 @@ func (sb *StunBar) step(ref int, sbr *StunBar, snd *Snd) {
574576 if !sys.lifebar.activeSb {
575577 return
576578 }
577- power := 1 - float32(sys.chars[ref][0].power) / float32(sys.chars[ref][0].powerMax)
579+ power := 1 - float32(sys.chars[ref][0].power)/float32(sys.chars[ref][0].powerMax)
578580 sbr.midpower -= 1.0 / 144
579581 if power < sbr.midpowerMin {
580582 sbr.midpowerMin += (power - sbr.midpowerMin) * (1 / (12 - (power-sbr.midpowerMin)*144))
@@ -617,7 +619,7 @@ func (sb *StunBar) draw(layerno int16, ref int, sbr *StunBar, f []*Fnt) {
617619 if !sys.lifebar.activeSb {
618620 return
619621 }
620- power := 1 - float32(sys.chars[ref][0].dizzyPoints) / float32(sys.chars[ref][0].dizzyPointsMax)
622+ power := 1 - float32(sys.chars[ref][0].dizzyPoints)/float32(sys.chars[ref][0].dizzyPointsMax)
621623 var MidPos = (float32(sys.gameWidth-320) / 2)
622624 width := func(power float32) (r [4]int32) {
623625 r = sys.scrrect
@@ -883,7 +885,7 @@ func (wi *LifeBarWinIcon) draw(layerno int16, f []*Fnt, side int) {
883885 }
884886 for i := 0; i < int(math.Min(float64(wi.useiconupto), bg0num)); i++ {
885887 wi.bg0.DrawScaled(float32(wi.pos[0]+wi.iconoffset[0]*int32(i))+sys.lifebarOffsetX,
886- float32(wi.pos[1]+wi.iconoffset[1]*int32(i)), layerno, sys.lifebarScale)
888+ float32(wi.pos[1]+wi.iconoffset[1]*int32(i)), layerno, sys.lifebarScale)
887889 }
888890 if len(wi.wins) > int(wi.useiconupto) {
889891 if wi.counter.font[0] >= 0 && int(wi.counter.font[0]) < len(f) {
@@ -1007,7 +1009,7 @@ func (c *LifeBarCombo) step(combo, damage int32, percentage float32, dizzy bool)
10071009 if c.resttime > 0 {
10081010 c.counterX -= c.counterX / c.showspeed
10091011 } else {
1010- c.counterX -= sys.lifebarFontScale * c.hidespeed * float32(sys.lifebarLocalcoord[0])/320
1012+ c.counterX -= sys.lifebarFontScale * c.hidespeed * float32(sys.lifebarLocalcoord[0]) / 320
10111013 if c.counterX < c.start_x*2 {
10121014 c.counterX = c.start_x * 2
10131015 }
@@ -1135,7 +1137,7 @@ type LifeBarRound struct {
11351137 cur int32
11361138 wt, swt, dt [2]int32
11371139 timerActive bool
1138- wint [WT_NumTypes*2]LbBgTextSnd
1140+ wint [WT_NumTypes * 2]LbBgTextSnd
11391141 }
11401142
11411143 func newLifeBarRound(snd *Snd) *LifeBarRound {
@@ -1369,7 +1371,7 @@ func (r *LifeBarRound) reset() {
13691371 }
13701372 func (r *LifeBarRound) draw(layerno int16, f []*Fnt) {
13711373 ob := sys.brightness
1372- sys.brightness = 255
1374+ sys.brightness = 256
13731375 switch r.cur {
13741376 case 0:
13751377 if r.wt[0] < 0 && sys.intro <= r.ctrl_time {
@@ -1490,7 +1492,7 @@ func readLifeBarChallenger(is IniSection,
14901492 }
14911493 return ch
14921494 }
1493-func (ch *LifeBarChallenger) step(snd *Snd) {
1495+func (ch *LifeBarChallenger) step(snd *Snd) {
14941496 if sys.challenger > 0 {
14951497 ch.challenger.step(snd)
14961498 if ch.challenger.cnt == ch.over_pause {
@@ -1513,8 +1515,8 @@ func (ch *LifeBarChallenger) draw(layerno int16, f []*Fnt) {
15131515 }
15141516
15151517 type LifeBarRatio struct {
1516- pos [2]int32
1517- icon [4]AnimLayout
1518+ pos [2]int32
1519+ icon [4]AnimLayout
15181520 }
15191521
15201522 func newLifeBarRatio() *LifeBarRatio {
@@ -1574,9 +1576,9 @@ func (tr *LifeBarTimer) draw(layerno int16, f []*Fnt) {
15741576 text := tr.text.text
15751577 totalSec := float64(timeTotal()) / 60
15761578 h := math.Floor(totalSec / 3600)
1577- m := math.Floor((totalSec / 3600 - h) * 60)
1578- s := math.Floor(((totalSec / 3600 - h) * 60 - m) * 60)
1579- x := math.Floor((((totalSec / 3600 - h) * 60 - m) * 60 - s) * 100)
1579+ m := math.Floor((totalSec/3600 - h) * 60)
1580+ s := math.Floor(((totalSec/3600-h)*60 - m) * 60)
1581+ x := math.Floor((((totalSec/3600-h)*60-m)*60 - s) * 100)
15801582 ms, ss, xs := fmt.Sprintf("%.0f", m), fmt.Sprintf("%.0f", s), fmt.Sprintf("%.0f", x)
15811583 if len(ms) < 2 {
15821584 ms = "0" + ms
@@ -1624,7 +1626,7 @@ func readLifeBarScore(pre string, is IniSection,
16241626 sc.bg = *ReadAnimLayout(pre+"bg.", is, sff, at, 0)
16251627 return sc
16261628 }
1627-func (sc *LifeBarScore) step() { sc.bg.Action() }
1629+func (sc *LifeBarScore) step() { sc.bg.Action() }
16281630 func (sc *LifeBarScore) reset() { sc.bg.Reset() }
16291631 func (sc *LifeBarScore) bgDraw(layerno int16) {
16301632 if sc.active {
@@ -1646,7 +1648,7 @@ func (sc *LifeBarScore) draw(layerno int16, f []*Fnt, side int) {
16461648 //split float value
16471649 s := strings.Split(fmt.Sprintf("%f", total), ".")
16481650 //integer left padding (add leading zeros)
1649- for i := int(sc.pad)-len(s[0]); i > 0; i-- {
1651+ for i := int(sc.pad) - len(s[0]); i > 0; i-- {
16501652 s[0] = "0" + s[0]
16511653 }
16521654 //integer thousands separator
@@ -1721,7 +1723,7 @@ func readLifeBarAiLevel(pre string, is IniSection,
17211723 ai.bg = *ReadAnimLayout(pre+"bg.", is, sff, at, 0)
17221724 return ai
17231725 }
1724-func (ai *LifeBarAiLevel) step() { ai.bg.Action() }
1726+func (ai *LifeBarAiLevel) step() { ai.bg.Action() }
17251727 func (ai *LifeBarAiLevel) reset() { ai.bg.Reset() }
17261728 func (ai *LifeBarAiLevel) bgDraw(layerno int16) {
17271729 if ai.active {
@@ -1740,9 +1742,9 @@ func (ai *LifeBarAiLevel) draw(layerno int16, f []*Fnt, ailv float32) {
17401742 }
17411743
17421744 type LifeBarMode struct {
1743- pos [2]int32
1744- text LbText
1745- bg AnimLayout
1745+ pos [2]int32
1746+ text LbText
1747+ bg AnimLayout
17461748 }
17471749
17481750 func newLifeBarMode() *LifeBarMode {
@@ -1837,9 +1839,9 @@ func loadLifebar(deffile string) (*Lifebar, error) {
18371839 "[tag_3p lifebar]": 6, "[tag_4p lifebar]": 7, "[simul powerbar]": 1,
18381840 "[turns powerbar]": 2, "[tag powerbar]": 3, "[simul_3p powerbar]": 4,
18391841 "[simul_4p powerbar]": 5, "[tag_3p powerbar]": 6, "[tag_4p powerbar]": 7,
1840- "[guardbar]": 0 , "[simul guardbar]": 1, "[turns guardbar]": 2,
1842+ "[guardbar]": 0, "[simul guardbar]": 1, "[turns guardbar]": 2,
18411843 "[tag guardbar]": 3, "[simul_3p guardbar]": 4, "[simul_4p guardbar]": 5,
1842- "[tag_3p guardbar]": 6, "[tag_4p guardbar]": 7, "[stunbar]": 0 ,
1844+ "[tag_3p guardbar]": 6, "[tag_4p guardbar]": 7, "[stunbar]": 0,
18431845 "[simul stunbar]": 1, "[turns stunbar]": 2, "[tag stunbar]": 3,
18441846 "[simul_3p stunbar]": 4, "[simul_4p stunbar]": 5, "[tag_3p stunbar]": 6,
18451847 "[tag_4p stunbar]": 7, "[tag face]": 3, "[simul_3p face]": 4,
@@ -1857,7 +1859,7 @@ func loadLifebar(deffile string) (*Lifebar, error) {
18571859 str += "\n" + k
18581860 }
18591861 }
1860-
1862+
18611863 sff, lines, i := &Sff{}, SplitAndTrim(str, "\n"), 0
18621864 at := ReadAnimationTable(sff, lines, &i)
18631865 i = 0
@@ -2428,7 +2430,7 @@ func (l *Lifebar) step() {
24282430 if tm == TM_Turns {
24292431 rl := sys.chars[ti][0].ratioLevel()
24302432 if rl > 0 {
2431- l.ra[ti].step(rl-1)
2433+ l.ra[ti].step(rl - 1)
24322434 }
24332435 }
24342436 }