diff --git a/source/animate/FlxAnimate.hx b/source/animate/FlxAnimate.hx index f47cb3cb3..bba955801 100644 --- a/source/animate/FlxAnimate.hx +++ b/source/animate/FlxAnimate.hx @@ -64,6 +64,8 @@ class FlxAnimate extends FlxSymbol // fix render order of ALL layers! // seperate frameList into layers // go thru animate file to see how it should all be ordered + // per frame symbol stuff to fix lip sync (in ParseAnimate?) + // definitely need to dig through Animate.json stuff function actualFrameRender() { diff --git a/source/animate/ParseAnimate.hx b/source/animate/ParseAnimate.hx index 1f8b7fbeb..c62338230 100644 --- a/source/animate/ParseAnimate.hx +++ b/source/animate/ParseAnimate.hx @@ -96,6 +96,8 @@ class ParseAnimate public static var matrixHelp:Array> = []; public static var trpHelpIDK:Array> = []; + public static var loopedFrameShit:Int = 0; + public static function resetFrameList() { frameList = []; @@ -127,11 +129,30 @@ class ParseAnimate if (frameInput == null) frameInput = 0; + var oldFrm:Int = frameInput; + + if (curLoopType == "SF") + { + trace(layer.LN); + + trace(frameArray); + trace(frameInput); + trace(curLoopType); + } + if (curLoopType == "LP") frameInput = frameArray[frameInput % frameArray.length]; + else if (curLoopType == "SF") + { + frameInput = frameArray[loopedFrameShit]; + + // see what happens when something has more than 2 layer? + } else frameInput = frameArray[frameInput]; + // trace(frameMap.get(frameInput)); + var frame:Frame = frameMap.get(frameInput); for (element in frame.E) @@ -154,6 +175,7 @@ class ParseAnimate depthTypeBeat = ""; curLoopType = ""; + loopedFrameShit = 0; } else { @@ -161,7 +183,17 @@ class ParseAnimate trpHelpIDK.push([element.SI.TRP.x, element.SI.TRP.y]); depthTypeBeat += "->" + element.SI.SN; curLoopType = element.SI.LP; - parseTimeline(symbolMap.get(element.SI.SN).TL, tabbed + 1, element.SI.FF); + + var inputFrame:Int = element.SI.FF; + + // JANKY FIX, MAY NOT ACCOUNT FOR ALL SCENARIOS! + if (curLoopType == "SF") + { + trace("LOOP SHIT: " + inputFrame); + loopedFrameShit = inputFrame; + } + + parseTimeline(symbolMap.get(element.SI.SN).TL, tabbed + 1, inputFrame); } }