• 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

Revision0c2d7a0cac53c4212b40d2988feb9714fa82b8cb (tree)
Time2019-12-05 22:25:27
Authorneatunsou <sisiy4excite@gmai...>
Commiterneatunsou

Log Message

Windblade氏の更新に対応

Change Summary

Incremental Difference

--- a/get.sh
+++ b/get.sh
@@ -1,15 +1,13 @@
11 #!/bin/sh
22 export GOPATH=$PWD/go
33 go get -u github.com/yuin/gopher-lua
4-go get -u github.com/go-gl/glfw/v3.2/glfw
4+go get -u github.com/go-gl/glfw/v3.3/glfw
55 go get -u github.com/go-gl/gl/v2.1/gl
6-go get -u github.com/jfreymuth/go-vorbis/ogg/vorbis
76 go get -u github.com/timshannon/go-openal/openal
8-go get -u github.com/K4thos/glfont
7+go get -u github.com/Windblade-GR01/glfont
98 go get -u github.com/flopp/go-findfont
109 go get -u github.com/faiface/beep
1110 go get -u github.com/hajimehoshi/oto
1211 go get -u github.com/hajimehoshi/go-mp3
1312 go get -u github.com/pkg/errors
14-go get -u github.com/jfreymuth/oggvorbis
15-go get -u github.com/mewkiz/flac
13+go get -u github.com/jfreymuth/oggvorbis
\ No newline at end of file
Binary files a/script/Icons/16x16.png and /dev/null differ
Binary files a/script/Icons/24x24.png and /dev/null differ
Binary files a/script/Icons/256x256.png and /dev/null differ
Binary files a/script/Icons/32x32.png and /dev/null differ
Binary files a/script/Icons/384x384.png and /dev/null differ
Binary files a/script/Icons/48x48.png and /dev/null differ
Binary files a/script/Icons/96x96.png and /dev/null differ
Binary files /dev/null and b/script/Icons/IkemenCylia.png differ
--- a/script/motif.lua
+++ b/script/motif.lua
@@ -1622,7 +1622,7 @@ for i = 1, #t_dir do
16221622 animSetAlpha(anim, 1, 255)
16231623 end
16241624 animAddPos(anim, 160, 0) --for some reason needed in ikemen
1625- if t_bgdef[k].window ~= nil then
1625+ if t_bgdef[k].window ~= nil and t_bgdef[k].window[1] ~= nil and t_bgdef[k].window[2] ~= nil and t_bgdef[k].window[3] ~= nil and t_bgdef[k].window[4] ~= nil then
16261626 animSetWindow(
16271627 anim,
16281628 t_bgdef[k].window[1],
--- a/script/select.lua
+++ b/script/select.lua
@@ -8,7 +8,13 @@ setSelColRow(motif.select_info.columns, motif.select_info.rows)
88 --setRandomSpr(motif.selectbgdef.spr_data, motif.select_info.cell_random_spr[1], motif.select_info.cell_random_spr[2], motif.select_info.cell_random_scale[1], motif.select_info.cell_random_scale[2])
99 --setCellSpr(motif.selectbgdef.spr_data, motif.select_info.cell_bg_spr[1], motif.select_info.cell_bg_spr[2], motif.select_info.cell_bg_scale[1], motif.select_info.cell_bg_scale[2])
1010
11-setSelCellSize(motif.select_info.cell_size[1] + motif.select_info.cell_spacing, motif.select_info.cell_size[2] + motif.select_info.cell_spacing)
11+-- cell.size type check
12+if type(motif.select_info.cell_spacing) == "table" then
13+ setSelCellSize(motif.select_info.cell_size[1] + motif.select_info.cell_spacing[1], motif.select_info.cell_size[2] + motif.select_info.cell_spacing[2])
14+else
15+ setSelCellSize(motif.select_info.cell_size[1] + motif.select_info.cell_spacing, motif.select_info.cell_size[2] + motif.select_info.cell_spacing)
16+end
17+
1218 setSelCellScale(motif.select_info.portrait_scale[1], motif.select_info.portrait_scale[2])
1319
1420 --default team count after starting the game
@@ -88,7 +94,14 @@ for i = 1, (motif.select_info.rows + motif.select_info.rows_scrolling) * motif.s
8894 t_grid[row] = {}
8995 end
9096 col = #t_grid[row] + 1
91- t_grid[row][col] = {num = i - 1, x = (col - 1) * (motif.select_info.cell_size[1] + motif.select_info.cell_spacing), y = (row - 1) * (motif.select_info.cell_size[2] + motif.select_info.cell_spacing)}
97+
98+ -- cell.spacing type check
99+ if type(motif.select_info.cell_spacing) == "table" then
100+ t_grid[row][col] = {num = i - 1, x = (col - 1) * (motif.select_info.cell_size[1] + motif.select_info.cell_spacing[1]), y = (row - 1) * (motif.select_info.cell_size[2] + motif.select_info.cell_spacing[2])}
101+ else
102+ t_grid[row][col] = {num = i - 1, x = (col - 1) * (motif.select_info.cell_size[1] + motif.select_info.cell_spacing), y = (row - 1) * (motif.select_info.cell_size[2] + motif.select_info.cell_spacing)}
103+ end
104+
92105 if main.t_selChars[i].char ~= nil then
93106 t_grid[row][col].char = main.t_selChars[i].char
94107 t_grid[row][col].hidden = main.t_selChars[i].hidden
@@ -1830,8 +1843,17 @@ function select.f_p1SelectMenu()
18301843 p1SelX, p1SelY, p1FaceOffset, p1RowOffset = select.f_cellMovement(p1SelX, p1SelY, main.p1Cmd, p1FaceOffset, p1RowOffset, motif.select_info.p1_cursor_move_snd)
18311844 p1Cell = p1SelX + motif.select_info.columns * p1SelY
18321845 --draw active cursor
1833- local cursorX = p1FaceX + p1SelX * (motif.select_info.cell_size[1] + motif.select_info.cell_spacing)
1834- local cursorY = p1FaceY + (p1SelY - p1RowOffset) * (motif.select_info.cell_size[2] + motif.select_info.cell_spacing)
1846+ -- cell.spacing type check
1847+ local cursorX = 0
1848+ local cursorY = 0
1849+ if type(motif.select_info.cell_spacing) == "table" then
1850+ cursorX = p1FaceX + p1SelX * (motif.select_info.cell_size[1] + motif.select_info.cell_spacing[1])
1851+ cursorY = p1FaceY + (p1SelY - p1RowOffset) * (motif.select_info.cell_size[2] + motif.select_info.cell_spacing[2])
1852+ else
1853+ cursorX = p1FaceX + p1SelX * (motif.select_info.cell_size[1] + motif.select_info.cell_spacing)
1854+ cursorY = p1FaceY + (p1SelY - p1RowOffset) * (motif.select_info.cell_size[2] + motif.select_info.cell_spacing)
1855+ end
1856+
18351857 if resetgrid == true then
18361858 select.f_resetGrid()
18371859 end
@@ -1885,8 +1907,16 @@ function select.f_p2SelectMenu()
18851907 p2SelX, p2SelY, p2FaceOffset, p2RowOffset = select.f_cellMovement(p2SelX, p2SelY, main.p2Cmd, p2FaceOffset, p2RowOffset, motif.select_info.p2_cursor_move_snd)
18861908 p2Cell = p2SelX + motif.select_info.columns * p2SelY
18871909 --draw active cursor
1888- local cursorX = p2FaceX + p2SelX * (motif.select_info.cell_size[1] + motif.select_info.cell_spacing)
1889- local cursorY = p2FaceY + (p2SelY - p2RowOffset) * (motif.select_info.cell_size[2] + motif.select_info.cell_spacing)
1910+ -- cell.spacing type check
1911+ local cursorX = 0
1912+ local cursorY = 0
1913+ if type(motif.select_info.cell_spacing) == "table" then
1914+ cursorX = p2FaceX + p2SelX * (motif.select_info.cell_size[1] + motif.select_info.cell_spacing[1])
1915+ cursorY = p2FaceY + (p2SelY - p2RowOffset) * (motif.select_info.cell_size[2] + motif.select_info.cell_spacing[2])
1916+ else
1917+ cursorX = p2FaceX + p2SelX * (motif.select_info.cell_size[1] + motif.select_info.cell_spacing)
1918+ cursorY = p2FaceY + (p2SelY - p2RowOffset) * (motif.select_info.cell_size[2] + motif.select_info.cell_spacing)
1919+ end
18901920 if resetgrid == true then
18911921 select.f_resetGrid()
18921922 end
--- a/src/bytecode.go
+++ b/src/bytecode.go
@@ -367,9 +367,6 @@ const (
367367 OC_ex_groundangle
368368 OC_ex_stagefrontedge
369369 OC_ex_stagebackedge
370- OC_ex_const240p
371- OC_ex_const480p
372- OC_ex_const720p
373370 OC_ex_gethitvar_animtype
374371 OC_ex_gethitvar_airtype
375372 OC_ex_gethitvar_groundtype
@@ -403,6 +400,12 @@ const (
403400 OC_ex_gethitvar_fall_envshake_phase
404401 )
405402 const (
403+ OC_ex_const240p OpCode = iota + 100
404+ OC_ex_const480p
405+ OC_ex_const720p
406+ OC_ailevelf // float version of AILevel
407+)
408+const (
406409 NumVar = OC_sysvar0 - OC_var0
407410 NumSysVar = OC_fvar0 - OC_sysvar0
408411 NumFvar = OC_sysfvar0 - OC_fvar0
@@ -975,7 +978,9 @@ func (be BytecodeExp) run(c *Char) BytecodeValue {
975978 case OC_swap:
976979 sys.bcStack.Swap()
977980 case OC_ailevel:
978- sys.bcStack.PushI(c.aiLevel())
981+ sys.bcStack.PushI(int32(c.aiLevel()))
982+ case OC_ailevelf:
983+ sys.bcStack.PushF(c.aiLevel())
979984 case OC_alive:
980985 sys.bcStack.PushB(c.alive())
981986 case OC_anim:
--- a/src/char.go
+++ b/src/char.go
@@ -2270,7 +2270,7 @@ func (c *Char) p2() *Char {
22702270 }
22712271 return p2
22722272 }
2273-func (c *Char) aiLevel() int32 {
2273+func (c *Char) aiLevel() float32 {
22742274 if c.helperIndex != 0 && c.gi().ver[0] == 1 {
22752275 return 0
22762276 }
--- a/src/compiler.go
+++ b/src/compiler.go
@@ -691,8 +691,9 @@ func (c *Compiler) kyuushikiSuperDX(out *BytecodeExp, in *string,
691691 default:
692692 if hissu && !comma {
693693 return Error("比較演算子がありません" +
694- " / " +
695- "No comparison operator")
694+ "\n" +
695+ "No comparison operator" +
696+ "\n[ECID 1]\n")
696697 }
697698 hikaku = false
698699 }
@@ -736,8 +737,9 @@ func (c *Compiler) kyuushikiSuperDX(out *BytecodeExp, in *string,
736737 if err != nil {
737738 if hissu && !hikaku {
738739 return Error("比較演算子がありません" +
739- " / " +
740- "No comparison operator")
740+ "\n" +
741+ "No comparison operator" +
742+ "\n[ECID 2]\n")
741743 }
742744 if hikaku {
743745 return err
@@ -1148,6 +1150,8 @@ func (c *Compiler) expValue(out *BytecodeExp, in *string,
11481150 }
11491151 case "ailevel":
11501152 out.append(OC_ailevel)
1153+ case "ailevelf":
1154+ out.append(OC_ailevelf)
11511155 case "alive":
11521156 out.append(OC_alive)
11531157 case "anim":
@@ -2169,7 +2173,12 @@ func (c *Compiler) expPostNot(out *BytecodeExp, in *string) (BytecodeValue,
21692173 if len(c.maeOp) == 0 {
21702174 if opp := c.isOperator(c.token); opp == 0 {
21712175 if !sys.ignoreMostErrors || !c.usiroOp && c.token == "(" {
2172- return bvNone(), Error("演算子がありません")
2176+ return bvNone(), Error("演算子がありません" +
2177+ "\n" +
2178+ "No comparison operator" +
2179+ "\n" +
2180+ "Token = '" + c.token + "' String = '" + *in + "'" +
2181+ "\n[ECID 3]\n")
21732182 }
21742183 oldtoken, oldin := c.token, *in
21752184 var dummyout BytecodeExp
@@ -2178,7 +2187,10 @@ func (c *Compiler) expPostNot(out *BytecodeExp, in *string) (BytecodeValue,
21782187 }
21792188 if c.usiroOp {
21802189 if c.isOperator(c.token) <= 0 {
2181- return bvNone(), Error("演算子がありません")
2190+ return bvNone(), Error("演算子がありません" +
2191+ "\n" +
2192+ "No comparison operator" +
2193+ "\n[ECID 4]\n")
21822194 }
21832195 if err := c.renzokuEnzansihaError(in); err != nil {
21842196 return bvNone(), err
--- a/src/font.go
+++ b/src/font.go
@@ -6,7 +6,7 @@ import (
66 "regexp"
77 "strings"
88
9- "github.com/K4thos/glfont"
9+ "github.com/Windblade-GR01/glfont"
1010 findfont "github.com/flopp/go-findfont"
1111 )
1212
@@ -351,8 +351,8 @@ func loadFntTtf(f *Fnt, fontfile string, filename string) {
351351 panic(err)
352352 }
353353 f.ttf = ttf
354-
355- //Create Ttf palettes
354+
355+ //Create Ttf dummy palettes
356356 f.palettes = make([][256]uint32, 1)
357357 for i := 0; i < 256; i++ {
358358 f.palettes[0][i] = 0
@@ -595,7 +595,7 @@ func (ts *TextSprite) SetColor(r, g, b, alphaSrc, alphaDst float32) {
595595 func (ts *TextSprite) Draw() {
596596 if !sys.frameSkip && ts.fnt != nil {
597597 if ts.fnt.Type == "truetype" {
598- ts.fnt.ttf.Printf(ts.x, ts.y, ts.yscl, ts.align, false, ts.text) //x, y, scale, align, string, printf args
598+ ts.fnt.ttf.Printf(ts.x, ts.y, (ts.xscl + ts.yscl) / 2, ts.align, true, ts.text) //x, y, scale, align, blend ,string, printf args
599599 } else {
600600 ts.fnt.DrawText(ts.text, ts.x, ts.y, ts.xscl, ts.yscl, ts.bank, ts.align)
601601 }
--- a/src/input.go
+++ b/src/input.go
@@ -7,7 +7,7 @@ import (
77 "strings"
88 "time"
99
10- "github.com/go-gl/glfw/v3.2/glfw"
10+ "github.com/go-gl/glfw/v3.3/glfw"
1111 )
1212
1313 type CommandKey byte
@@ -618,19 +618,22 @@ func JoystickState(joy, button int) bool {
618618 if joy >= len(joystick) {
619619 return false
620620 }
621- btns := glfw.GetJoystickButtons(joystick[joy])
621+ btns := joystick[joy].GetButtons()
622622 if button < 0 {
623623 button = -button - 1
624- axes := glfw.GetJoystickAxes(joystick[joy])
624+ axes := joystick[joy].GetAxes()
625+
625626 if len(axes)*2 <= button {
626627 return false
627628 }
628- if (button == 8 || button == 10) && glfw.GetJoystickName(joystick[joy]) == "Xbox 360 Controller" { //Xbox360コントローラーのLRトリガー判定
629+
630+ //Xbox360コントローラーのLRトリガー判定
631+ if (button == 9 || button == 11) && (joystick[joy].GetGamepadName() == "Xbox 360 Controller" || strings.Contains(joystick[joy].GetGamepadName(), "XInput")) {
629632 return axes[button/2] > sys.xinputTriggerSensitivity
630633 }
631634
632635 // Ignore trigger axis on PS4 (We already have buttons)
633- if (button >= 6 && button <= 9) && glfw.GetJoystickName(joystick[joy]) == "Wireless Controller" {
636+ if (button >= 6 && button <= 9) && joystick[joy].GetGamepadName() == "Wireless Controller" {
634637 return false
635638 }
636639
@@ -1368,7 +1371,7 @@ func (__ *AiInput) Update(level float32) {
13681371 if dec(&__.dt) {
13691372 __.dir = Rand(0, 7)
13701373 }
1371- osu, hanasu = int32(-11.25*level+165), 30
1374+ osu, hanasu = int32((-11.25*level+165)*7), 30
13721375 dec(&__.at)
13731376 dec(&__.bt)
13741377 dec(&__.ct)
--- a/src/main.go
+++ b/src/main.go
@@ -10,7 +10,7 @@ import (
1010 "strconv"
1111 "strings"
1212
13- "github.com/go-gl/glfw/v3.2/glfw"
13+ "github.com/go-gl/glfw/v3.3/glfw"
1414 lua "github.com/yuin/gopher-lua"
1515 )
1616
@@ -78,6 +78,7 @@ func main() {
7878 defer glfw.Terminate()
7979 defcfg := []byte(strings.Join(strings.Split(
8080 `{
81+ "WindowTitle": "Ikemen GO",
8182 "HelperMax": 56,
8283 "PlayerProjectileMax": 256,
8384 "ExplodMax": 512,
@@ -104,12 +105,12 @@ func main() {
104105 ],
105106 "JoystickConfig": [
106107 {
107- "Joystick": 1,
108- "Buttons": ["-7", "-8", "-5", "-6", "0", "1", "4", "2", "3", "5", "7", "6", "8"]
108+ "Joystick": 0,
109+ "Buttons": ["-3", "-4", "-1", "-2", "0", "1", "4", "2", "3", "5", "7", "-10", "-12"]
109110 },
110111 {
111112 "Joystick": 1,
112- "Buttons": ["-7", "-8", "-5", "-6", "0", "1", "4", "2", "3", "5", "7", "6", "8"]
113+ "Buttons": ["-3", "-4", "-1", "-2", "0", "1", "4", "2", "3", "5", "7", "-10", "-12"]
113114 }
114115 ],
115116 "ControllerStickSensitivity": 0.4,
@@ -151,8 +152,7 @@ func main() {
151152 "LocalcoordScalingType": 1,
152153 "MSAA": false,
153154 "WindowMainIconLocation": [
154- "script/Icons/16x16.png",
155- "script/Icons/24x24.png"
155+ "script/Icons/IkemenCylia.png"
156156 ]
157157 }
158158 `, "\n"), "\r\n"))
@@ -195,6 +195,7 @@ func main() {
195195 ControllerStickSensitivity float32
196196 XinputTriggerSensitivity float32
197197 WindowMainIconLocation []string
198+ WindowTitle string
198199 }{}
199200 chk(json.Unmarshal(defcfg, &tmp))
200201 const configFile = "save/config.json"
@@ -212,6 +213,7 @@ func main() {
212213 }
213214 sys.controllerStickSensitivity = tmp.ControllerStickSensitivity
214215 sys.xinputTriggerSensitivity = tmp.XinputTriggerSensitivity
216+ sys.windowTitle = tmp.WindowTitle
215217 sys.helperMax = tmp.HelperMax
216218 sys.playerProjectileMax = tmp.PlayerProjectileMax
217219 sys.explodMax = tmp.ExplodMax
--- a/src/script.go
+++ b/src/script.go
@@ -8,7 +8,7 @@ import (
88 "strconv"
99 "strings"
1010
11- "github.com/go-gl/glfw/v3.2/glfw"
11+ "github.com/go-gl/glfw/v3.3/glfw"
1212 lua "github.com/yuin/gopher-lua"
1313 )
1414
@@ -285,6 +285,12 @@ func scriptCommonInit(l *lua.LState) {
285285 sys.lifebarOffsetX = float32(numArg(l, 1))
286286 return 0
287287 })
288+
289+ luaRegister(l, "setWindowTitle", func(*lua.LState) int {
290+ sys.windowTitle = string(strArg(l, 1))
291+ sys.window.SetTitle(sys.windowTitle)
292+ return 0
293+ })
288294 }
289295
290296 // System Script
@@ -504,10 +510,16 @@ func systemScriptInit(l *lua.LState) {
504510 })
505511 luaRegister(l, "setCom", func(*lua.LState) int {
506512 pn := int(numArg(l, 1))
513+ ailv := float32(numArg(l, 2))
507514 if pn < 1 || pn > MaxSimul*2+MaxAttachedChar {
508515 l.RaiseError("プレイヤー番号(%v)が不正です。", pn)
509516 }
510- sys.com[pn-1] = Max(0, int32(numArg(l, 2)))
517+ if ailv > 0 {
518+ sys.com[pn-1] = ailv
519+ } else {
520+ sys.com[pn-1] = 0
521+ }
522+
511523 return 0
512524 })
513525 luaRegister(l, "setAutoLevel", func(*lua.LState) int {
@@ -1212,23 +1224,29 @@ func systemScriptInit(l *lua.LState) {
12121224 l.Push(lua.LString(f))
12131225 return 6
12141226 })
1227+ luaRegister(l, "getGamepadName", func(*lua.LState) int {
1228+ l.Push(lua.LString(joystick[int(numArg(l, 1))].GetGamepadName()))
1229+ return 1
1230+ })
12151231 luaRegister(l, "getKey", func(*lua.LState) int {
12161232 s := ""
12171233 if sys.keyInput != glfw.KeyUnknown {
12181234 s = KeyToString(sys.keyInput)
12191235 }
1220- for j := 0; j < 2; j++ {
1221- if glfw.JoystickPresent(joystick[j]) {
1222- axes := glfw.GetJoystickAxes(joystick[j])
1223- btns := glfw.GetJoystickButtons(joystick[j])
1236+ for j := 0; j < 1; j++ {
1237+ if joystick[j].GetGamepadState != nil {
1238+ axes := joystick[j].GetAxes()
1239+ btns := joystick[j].GetButtons()
12241240 for i := range axes {
1225- if glfw.GetJoystickName(joystick[j]) == "Xbox 360 Controller" { //Xbox360コントローラー判定
1226- if axes[i] > 0 {
1241+ if joystick[j].GetGamepadName() == "Xbox 360 Controller" || strings.Contains(joystick[j].GetGamepadName(), "XInput") { //Xbox360コントローラー判定
1242+ if axes[i] > 0.5 {
1243+ s = strconv.Itoa(-i*2 - 2)
1244+ } else if axes[i] < -0.5 && i < 4 {
12271245 s = strconv.Itoa(-i*2 - 1)
12281246 }
12291247 } else {
12301248 // PS4 Controller support
1231- if glfw.GetJoystickName(joystick[j]) != "Wireless Controller" || !(i == 3 || i == 4) {
1249+ if joystick[j].GetGamepadName() != "Wireless Controller" || !(i == 3 || i == 4) {
12321250 if axes[i] < -0.2 {
12331251 s = strconv.Itoa(-i*2 - 1)
12341252 } else if axes[i] > 0.2 {
@@ -1252,7 +1270,7 @@ func systemScriptInit(l *lua.LState) {
12521270 s := ""
12531271 if sys.keyInput != glfw.KeyUnknown {
12541272 if sys.keyInput == glfw.KeyInsert {
1255- s, _ = sys.window.GetClipboardString()
1273+ s = sys.window.GetClipboardString()
12561274 } else {
12571275 s = sys.keyString
12581276 }
@@ -2251,7 +2269,7 @@ func debugScriptInit(l *lua.LState, file string) error {
22512269 })
22522270 luaRegister(l, "setAILevel", func(*lua.LState) int {
22532271 if sys.netInput == nil && sys.fileInput == nil {
2254- level := int32(numArg(l, 1))
2272+ level := float32(numArg(l, 1))
22552273 sys.com[sys.debugWC.playerNo] = level
22562274 for _, c := range sys.chars[sys.debugWC.playerNo] {
22572275 if level == 0 {
--- a/src/sound.go
+++ b/src/sound.go
@@ -12,7 +12,7 @@ import (
1212
1313 "github.com/faiface/beep"
1414 "github.com/faiface/beep/effects"
15- "github.com/faiface/beep/flac"
15+ //"github.com/faiface/beep/flac"
1616 "github.com/faiface/beep/mp3"
1717 "github.com/faiface/beep/speaker"
1818 "github.com/faiface/beep/vorbis"
@@ -268,9 +268,9 @@ func (bgm *Bgm) IsMp3() bool {
268268 return bgm.IsFormat(".mp3")
269269 }
270270
271-func (bgm *Bgm) IsFLAC() bool {
272- return bgm.IsFormat(".flac")
273-}
271+//func (bgm *Bgm) IsFLAC() bool {
272+// return bgm.IsFormat(".flac")
273+//}
274274
275275 func (bgm *Bgm) IsWAVE() bool {
276276 return bgm.IsFormat(".wav")
@@ -301,8 +301,8 @@ func (bgm *Bgm) Open(filename string, isDefaultBGM bool, loop, bgmVolume, bgmLoo
301301 bgm.ReadVorbis(loop, bgmVolume)
302302 } else if bgm.IsMp3() {
303303 bgm.ReadMp3(loop, bgmVolume)
304- } else if bgm.IsFLAC() {
305- bgm.ConvertFLAC(loop, bgmVolume)
304+ //} else if bgm.IsFLAC() {
305+ // bgm.ConvertFLAC(loop, bgmVolume)
306306 } else if bgm.IsWAVE() {
307307 bgm.ReadWav(loop, bgmVolume)
308308 }
@@ -320,6 +320,7 @@ func (bgm *Bgm) ReadMp3(loop int, bgmVolume int) {
320320 bgm.ReadFormat(format, loop, bgmVolume)
321321 }
322322
323+/*
323324 func (bgm *Bgm) ReadFLAC(loop int, bgmVolume int) {
324325 f, _ := os.Open(bgm.filename)
325326 s, format, err := flac.Decode(f)
@@ -333,6 +334,7 @@ func (bgm *Bgm) ReadFLAC(loop int, bgmVolume int) {
333334 }
334335
335336 // SCREW THE FLAC.SEEK FUNCTION, IT DOES NOT WORK SO WE ARE GOING TO CONVERT THIS TO WAV
337+// Update: Now the flac dependecy broke. (-_-)
336338 func (bgm *Bgm) ConvertFLAC(loop int, bgmVolume int) {
337339 // We open the flac
338340 f1, _ := os.Open(bgm.filename)
@@ -355,6 +357,7 @@ func (bgm *Bgm) ConvertFLAC(loop int, bgmVolume int) {
355357
356358 sys.FLAC_FrameWait = 120
357359 }
360+*/
358361
359362 func (bgm *Bgm) PlayMemAudio(loop int, bgmVolume int) {
360363 f, _ := os.Open(bgm.filename)
--- a/src/system.go
+++ b/src/system.go
@@ -17,13 +17,13 @@ import (
1717 "github.com/faiface/beep"
1818 "github.com/faiface/beep/speaker"
1919 "github.com/go-gl/gl/v2.1/gl"
20- "github.com/go-gl/glfw/v3.2/glfw"
20+ "github.com/go-gl/glfw/v3.3/glfw"
2121 "github.com/timshannon/go-openal/openal"
2222 lua "github.com/yuin/gopher-lua"
2323 )
2424
2525 const (
26- MaxSimul = 8
26+ MaxSimul = 32
2727 MaxAttachedChar = 2
2828 FPS = 60
2929 P1P3Dist = 25
@@ -66,7 +66,7 @@ var sys = System {
6666 keyInput: glfw.KeyUnknown,
6767 keyString: "",
6868 comboExtraFrameWindow: 1,
69- FLAC_FrameWait: -1,
69+ //FLAC_FrameWait: -1,
7070 // Localcoord sceenpack
7171 luaSpriteScale: 1,
7272 luaSmallPortraitScale: 1,
@@ -119,7 +119,7 @@ type System struct {
119119 aiInput [MaxSimul*2 + MaxAttachedChar]AiInput
120120 keyConfig []KeyConfig
121121 JoystickConfig []KeyConfig
122- com [MaxSimul*2 + MaxAttachedChar]int32
122+ com [MaxSimul*2 + MaxAttachedChar]float32
123123 autolevel bool
124124 home int
125125 gameTime int32
@@ -251,7 +251,8 @@ type System struct {
251251 wavVolume int
252252 bgmVolume int
253253 AudioDucking bool
254- FLAC_FrameWait int
254+ windowTitle string
255+ //FLAC_FrameWait int
255256
256257 controllerStickSensitivity float32
257258 xinputTriggerSensitivity float32
@@ -284,10 +285,10 @@ func (s *System) init(w, h int32) *lua.LState {
284285 var err error
285286 if s.fullscreen {
286287 s.window, err = glfw.CreateWindow(int(s.scrrect[2]), int(s.scrrect[3]),
287- "Ikemen GO", glfw.GetPrimaryMonitor(), nil)
288+ s.windowTitle, glfw.GetPrimaryMonitor(), nil)
288289 } else {
289290 s.window, err = glfw.CreateWindow(int(s.scrrect[2]), int(s.scrrect[3]),
290- "Ikemen GO", nil, nil)
291+ s.windowTitle, nil, nil)
291292 }
292293 chk(err)
293294 s.window.MakeContextCurrent()
@@ -473,12 +474,12 @@ func (s *System) soundWrite() {
473474 }
474475 }
475476
476- if s.FLAC_FrameWait >= 0 {
477- if s.FLAC_FrameWait == 0 {
478- s.bgm.PlayMemAudio(s.bgm.loop, s.bgm.bgmVolume)
479- }
480- s.FLAC_FrameWait--
481- }
477+ //if s.FLAC_FrameWait >= 0 {
478+ // if s.FLAC_FrameWait == 0 {
479+ // s.bgm.PlayMemAudio(s.bgm.loop, s.bgm.bgmVolume)
480+ // }
481+ // s.FLAC_FrameWait--
482+ //}
482483 }
483484 src.Delete()
484485 openal.NullContext.Activate()
@@ -765,7 +766,7 @@ func (s *System) commandUpdate() {
765766 for _, c := range p {
766767 if (c.helperIndex == 0 ||
767768 c.helperIndex > 0 && &c.cmd[0] != &r.cmd[0]) &&
768- c.cmd[0].Input(c.key, int32(c.facing), float32(sys.com[i])) {
769+ c.cmd[0].Input(c.key, int32(c.facing), sys.com[i]) {
769770 hp := c.hitPause()
770771 buftime := Btoi(hp && c.gi().ver[0] != 1)
771772 if s.super > 0 {
@@ -786,7 +787,7 @@ func (s *System) commandUpdate() {
786787 cc := int32(-1)
787788 // AI Scaling
788789 // TODO: Balance AI Scaling
789- if r.roundState() == 2 && RandF32(0, float32(sys.com[i])/2+32) > 32 {
790+ if r.roundState() == 2 && RandF32(0, sys.com[i]/2+32) > 32 {
790791 cc = Rand(0, int32(len(r.cmd[r.ss.sb.playerNo].Commands))-1)
791792 } else {
792793 cc = -1