Go で書き直した Ikemen
修訂 | deb8e826f6c400a0990adf8b60dbbc3d72f19b59 (tree) |
---|---|
時間 | 2019-12-05 22:41:45 |
作者 | neatunsou <sisiy4excite@gmai...> |
Commiter | neatunsou |
fvar(38)が参照できないバグを修正
QuickLaunchでのキャラセレでスプライトの読み込みを毎フレーム試みようとする場合があったのを修正
@@ -367,6 +367,9 @@ const ( | ||
367 | 367 | OC_ex_groundangle |
368 | 368 | OC_ex_stagefrontedge |
369 | 369 | OC_ex_stagebackedge |
370 | + OC_ex_const240p | |
371 | + OC_ex_const480p | |
372 | + OC_ex_const720p | |
370 | 373 | OC_ex_gethitvar_animtype |
371 | 374 | OC_ex_gethitvar_airtype |
372 | 375 | OC_ex_gethitvar_groundtype |
@@ -398,12 +401,7 @@ const ( | ||
398 | 401 | OC_ex_gethitvar_fall_envshake_freq |
399 | 402 | OC_ex_gethitvar_fall_envshake_ampl |
400 | 403 | OC_ex_gethitvar_fall_envshake_phase |
401 | -) | |
402 | -const ( | |
403 | - OC_ex_const240p OpCode = iota + 100 | |
404 | - OC_ex_const480p | |
405 | - OC_ex_const720p | |
406 | - OC_ailevelf // float version of AILevel | |
404 | + OC_ex_ailevelf // float version of AILevel | |
407 | 405 | ) |
408 | 406 | const ( |
409 | 407 | NumVar = OC_sysvar0 - OC_var0 |
@@ -979,8 +977,6 @@ func (be BytecodeExp) run(c *Char) BytecodeValue { | ||
979 | 977 | sys.bcStack.Swap() |
980 | 978 | case OC_ailevel: |
981 | 979 | sys.bcStack.PushI(int32(c.aiLevel())) |
982 | - case OC_ailevelf: | |
983 | - sys.bcStack.PushF(c.aiLevel()) | |
984 | 980 | case OC_alive: |
985 | 981 | sys.bcStack.PushB(c.alive()) |
986 | 982 | case OC_anim: |
@@ -1590,6 +1586,8 @@ func (be BytecodeExp) run_ex(c *Char, i *int, oc *Char) { | ||
1590 | 1586 | *sys.bcStack.Top() = c.constp(640, sys.bcStack.Top().ToF()) |
1591 | 1587 | case OC_ex_const720p: |
1592 | 1588 | *sys.bcStack.Top() = c.constp(960, sys.bcStack.Top().ToF()) |
1589 | + case OC_ex_ailevelf: | |
1590 | + sys.bcStack.PushF(c.aiLevel()) | |
1593 | 1591 | default: |
1594 | 1592 | sys.errLog.Printf("%v\n", be[*i-1]) |
1595 | 1593 | c.panic() |
@@ -1151,7 +1151,7 @@ func (c *Compiler) expValue(out *BytecodeExp, in *string, | ||
1151 | 1151 | case "ailevel": |
1152 | 1152 | out.append(OC_ailevel) |
1153 | 1153 | case "ailevelf": |
1154 | - out.append(OC_ailevelf) | |
1154 | + out.append(OC_ex_, OC_ex_ailevelf) | |
1155 | 1155 | case "alive": |
1156 | 1156 | out.append(OC_alive) |
1157 | 1157 | case "anim": |
@@ -698,6 +698,7 @@ func systemScriptInit(l *lua.LState) { | ||
698 | 698 | var err error |
699 | 699 | c.sportrait, err = loadFromSff(file, sys.sel.sportrait[0], sys.sel.sportrait[1]) |
700 | 700 | if err != nil { |
701 | + c.sportrait = newSprite() | |
701 | 702 | return nil |
702 | 703 | } |
703 | 704 | if len(c.pal) == 0 { |
@@ -1112,6 +1113,9 @@ func systemScriptInit(l *lua.LState) { | ||
1112 | 1113 | LoadFile(&c.sprite, c.def, func(file string) error { |
1113 | 1114 | var err error |
1114 | 1115 | c.lportrait, err = loadFromSff(file, sys.sel.lportrait[0], sys.sel.lportrait[1]) |
1116 | + if err != nil { | |
1117 | + c.lportrait = newSprite() | |
1118 | + } | |
1115 | 1119 | c.vsportrait, err = loadFromSff(file, sys.sel.vsportrait[0], sys.sel.vsportrait[1]) |
1116 | 1120 | if err != nil { |
1117 | 1121 | c.vsportrait = c.lportrait |
@@ -1119,6 +1123,7 @@ func systemScriptInit(l *lua.LState) { | ||
1119 | 1123 | c.vportrait, err = loadFromSff(file, sys.sel.vportrait[0], sys.sel.vportrait[1]) |
1120 | 1124 | if err != nil { |
1121 | 1125 | c.vportrait = c.lportrait |
1126 | + return nil | |
1122 | 1127 | } |
1123 | 1128 | if len(c.pal) == 0 { |
1124 | 1129 | c.pal, _ = selectablePalettes(file) |