[runtimes] Closes #719, fixed sortPathConstraintAttachment

This commit is contained in:
badlogic 2016-10-13 12:03:23 +02:00
parent f84ae17615
commit 1ecd627afa
20 changed files with 70 additions and 38 deletions

View File

@ -213,8 +213,13 @@ public class Skeleton {
sortBone(slotBone);
else {
var bones:Vector.<Bone> = this.bones;
for each (var boneIndex:int in pathBones)
sortBone(bones[boneIndex]);
var i:int = 0;
while (i < pathBones.length) {
var boneCount:int = pathBones[i++];
for (var n:int = i + boneCount; i < n; i++) {
sortBone(bones[pathBones[i]]);
}
}
}
}

View File

@ -186,10 +186,13 @@ static void _sortPathConstraintAttachmentBones(_spSkeleton* const internal, spAt
_sortBone(internal, slotBone);
else {
spBone** bones = internal->super.bones;
int i;
for (i = 0; i < pathBonesCount; i++)
int i = 0;
while (i < pathBonesCount) {
int boneCount = pathBones[i++];
for (int n = i + boneCount; i < n; i++)
_sortBone(internal, bones[pathBones[i]]);
}
}
}
static void _sortPathConstraintAttachment(_spSkeleton* const internal, spSkin* skin, int slotIndex, spBone* slotBone) {

View File

@ -42,9 +42,9 @@ public class Main extends Sprite {
public function Main () {
var example:Class;
// example = SpineboyExample;
example = GoblinsExample;
// example = GoblinsExample;
// example = RaptorExample;
// example = TankExample;
example = TankExample;
// example = VineExample;
_starling = new Starling(example, stage);

View File

@ -2941,11 +2941,15 @@ var spine;
this.sortBone(slotBone);
else {
var bones = this.bones;
for (var i = 0; i < pathBones.length; i++) {
var i = 0;
while (i < pathBones.length) {
var boneCount = pathBones[i++];
for (var n = i + boneCount; i < n; i++) {
var boneIndex = pathBones[i];
this.sortBone(bones[boneIndex]);
}
}
}
};
Skeleton.prototype.sortBone = function (bone) {
if (bone.sorted)

File diff suppressed because one or more lines are too long

View File

@ -2941,11 +2941,15 @@ var spine;
this.sortBone(slotBone);
else {
var bones = this.bones;
for (var i = 0; i < pathBones.length; i++) {
var i = 0;
while (i < pathBones.length) {
var boneCount = pathBones[i++];
for (var n = i + boneCount; i < n; i++) {
var boneIndex = pathBones[i];
this.sortBone(bones[boneIndex]);
}
}
}
};
Skeleton.prototype.sortBone = function (bone) {
if (bone.sorted)

File diff suppressed because one or more lines are too long

View File

@ -2698,11 +2698,15 @@ var spine;
this.sortBone(slotBone);
else {
var bones = this.bones;
for (var i = 0; i < pathBones.length; i++) {
var i = 0;
while (i < pathBones.length) {
var boneCount = pathBones[i++];
for (var n = i + boneCount; i < n; i++) {
var boneIndex = pathBones[i];
this.sortBone(bones[boneIndex]);
}
}
}
};
Skeleton.prototype.sortBone = function (bone) {
if (bone.sorted)

File diff suppressed because one or more lines are too long

View File

@ -2698,11 +2698,15 @@ var spine;
this.sortBone(slotBone);
else {
var bones = this.bones;
for (var i = 0; i < pathBones.length; i++) {
var i = 0;
while (i < pathBones.length) {
var boneCount = pathBones[i++];
for (var n = i + boneCount; i < n; i++) {
var boneIndex = pathBones[i];
this.sortBone(bones[boneIndex]);
}
}
}
};
Skeleton.prototype.sortBone = function (bone) {
if (bone.sorted)

File diff suppressed because one or more lines are too long

View File

@ -2698,11 +2698,15 @@ var spine;
this.sortBone(slotBone);
else {
var bones = this.bones;
for (var i = 0; i < pathBones.length; i++) {
var i = 0;
while (i < pathBones.length) {
var boneCount = pathBones[i++];
for (var n = i + boneCount; i < n; i++) {
var boneIndex = pathBones[i];
this.sortBone(bones[boneIndex]);
}
}
}
};
Skeleton.prototype.sortBone = function (bone) {
if (bone.sorted)

File diff suppressed because one or more lines are too long

View File

@ -2698,11 +2698,15 @@ var spine;
this.sortBone(slotBone);
else {
var bones = this.bones;
for (var i = 0; i < pathBones.length; i++) {
var i = 0;
while (i < pathBones.length) {
var boneCount = pathBones[i++];
for (var n = i + boneCount; i < n; i++) {
var boneIndex = pathBones[i];
this.sortBone(bones[boneIndex]);
}
}
}
};
Skeleton.prototype.sortBone = function (bone) {
if (bone.sorted)

File diff suppressed because one or more lines are too long

View File

@ -209,12 +209,16 @@ module spine {
this.sortBone(slotBone);
else {
let bones = this.bones;
for (let i = 0; i < pathBones.length; i++) {
let i = 0;
while (i < pathBones.length) {
let boneCount = pathBones[i++];
for (let n = i + boneCount; i < n; i++) {
let boneIndex = pathBones[i];
this.sortBone(bones[boneIndex]);
}
}
}
}
sortBone (bone: Bone) {
if (bone.sorted) return;

View File

@ -75,9 +75,6 @@ function init () {
assetManager.loadText("assets/stretchyman.json");
assetManager.loadText("assets/stretchyman.atlas");
assetManager.loadTexture("assets/stretchyman.png");
assetManager.loadText("assets/test.json")
assetManager.loadText("assets/test.atlas")
assetManager.loadTexture("assets/test.png")
requestAnimationFrame(load);
}
@ -85,7 +82,6 @@ function load () {
// Wait until the AssetManager has loaded all resources, then load the skeletons.
if (assetManager.isLoadingComplete()) {
skeletons["raptor"] = loadSkeleton("raptor", "walk", false);
skeletons["test"] = loadSkeleton("test", "animation", false);
skeletons["spineboy"] = loadSkeleton("spineboy", "run", false);
skeletons["tank"] = loadSkeleton("tank", "drive", false);
skeletons["goblins"] = loadSkeleton("goblins-mesh", "walk", false, "goblin");