Skip to content

Commit

Permalink
Fixed dirty file flag for abimation
Browse files Browse the repository at this point in the history
Author: wastedabuser
Refs SammyJoeOsborne#2
  • Loading branch information
Adolio committed Jan 24, 2015
1 parent cb73a37 commit 66c14a2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/com/sammyjoeosborne/spriter/utils/ScmlParser.as
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ package com.sammyjoeosborne.spriter.utils

//create timeline objects
$timelineList = $animationList[i].timeline;
for (var k:int = 0; k < $timelineList.length(); k++)
for (var k:int = 0, tmln:int = $timelineList.length(); k < tmln; k++)
{
$timeline = new Timeline(parseInt($timelineList[k].@id), ($timelineList[k].hasOwnProperty("@name")) ? $timelineList[k].@name : "");

$animationData.timelines.push($timeline);

//create key objects within the timeline
$keyList = $timelineList[k].key;
for (var j:int = 0; j < $keyList.length(); j++)
for (var j:int = 0, kln:int = $keyList.length(); j < kln; j++)
{
$keyXML = $keyList[j];
//either bone or object
Expand Down Expand Up @@ -200,8 +200,10 @@ package com.sammyjoeosborne.spriter.utils
$key.prevPivotDirty = !$key.pivot.equals($key.prev.pivot);
$key.prev.nextPivotDirty = !$key.prev.pivot.equals($key.pivot);

$key.prevFileDirty = ($key.file == $key.prev.file);
$key.prev.nextFileDirty = ($key.prev.file == $key.file);
// first and last keys are always with dirty flags true
// this way we gurantee the abimation will start with the correct state on it's first frame
$key.prevFileDirty = ($key.file != $key.prev.file || $key.folder != $key.prev.folder || j == kln - 1);
$key.prev.nextFileDirty = ($key.prev.file != $key.file || $key.prev.folder != $key.folder || j == 0);
}
}

Expand Down

0 comments on commit 66c14a2

Please sign in to comment.