• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

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

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

Go で書き直した Ikemen


コミットメタ情報

リビジョン5285bac7ea45cec054b767200f9c770fe087df46 (tree)
日時2019-09-15 02:31:15
作者neatunsou <sisiy4excite@gmai...>
コミッターneatunsou

ログメッセージ

StoryboardのBGCtrlの移動量がlocalcoordの影響を受けるように修正
StoryboardのCtrldef名が重複して上書きされる場合があったのを修正
Storyboardにskipbuttonオプションを追加
Targetbindの基準posにlocalcoordを考慮してなかったのを修正
AIRのinterploateオプションでアニメがloopした場合の動作を修正

変更サマリ

差分

--- a/script/main.lua
+++ b/script/main.lua
@@ -569,7 +569,7 @@ function main.f_ctrlBG(t_bg, t_ctrl)
569569 end
570570
571571 --draw background layers
572-function main.f_drawBG(data, info, layerno, timer)
572+function main.f_drawBG(data, info, layerno, timer, localcoord)
573573 timer = timer or 0
574574 --loop through all backgrounds
575575 for i = 1, #data do
@@ -605,34 +605,38 @@ function main.f_drawBG(data, info, layerno, timer)
605605 info[i].ctrl_flags.enabled = t.value
606606 elseif k == 'velset' or k == 'posset' then
607607 if t.x ~= nil then
608- info[i].ctrl_flags.velx = 0 - info[i].velocity[1] + t.x
608+ info[i].ctrl_flags.velx = 0 - info[i].velocity[1] + t.x * 320/localcoord[1]
609609 end
610610 if t.y ~= nil then
611- info[i].ctrl_flags.vely = 0 - info[i].velocity[2] + t.y
611+ info[i].ctrl_flags.vely = 0 - info[i].velocity[2] + t.y * 240/localcoord[2]
612612 end
613- elseif k == 'veladd' or k == 'posadd' then
613+ elseif k == 'veladd' then --or k == 'posadd' then
614614 if t.x ~= nil then
615- info[i].ctrl_flags.velx = info[i].ctrl_flags.velx + t.x
615+ info[i].ctrl_flags.velx = info[i].ctrl_flags.velx + t.x * 320/localcoord[1]
616616 end
617617 if t.y ~= nil then
618- info[i].ctrl_flags.vely = info[i].ctrl_flags.vely + t.y
618+ info[i].ctrl_flags.vely = info[i].ctrl_flags.vely + t.y * 240/localcoord[2]
619619 end
620+ elseif k == 'posadd' then
621+ if t.x ~= nil then x = t.x * 320/localcoord[1] end
622+ if t.y ~= nil then y = t.y * 240/localcoord[2] end
623+ animAddPos(data[i], x, y)
620624 --[[elseif k == 'posset' then
621625 if t.x ~= nil then
622- x = t.x
626+ x = t.x * 320/localcoord[1]
623627 else
624628 x = info[i].start[1]
625629 end
626- if t.y == nil then
627- y = t.y
630+ if t.y ~= nil then
631+ y = t.y * 240/localcoord[2]
628632 else
629633 y = info[i].start[2]
630634 end
631635 animSetPos(data[i], x, y)
632636 animAddPos(data[i], 160, 0) --for some reason needed in ikemen
633637 elseif k == 'posadd' then
634- if t.x ~= nil then x = t.x end
635- if t.y ~= nil then y = t.y end
638+ if t.x ~= nil then x = t.x * 320/localcoord[1] end
639+ if t.y ~= nil then y = t.y * 240/localcoord[2] end
636640 animAddPos(data[i], x, y)]]
637641 --elseif k == 'anim' then --not supported yet
638642 --elseif k == 'sinx' then --not supported yet
@@ -725,9 +729,9 @@ function main.f_warning(t, info, background, font_info, title, box)
725729 --draw clearcolor
726730 animDraw(background.bgclearcolor_data)
727731 --draw layerno = 0 backgrounds
728- main.f_drawBG(background.bg_data, background.bg, 0, background.timer)
732+ main.f_drawBG(background.bg_data, background.bg, 0, background.timer, {320,240})
729733 --draw layerno = 1 backgrounds
730- main.f_drawBG(background.bg_data, background.bg, 1, background.timer)
734+ main.f_drawBG(background.bg_data, background.bg, 1, background.timer, {320,240})
731735 --draw menu box
732736 animDraw(box)
733737 --draw title
@@ -794,9 +798,9 @@ function main.f_input(t, info, background, type)
794798 --draw clearcolor
795799 animDraw(background.bgclearcolor_data)
796800 --draw layerno = 0 backgrounds
797- main.f_drawBG(background.bg_data, background.bg, 0, background.timer)
801+ main.f_drawBG(background.bg_data, background.bg, 0, background.timer, {320,240})
798802 --draw layerno = 1 backgrounds
799- main.f_drawBG(background.bg_data, background.bg, 1, background.timer)
803+ main.f_drawBG(background.bg_data, background.bg, 1, background.timer, {320,240})
800804 --draw menu box
801805 animDraw(main.warningBox)
802806 --draw text
@@ -1106,7 +1110,7 @@ file:close()
11061110 content = content:gsub('([^\r\n;]*)%s*;[^\r\n]*', '%1')
11071111 content = content:gsub('\n%s*\n', '\n')
11081112 for line in content:gmatch('[^\r\n]+') do
1109- if chars + stages == 90 then
1113+ if chars + stages == 100 then
11101114 SetGCPercent(100)
11111115 end
11121116 --for line in io.lines("data/select.def") do
@@ -1488,7 +1492,7 @@ function main.f_menuCommon2(cursorPosY, moveTxt, item, t)
14881492 --draw clearcolor
14891493 animDraw(motif.titlebgdef.bgclearcolor_data)
14901494 --draw layerno = 0 backgrounds
1491- main.f_drawBG(motif.titlebgdef.bg_data, motif.titlebgdef.bg, 0, motif.titlebgdef.timer)
1495+ main.f_drawBG(motif.titlebgdef.bg_data, motif.titlebgdef.bg, 0, motif.titlebgdef.timer, {320,240})
14921496 --draw menu items
14931497 local items_shown = item + motif.title_info.menu_window_visibleitems - cursorPosY
14941498 if motif.title_info.menu_window_margins_y[2] ~= 0 and items_shown < #t then
@@ -1545,7 +1549,7 @@ function main.f_menuCommon2(cursorPosY, moveTxt, item, t)
15451549 animDraw(main.cursorBox)
15461550 end
15471551 --draw layerno = 1 backgrounds
1548- main.f_drawBG(motif.titlebgdef.bg_data, motif.titlebgdef.bg, 1, motif.titlebgdef.timer)
1552+ main.f_drawBG(motif.titlebgdef.bg_data, motif.titlebgdef.bg, 1, motif.titlebgdef.timer, {320,240})
15491553 --footer draw
15501554 if motif.title_info.footer_boxbackground_visible == 1 then
15511555 animDraw(footerBox)
@@ -1738,9 +1742,9 @@ function main.f_connect(server, t)
17381742 --draw clearcolor
17391743 animDraw(motif.titlebgdef.bgclearcolor_data)
17401744 --draw layerno = 0 backgrounds
1741- main.f_drawBG(motif.titlebgdef.bg_data, motif.titlebgdef.bg, 0, motif.titlebgdef.timer)
1745+ main.f_drawBG(motif.titlebgdef.bg_data, motif.titlebgdef.bg, 0, motif.titlebgdef.timer, {320,240})
17421746 --draw layerno = 1 backgrounds
1743- main.f_drawBG(motif.titlebgdef.bg_data, motif.titlebgdef.bg, 1, motif.titlebgdef.timer)
1747+ main.f_drawBG(motif.titlebgdef.bg_data, motif.titlebgdef.bg, 1, motif.titlebgdef.timer, {320,240})
17441748 --draw menu box
17451749 animDraw(main.warningBox)
17461750 --draw text
--- a/script/options.lua
+++ b/script/options.lua
@@ -190,7 +190,7 @@ function options.f_menuCommon2(cursorPosY, moveTxt, item, t)
190190 --draw clearcolor
191191 animDraw(motif.optionbgdef.bgclearcolor_data)
192192 --draw layerno = 0 backgrounds
193- main.f_drawBG(motif.optionbgdef.bg_data, motif.optionbgdef.bg, 0, motif.optionbgdef.timer)
193+ main.f_drawBG(motif.optionbgdef.bg_data, motif.optionbgdef.bg, 0, motif.optionbgdef.timer, {320,240})
194194 --draw menu box
195195 if motif.option_info.menu_boxbackground_visible == 1 then
196196 if #t > motif.option_info.menu_window_visibleitems and moveTxt == (#t - motif.option_info.menu_window_visibleitems) * motif.option_info.menu_item_spacing[2] then
@@ -295,7 +295,7 @@ function options.f_menuCommon2(cursorPosY, moveTxt, item, t)
295295 animDraw(main.cursorBox)
296296 end
297297 --draw layerno = 1 backgrounds
298- main.f_drawBG(motif.optionbgdef.bg_data, motif.optionbgdef.bg, 1, motif.optionbgdef.timer)
298+ main.f_drawBG(motif.optionbgdef.bg_data, motif.optionbgdef.bg, 1, motif.optionbgdef.timer, {320,240})
299299 --draw fadein
300300 animDraw(motif.option_info.fadein_data)
301301 animUpdate(motif.option_info.fadein_data)
--- a/script/select.lua
+++ b/script/select.lua
@@ -1031,10 +1031,10 @@ function select.f_selectTournamentScreen()
10311031 --draw clearcolor
10321032 animDraw(motif.tournamentbgdef.bgclearcolor_data)
10331033 --draw layerno = 0 backgrounds
1034- main.f_drawBG(motif.tournamentbgdef.bg_data, motif.tournamentbgdef.bg, 0, motif.tournamentbgdef.timer)
1034+ main.f_drawBG(motif.tournamentbgdef.bg_data, motif.tournamentbgdef.bg, 0, motif.tournamentbgdef.timer, {320,240})
10351035
10361036 --draw layerno = 1 backgrounds
1037- main.f_drawBG(motif.tournamentbgdef.bg_data, motif.tournamentbgdef.bg, 1, motif.tournamentbgdef.timer)
1037+ main.f_drawBG(motif.tournamentbgdef.bg_data, motif.tournamentbgdef.bg, 1, motif.tournamentbgdef.timer, {320,240})
10381038 --draw fadein
10391039 animDraw(motif.tournament_info.fadein_data)
10401040 animUpdate(motif.tournament_info.fadein_data)
@@ -1086,7 +1086,7 @@ function select.f_selectScreen()
10861086 --draw clearcolor
10871087 animDraw(motif.selectbgdef.bgclearcolor_data)
10881088 --draw layerno = 0 backgrounds
1089- main.f_drawBG(motif.selectbgdef.bg_data, motif.selectbgdef.bg, 0, motif.selectbgdef.timer)
1089+ main.f_drawBG(motif.selectbgdef.bg_data, motif.selectbgdef.bg, 0, motif.selectbgdef.timer, {320,240})
10901090 --draw title
10911091 textImgDraw(main.txt_mainSelect)
10921092 if p1Cell then
@@ -1263,7 +1263,7 @@ function select.f_selectScreen()
12631263 end
12641264 end
12651265 --draw layerno = 1 backgrounds
1266- main.f_drawBG(motif.selectbgdef.bg_data, motif.selectbgdef.bg, 1, motif.selectbgdef.timer)
1266+ main.f_drawBG(motif.selectbgdef.bg_data, motif.selectbgdef.bg, 1, motif.selectbgdef.timer, {320,240})
12671267 --draw fadein
12681268 animDraw(motif.select_info.fadein_data)
12691269 animUpdate(motif.select_info.fadein_data)
@@ -2195,7 +2195,7 @@ function select.f_selectVersus()
21952195 --draw clearcolor
21962196 animDraw(motif.versusbgdef.bgclearcolor_data)
21972197 --draw layerno = 0 backgrounds
2198- main.f_drawBG(motif.versusbgdef.bg_data, motif.versusbgdef.bg, 0, motif.versusbgdef.timer)
2198+ main.f_drawBG(motif.versusbgdef.bg_data, motif.versusbgdef.bg, 0, motif.versusbgdef.timer, {320,240})
21992199 --draw portraits
22002200 select.f_drawPortrait(
22012201 t_p1Selected,
@@ -2253,7 +2253,7 @@ function select.f_selectVersus()
22532253 textImgDraw(txt_matchNo)
22542254 end
22552255 --draw layerno = 1 backgrounds
2256- main.f_drawBG(motif.versusbgdef.bg_data, motif.versusbgdef.bg, 1, motif.versusbgdef.timer)
2256+ main.f_drawBG(motif.versusbgdef.bg_data, motif.versusbgdef.bg, 1, motif.versusbgdef.timer, {320,240})
22572257 --draw fadein
22582258 animDraw(motif.vs_screen.fadein_data)
22592259 animUpdate(motif.vs_screen.fadein_data)
@@ -2334,7 +2334,7 @@ function select.f_result(state)
23342334 --draw clearcolor
23352335 --animDraw(motif.resultsbgdef.bgclearcolor_data) --disabled to not cover game screen
23362336 --draw layerno = 0 backgrounds
2337- main.f_drawBG(motif.resultsbgdef.bg_data, motif.resultsbgdef.bg, 0, motif.resultsbgdef.timer)
2337+ main.f_drawBG(motif.resultsbgdef.bg_data, motif.resultsbgdef.bg, 0, motif.resultsbgdef.timer, {320,240})
23382338 --draw text
23392339 for i = 1, #t_resultText do
23402340 textImgSetText(txt, t_resultText[i])
@@ -2346,7 +2346,7 @@ function select.f_result(state)
23462346 textImgDraw(txt)
23472347 end
23482348 --draw layerno = 1 backgrounds
2349- main.f_drawBG(motif.resultsbgdef.bg_data, motif.resultsbgdef.bg, 1, motif.resultsbgdef.timer)
2349+ main.f_drawBG(motif.resultsbgdef.bg_data, motif.resultsbgdef.bg, 1, motif.resultsbgdef.timer, {320,240})
23502350 --draw fadein
23512351 animDraw(t.fadein_data)
23522352 animUpdate(t.fadein_data)
@@ -2440,7 +2440,7 @@ function select.f_selectVictory()
24402440 --draw clearcolor
24412441 animDraw(motif.victorybgdef.bgclearcolor_data)
24422442 --draw layerno = 0 backgrounds
2443- main.f_drawBG(motif.victorybgdef.bg_data, motif.victorybgdef.bg, 0, motif.victorybgdef.timer)
2443+ main.f_drawBG(motif.victorybgdef.bg_data, motif.victorybgdef.bg, 0, motif.victorybgdef.timer, {320,240})
24442444 --draw portraits
24452445 if motif.victory_screen.p2_display == 0 then
24462446 drawVictoryPortrait(
@@ -2484,7 +2484,7 @@ function select.f_selectVictory()
24842484 motif.victory_screen.winquote_length
24852485 )
24862486 --draw layerno = 1 backgrounds
2487- main.f_drawBG(motif.victorybgdef.bg_data, motif.victorybgdef.bg, 1, motif.victorybgdef.timer)
2487+ main.f_drawBG(motif.victorybgdef.bg_data, motif.victorybgdef.bg, 1, motif.victorybgdef.timer, {320,240})
24882488 --draw fadein
24892489 animDraw(motif.victory_screen.fadein_data)
24902490 animUpdate(motif.victory_screen.fadein_data)
@@ -2525,7 +2525,7 @@ function select.f_continue()
25252525 --draw clearcolor (disabled to not cover area)
25262526 --animDraw(motif.continuebgdef.bgclearcolor_data)
25272527 --draw layerno = 0 backgrounds
2528- main.f_drawBG(motif.continuebgdef.bg_data, motif.continuebgdef.bg, 0, motif.continuebgdef.timer)
2528+ main.f_drawBG(motif.continuebgdef.bg_data, motif.continuebgdef.bg, 0, motif.continuebgdef.timer, {320,240})
25292529 --continue screen state
25302530 if esc() or motif.continuebgdef.timer > motif.continue_screen.endtime then
25312531 main.f_cmdInput()
@@ -2600,7 +2600,7 @@ function select.f_continue()
26002600 animUpdate(motif.continue_screen.continue_anim_data)
26012601 animDraw(motif.continue_screen.continue_anim_data)
26022602 --draw layerno = 1 backgrounds
2603- main.f_drawBG(motif.continuebgdef.bg_data, motif.continuebgdef.bg, 1, motif.continuebgdef.timer)
2603+ main.f_drawBG(motif.continuebgdef.bg_data, motif.continuebgdef.bg, 1, motif.continuebgdef.timer, {320,240})
26042604 --draw fadein
26052605 animDraw(motif.continue_screen.fadein_data)
26062606 animUpdate(motif.continue_screen.fadein_data)
--- a/script/storyboard.lua
+++ b/script/storyboard.lua
@@ -54,7 +54,7 @@ local function f_play(t)
5454 if k >= t.scenedef.startscene then
5555 for i = 0, t.scene[k].end_time do
5656 --end storyboard
57- if esc() or main.f_btnPalNo(main.p1Cmd) > 0 then
57+ if esc() or main.f_btnPalNo(main.p1Cmd) > 0 and t.scenedef.skipbutton > 0 then
5858 main.f_cmdInput()
5959 refresh()
6060 return
@@ -75,7 +75,7 @@ local function f_play(t)
7575 animDraw(t.scene[k].clearcolor_data)
7676 --draw layerno = 0 backgrounds
7777 if t.scene[k].bg_name ~= '' then
78- main.f_drawBG(t.scene[k].bg_data, t[t.scene[k].bg_name .. 'def'], 0, i)
78+ main.f_drawBG(t.scene[k].bg_data, t[t.scene[k].bg_name .. 'def'], 0, i, t.info.localcoord)
7979 end
8080 --loop through layers in order
8181 for k2, v2 in main.f_sortKeys(t.scene[k].layer) do
@@ -103,7 +103,7 @@ local function f_play(t)
103103 end
104104 --draw layerno = 1 backgrounds
105105 if t.scene[k].bg_name ~= '' then
106- main.f_drawBG(t.scene[k].bg_data, t[t.scene[k].bg_name .. 'def'], 1, i)
106+ main.f_drawBG(t.scene[k].bg_data, t[t.scene[k].bg_name .. 'def'], 1, i, t.info.localcoord)
107107 end
108108 --fadein
109109 if i <= t.scene[k].fadein_time then
@@ -115,6 +115,13 @@ local function f_play(t)
115115 animDraw(t.scene[k].fadeout_data)
116116 animUpdate(t.scene[k].fadeout_data)
117117 end
118+ if main.f_btnPalNo(main.p1Cmd) > 0 and t.scenedef.skipbutton <= 0 then
119+ main.f_cmdInput()
120+ refresh()
121+ do
122+ break
123+ end
124+ end
118125 main.f_cmdInput()
119126 refresh()
120127 end
@@ -146,7 +153,7 @@ local function f_parse(path)
146153 local t_default =
147154 {
148155 info = {localcoord = {320, 240}},
149- scenedef = {spr = '', snd = '', font = {[1] = 'font/f-6x9.fnt'}, font_height = {}, startscene = 0, font_data = {}},
156+ scenedef = {spr = '', snd = '', font = {[1] = 'font/f-6x9.fnt'}, font_height = {}, startscene = 0, skipbutton = 1, font_data = {}},
150157 scene = {},
151158 ctrldef = {}
152159 }
@@ -160,6 +167,9 @@ local function f_parse(path)
160167 if row:match('.+ctrldef') then --matched ctrldef start
161168 bgctrl = row
162169 bgctrl_match = bgctrl:match('^(.-ctrl)def')
170+ if t.ctrldef[bgdef .. 'def'][bgctrl] ~= nil then --Ctrldef名の重複を避ける
171+ bgctrl = bgctrl..tostring(os.clock())
172+ end
163173 t.ctrldef[bgdef .. 'def'][bgctrl] = {}
164174 t.ctrldef[bgdef .. 'def'][bgctrl].ctrl = {}
165175 pos = t.ctrldef[bgdef .. 'def'][bgctrl]
@@ -225,6 +235,7 @@ local function f_parse(path)
225235 t.scene[row] = {}
226236 pos = t.scene[row]
227237 pos.layer = {}
238+ pos.sound = {}
228239 t_default.scene[row] =
229240 {
230241 end_time = 0,
@@ -477,10 +488,10 @@ local function f_parse(path)
477488 if t_bgdef[k2].window ~= nil then
478489 animSetWindow(
479490 anim,
480- t_bgdef[k2].window[1],
481- t_bgdef[k2].window[2],
482- t_bgdef[k2].window[3] - t_bgdef[k2].window[1] + 1,
483- t_bgdef[k2].window[4] - t_bgdef[k2].window[2] + 1
491+ t_bgdef[k2].window[1] * 320/t.info.localcoord[1],
492+ t_bgdef[k2].window[2] * 240/t.info.localcoord[2],
493+ (t_bgdef[k2].window[3] - t_bgdef[k2].window[1] + 1)* 320/t.info.localcoord[1],
494+ (t_bgdef[k2].window[4] - t_bgdef[k2].window[2] + 1) * 240/t.info.localcoord[2]
484495 )
485496 else
486497 animSetWindow(anim, 0, 0, t.info.localcoord[1], t.info.localcoord[2])
--- a/src/anim.go
+++ b/src/anim.go
@@ -484,66 +484,68 @@ func (a *Animation) UpdateSprite() {
484484 }
485485 }
486486 }
487- if int(a.drawidx) < len(a.frames)-1 {
488- for _, i := range a.interpolate_offset {
489- if a.drawidx+1 == i {
490- a.interpolate_offset_x = float32(a.frames[a.drawidx+1].X-a.frames[a.drawidx].X) / float32(a.curFrame().Time) * float32(a.time)
491- a.interpolate_offset_y = float32(a.frames[a.drawidx+1].Y-a.frames[a.drawidx].Y) / float32(a.curFrame().Time) * float32(a.time)
492- break
493- }
487+ nextDrawidx := a.drawidx + 1
488+ if int(a.drawidx) >= len(a.frames)-1 {
489+ nextDrawidx = a.loopstart
490+ }
491+ for _, i := range a.interpolate_offset {
492+ if nextDrawidx == i {
493+ a.interpolate_offset_x = float32(a.frames[nextDrawidx].X-a.frames[a.drawidx].X) / float32(a.curFrame().Time) * float32(a.time)
494+ a.interpolate_offset_y = float32(a.frames[nextDrawidx].Y-a.frames[a.drawidx].Y) / float32(a.curFrame().Time) * float32(a.time)
495+ break
494496 }
495- for _, i := range a.interpolate_scale {
496- if a.drawidx+1 == i {
497- var drawframe_scale_x, nextframe_scale_x, drawframe_scale_y, nextframe_scale_y float32 = 1, 1, 1, 1
498- if len(a.frames[a.drawidx].Ex) > 2 {
499- if len(a.frames[a.drawidx].Ex[2]) > 0 {
500- drawframe_scale_x = a.frames[a.drawidx].Ex[2][0]
501- }
502- if len(a.frames[a.drawidx].Ex[2]) > 1 {
503- drawframe_scale_y = a.frames[a.drawidx].Ex[2][1]
504- }
497+ }
498+ for _, i := range a.interpolate_scale {
499+ if nextDrawidx == i {
500+ var drawframe_scale_x, nextframe_scale_x, drawframe_scale_y, nextframe_scale_y float32 = 1, 1, 1, 1
501+ if len(a.frames[a.drawidx].Ex) > 2 {
502+ if len(a.frames[a.drawidx].Ex[2]) > 0 {
503+ drawframe_scale_x = a.frames[a.drawidx].Ex[2][0]
505504 }
506- if len(a.frames[a.drawidx+1].Ex) > 2 {
507- if len(a.frames[a.drawidx+1].Ex[2]) > 0 {
508- nextframe_scale_x = a.frames[a.drawidx+1].Ex[2][0]
509- }
510- if len(a.frames[a.drawidx+1].Ex[2]) > 1 {
511- nextframe_scale_y = a.frames[a.drawidx+1].Ex[2][1]
512- }
505+ if len(a.frames[a.drawidx].Ex[2]) > 1 {
506+ drawframe_scale_y = a.frames[a.drawidx].Ex[2][1]
507+ }
508+ }
509+ if len(a.frames[nextDrawidx].Ex) > 2 {
510+ if len(a.frames[nextDrawidx].Ex[2]) > 0 {
511+ nextframe_scale_x = a.frames[nextDrawidx].Ex[2][0]
512+ }
513+ if len(a.frames[nextDrawidx].Ex[2]) > 1 {
514+ nextframe_scale_y = a.frames[nextDrawidx].Ex[2][1]
513515 }
514- a.scale_x += (nextframe_scale_x - drawframe_scale_x) / float32(a.curFrame().Time) * float32(a.time)
515- a.scale_y += (nextframe_scale_y - drawframe_scale_y) / float32(a.curFrame().Time) * float32(a.time)
516- break
517516 }
517+ a.scale_x += (nextframe_scale_x - drawframe_scale_x) / float32(a.curFrame().Time) * float32(a.time)
518+ a.scale_y += (nextframe_scale_y - drawframe_scale_y) / float32(a.curFrame().Time) * float32(a.time)
519+ break
518520 }
519- for _, i := range a.interpolate_angle {
520- if a.drawidx+1 == i {
521- var drawframe_angle, nextframe_angle float32 = 0, 0
522- if len(a.frames[a.drawidx].Ex) > 2 {
523- if len(a.frames[a.drawidx].Ex[2]) > 2 {
524- drawframe_angle = a.frames[a.drawidx].Ex[2][2]
525- }
521+ }
522+ for _, i := range a.interpolate_angle {
523+ if nextDrawidx == i {
524+ var drawframe_angle, nextframe_angle float32 = 0, 0
525+ if len(a.frames[a.drawidx].Ex) > 2 {
526+ if len(a.frames[a.drawidx].Ex[2]) > 2 {
527+ drawframe_angle = a.frames[a.drawidx].Ex[2][2]
526528 }
527- if len(a.frames[a.drawidx+1].Ex) > 2 {
528- if len(a.frames[a.drawidx+1].Ex[2]) > 2 {
529- nextframe_angle = a.frames[a.drawidx+1].Ex[2][2]
530- }
529+ }
530+ if len(a.frames[nextDrawidx].Ex) > 2 {
531+ if len(a.frames[nextDrawidx].Ex[2]) > 2 {
532+ nextframe_angle = a.frames[nextDrawidx].Ex[2][2]
531533 }
532- a.angle += (nextframe_angle - drawframe_angle) / float32(a.curFrame().Time) * float32(a.time)
533- break
534534 }
535+ a.angle += (nextframe_angle - drawframe_angle) / float32(a.curFrame().Time) * float32(a.time)
536+ break
535537 }
536- if byte(a.interpolate_blend_srcalpha) != 1 ||
537- byte(a.interpolate_blend_dstalpha) != 255 {
538- for _, i := range a.interpolate_blend {
539- if a.drawidx+1 == i {
540- a.interpolate_blend_srcalpha += (float32(a.frames[a.drawidx+1].SrcAlpha) - a.interpolate_blend_srcalpha) / float32(a.curFrame().Time) * float32(a.time)
541- a.interpolate_blend_dstalpha += (float32(a.frames[a.drawidx+1].DstAlpha) - a.interpolate_blend_dstalpha) / float32(a.curFrame().Time) * float32(a.time)
542- if byte(a.interpolate_blend_srcalpha) == 1 && byte(a.interpolate_blend_dstalpha) == 255 {
543- a.interpolate_blend_srcalpha = 0
544- }
545- break
538+ }
539+ if byte(a.interpolate_blend_srcalpha) != 1 ||
540+ byte(a.interpolate_blend_dstalpha) != 255 {
541+ for _, i := range a.interpolate_blend {
542+ if nextDrawidx == i {
543+ a.interpolate_blend_srcalpha += (float32(a.frames[nextDrawidx].SrcAlpha) - a.interpolate_blend_srcalpha) / float32(a.curFrame().Time) * float32(a.time)
544+ a.interpolate_blend_dstalpha += (float32(a.frames[nextDrawidx].DstAlpha) - a.interpolate_blend_dstalpha) / float32(a.curFrame().Time) * float32(a.time)
545+ if byte(a.interpolate_blend_srcalpha) == 1 && byte(a.interpolate_blend_dstalpha) == 255 {
546+ a.interpolate_blend_srcalpha = 0
546547 }
548+ break
547549 }
548550 }
549551 }
--- a/src/char.go
+++ b/src/char.go
@@ -4014,14 +4014,14 @@ func (c *Char) bind() {
40144014 if AbsF(c.bindFacing) == 2 {
40154015 f = c.bindFacing / 2
40164016 }
4017- c.setX(bt.pos[0] + f*c.bindPos[0])
4017+ c.setX(bt.pos[0]*bt.localscl/c.localscl + f*c.bindPos[0])
40184018 c.drawPos[0] += bt.drawPos[0] - bt.pos[0]
40194019 c.oldPos[0] += bt.oldPos[0] - bt.pos[0]
40204020 c.pushed = c.pushed || bt.pushed
40214021 c.ghv.xoff = 0
40224022 }
40234023 if !math.IsNaN(float64(c.bindPos[1])) {
4024- c.setY(bt.pos[1] + c.bindPos[1])
4024+ c.setY(bt.pos[1]*bt.localscl/c.localscl + c.bindPos[1])
40254025 c.drawPos[1] += bt.drawPos[1] - bt.pos[1]
40264026 c.oldPos[1] += bt.oldPos[1] - bt.pos[1]
40274027 c.ghv.yoff = 0