Merge remote-tracking branch 'EsotericSoftware/3.6' into 3.6

This commit is contained in:
Stephen Gowen 2018-01-16 09:45:44 -05:00
commit 2bf0d3fdfa
23 changed files with 156 additions and 97 deletions

View File

@ -468,9 +468,12 @@ package spine.animation {
last.next = entry; last.next = entry;
if (delay <= 0) { if (delay <= 0) {
var duration : Number = last.animationEnd - last.animationStart; var duration : Number = last.animationEnd - last.animationStart;
if (duration != 0) if (duration != 0) {
delay += duration * (1 + (int)(last.trackTime / duration)) - data.getMix(last.animation, animation); if (last.loop)
else delay += duration * (1 + (int)(last.trackTime / duration));
else
delay += duration;
} else
delay = 0; delay = 0;
} }
} }

View File

@ -720,9 +720,14 @@ spTrackEntry* spAnimationState_addAnimation (spAnimationState* self, int trackIn
last->next = entry; last->next = entry;
if (delay <= 0) { if (delay <= 0) {
float duration = last->animationEnd - last->animationStart; float duration = last->animationEnd - last->animationStart;
if (duration != 0) if (duration != 0) {
delay += duration * (1 + (int)(last->trackTime / duration)) - spAnimationStateData_getMix(self->data, last->animation, animation); if (last->loop) {
else delay += duration * (1 + (int) (last->trackTime / duration));
} else {
delay += duration;
}
delay -= spAnimationStateData_getMix(self->data, last->animation, animation);
} else
delay = 0; delay = 0;
} }
} }

View File

@ -269,6 +269,11 @@ void SkeletonTwoColorBatch::batch (TwoColorTrianglesCommand* command) {
flush(_lastCommand); flush(_lastCommand);
} }
uint32_t materialID = command->getMaterialID();
if (_lastCommand && _lastCommand->getMaterialID() != materialID) {
flush(_lastCommand);
}
memcpy(_vertexBuffer + _numVerticesBuffer, command->getTriangles().verts, sizeof(V3F_C4B_C4B_T2F) * command->getTriangles().vertCount); memcpy(_vertexBuffer + _numVerticesBuffer, command->getTriangles().verts, sizeof(V3F_C4B_C4B_T2F) * command->getTriangles().vertCount);
const Mat4& modelView = command->getModelView(); const Mat4& modelView = command->getModelView();
for (int i = _numVerticesBuffer; i < _numVerticesBuffer + command->getTriangles().vertCount; i++) { for (int i = _numVerticesBuffer; i < _numVerticesBuffer + command->getTriangles().vertCount; i++) {
@ -284,10 +289,8 @@ void SkeletonTwoColorBatch::batch (TwoColorTrianglesCommand* command) {
_numVerticesBuffer += command->getTriangles().vertCount; _numVerticesBuffer += command->getTriangles().vertCount;
_numIndicesBuffer += command->getTriangles().indexCount; _numIndicesBuffer += command->getTriangles().indexCount;
uint32_t materialID = command->getMaterialID(); if (command->isForceFlush()) {
flush(command);
if ((_lastCommand && _lastCommand->getMaterialID() != materialID) || command->isForceFlush()) {
flush(_lastCommand);
} }
_lastCommand = command; _lastCommand = command;
} }

View File

@ -513,9 +513,14 @@ namespace Spine {
last.next = entry; last.next = entry;
if (delay <= 0) { if (delay <= 0) {
float duration = last.animationEnd - last.animationStart; float duration = last.animationEnd - last.animationStart;
if (duration != 0) if (duration != 0) {
delay += duration * (1 + (int)(last.trackTime / duration)) - data.GetMix(last.animation, animation); if (last.loop) {
else delay += duration * (1 + (int)(last.trackTime / duration));
} else {
delay += duration;
}
delay -= data.GetMix(last.animation, animation);
} else
delay = 0; delay = 0;
} }
} }

View File

@ -528,9 +528,13 @@ public class AnimationState {
last.next = entry; last.next = entry;
if (delay <= 0) { if (delay <= 0) {
float duration = last.animationEnd - last.animationStart; float duration = last.animationEnd - last.animationStart;
if (duration != 0) if (duration != 0) {
delay += duration * (1 + (int)(last.trackTime / duration)) - data.getMix(last.animation, animation); if (last.loop)
else delay += duration * (1 + (int)(last.trackTime / duration));
else
delay += duration;
delay -= data.getMix(last.animation, animation);
} else
delay = 0; delay = 0;
} }
} }

View File

@ -720,7 +720,12 @@ function AnimationState:addAnimation (trackIndex, animation, loop, delay)
if delay <= 0 then if delay <= 0 then
local duration = last.animationEnd - last.animationStart local duration = last.animationEnd - last.animationStart
if duration ~= 0 then if duration ~= 0 then
delay = delay + duration * (1 + math_floor(last.trackTime / duration)) - data:getMix(last.animation, animation) if last.loop then
delay = delay + duration * (1 + math_floor(last.trackTime / duration))
else
delay = delay + duration
end
delay = delay - data:getMix(last.animation, animation)
else else
delay = 0 delay = 0
end end

View File

@ -1521,8 +1521,13 @@ var spine;
last.next = entry; last.next = entry;
if (delay <= 0) { if (delay <= 0) {
var duration = last.animationEnd - last.animationStart; var duration = last.animationEnd - last.animationStart;
if (duration != 0) if (duration != 0) {
delay += duration * (1 + ((last.trackTime / duration) | 0)) - this.data.getMix(last.animation, animation); if (last.loop)
delay += duration * (1 + ((last.trackTime / duration) | 0));
else
delay += duration;
delay -= this.data.getMix(last.animation, animation);
}
else else
delay = 0; delay = 0;
} }
@ -1862,11 +1867,11 @@ var spine;
throw new Error("from cannot be null."); throw new Error("from cannot be null.");
if (to == null) if (to == null)
throw new Error("to cannot be null."); throw new Error("to cannot be null.");
var key = from.name + to.name; var key = from.name + "." + to.name;
this.animationToMixTime[key] = duration; this.animationToMixTime[key] = duration;
}; };
AnimationStateData.prototype.getMix = function (from, to) { AnimationStateData.prototype.getMix = function (from, to) {
var key = from.name + to.name; var key = from.name + "." + to.name;
var value = this.animationToMixTime[key]; var value = this.animationToMixTime[key];
return value === undefined ? this.defaultMix : value; return value === undefined ? this.defaultMix : value;
}; };

File diff suppressed because one or more lines are too long

View File

@ -1521,8 +1521,13 @@ var spine;
last.next = entry; last.next = entry;
if (delay <= 0) { if (delay <= 0) {
var duration = last.animationEnd - last.animationStart; var duration = last.animationEnd - last.animationStart;
if (duration != 0) if (duration != 0) {
delay += duration * (1 + ((last.trackTime / duration) | 0)) - this.data.getMix(last.animation, animation); if (last.loop)
delay += duration * (1 + ((last.trackTime / duration) | 0));
else
delay += duration;
delay -= this.data.getMix(last.animation, animation);
}
else else
delay = 0; delay = 0;
} }
@ -1862,11 +1867,11 @@ var spine;
throw new Error("from cannot be null."); throw new Error("from cannot be null.");
if (to == null) if (to == null)
throw new Error("to cannot be null."); throw new Error("to cannot be null.");
var key = from.name + to.name; var key = from.name + "." + to.name;
this.animationToMixTime[key] = duration; this.animationToMixTime[key] = duration;
}; };
AnimationStateData.prototype.getMix = function (from, to) { AnimationStateData.prototype.getMix = function (from, to) {
var key = from.name + to.name; var key = from.name + "." + to.name;
var value = this.animationToMixTime[key]; var value = this.animationToMixTime[key];
return value === undefined ? this.defaultMix : value; return value === undefined ? this.defaultMix : value;
}; };

File diff suppressed because one or more lines are too long

View File

@ -1521,8 +1521,13 @@ var spine;
last.next = entry; last.next = entry;
if (delay <= 0) { if (delay <= 0) {
var duration = last.animationEnd - last.animationStart; var duration = last.animationEnd - last.animationStart;
if (duration != 0) if (duration != 0) {
delay += duration * (1 + ((last.trackTime / duration) | 0)) - this.data.getMix(last.animation, animation); if (last.loop)
delay += duration * (1 + ((last.trackTime / duration) | 0));
else
delay += duration;
delay -= this.data.getMix(last.animation, animation);
}
else else
delay = 0; delay = 0;
} }
@ -1862,11 +1867,11 @@ var spine;
throw new Error("from cannot be null."); throw new Error("from cannot be null.");
if (to == null) if (to == null)
throw new Error("to cannot be null."); throw new Error("to cannot be null.");
var key = from.name + to.name; var key = from.name + "." + to.name;
this.animationToMixTime[key] = duration; this.animationToMixTime[key] = duration;
}; };
AnimationStateData.prototype.getMix = function (from, to) { AnimationStateData.prototype.getMix = function (from, to) {
var key = from.name + to.name; var key = from.name + "." + to.name;
var value = this.animationToMixTime[key]; var value = this.animationToMixTime[key];
return value === undefined ? this.defaultMix : value; return value === undefined ? this.defaultMix : value;
}; };

File diff suppressed because one or more lines are too long

View File

@ -1521,8 +1521,13 @@ var spine;
last.next = entry; last.next = entry;
if (delay <= 0) { if (delay <= 0) {
var duration = last.animationEnd - last.animationStart; var duration = last.animationEnd - last.animationStart;
if (duration != 0) if (duration != 0) {
delay += duration * (1 + ((last.trackTime / duration) | 0)) - this.data.getMix(last.animation, animation); if (last.loop)
delay += duration * (1 + ((last.trackTime / duration) | 0));
else
delay += duration;
delay -= this.data.getMix(last.animation, animation);
}
else else
delay = 0; delay = 0;
} }
@ -1862,11 +1867,11 @@ var spine;
throw new Error("from cannot be null."); throw new Error("from cannot be null.");
if (to == null) if (to == null)
throw new Error("to cannot be null."); throw new Error("to cannot be null.");
var key = from.name + to.name; var key = from.name + "." + to.name;
this.animationToMixTime[key] = duration; this.animationToMixTime[key] = duration;
}; };
AnimationStateData.prototype.getMix = function (from, to) { AnimationStateData.prototype.getMix = function (from, to) {
var key = from.name + to.name; var key = from.name + "." + to.name;
var value = this.animationToMixTime[key]; var value = this.animationToMixTime[key];
return value === undefined ? this.defaultMix : value; return value === undefined ? this.defaultMix : value;
}; };

File diff suppressed because one or more lines are too long

View File

@ -1521,8 +1521,13 @@ var spine;
last.next = entry; last.next = entry;
if (delay <= 0) { if (delay <= 0) {
var duration = last.animationEnd - last.animationStart; var duration = last.animationEnd - last.animationStart;
if (duration != 0) if (duration != 0) {
delay += duration * (1 + ((last.trackTime / duration) | 0)) - this.data.getMix(last.animation, animation); if (last.loop)
delay += duration * (1 + ((last.trackTime / duration) | 0));
else
delay += duration;
delay -= this.data.getMix(last.animation, animation);
}
else else
delay = 0; delay = 0;
} }
@ -1862,11 +1867,11 @@ var spine;
throw new Error("from cannot be null."); throw new Error("from cannot be null.");
if (to == null) if (to == null)
throw new Error("to cannot be null."); throw new Error("to cannot be null.");
var key = from.name + to.name; var key = from.name + "." + to.name;
this.animationToMixTime[key] = duration; this.animationToMixTime[key] = duration;
}; };
AnimationStateData.prototype.getMix = function (from, to) { AnimationStateData.prototype.getMix = function (from, to) {
var key = from.name + to.name; var key = from.name + "." + to.name;
var value = this.animationToMixTime[key]; var value = this.animationToMixTime[key];
return value === undefined ? this.defaultMix : value; return value === undefined ? this.defaultMix : value;
}; };

File diff suppressed because one or more lines are too long

View File

@ -1521,8 +1521,13 @@ var spine;
last.next = entry; last.next = entry;
if (delay <= 0) { if (delay <= 0) {
var duration = last.animationEnd - last.animationStart; var duration = last.animationEnd - last.animationStart;
if (duration != 0) if (duration != 0) {
delay += duration * (1 + ((last.trackTime / duration) | 0)) - this.data.getMix(last.animation, animation); if (last.loop)
delay += duration * (1 + ((last.trackTime / duration) | 0));
else
delay += duration;
delay -= this.data.getMix(last.animation, animation);
}
else else
delay = 0; delay = 0;
} }
@ -1862,11 +1867,11 @@ var spine;
throw new Error("from cannot be null."); throw new Error("from cannot be null.");
if (to == null) if (to == null)
throw new Error("to cannot be null."); throw new Error("to cannot be null.");
var key = from.name + to.name; var key = from.name + "." + to.name;
this.animationToMixTime[key] = duration; this.animationToMixTime[key] = duration;
}; };
AnimationStateData.prototype.getMix = function (from, to) { AnimationStateData.prototype.getMix = function (from, to) {
var key = from.name + to.name; var key = from.name + "." + to.name;
var value = this.animationToMixTime[key]; var value = this.animationToMixTime[key];
return value === undefined ? this.defaultMix : value; return value === undefined ? this.defaultMix : value;
}; };

File diff suppressed because one or more lines are too long

View File

@ -453,9 +453,13 @@ module spine {
last.next = entry; last.next = entry;
if (delay <= 0) { if (delay <= 0) {
let duration = last.animationEnd - last.animationStart; let duration = last.animationEnd - last.animationStart;
if (duration != 0) if (duration != 0) {
delay += duration * (1 + ((last.trackTime / duration) | 0)) - this.data.getMix(last.animation, animation); if (last.loop)
else delay += duration * (1 + ((last.trackTime / duration) | 0));
else
delay += duration;
delay -= this.data.getMix(last.animation, animation);
} else
delay = 0; delay = 0;
} }
} }

View File

@ -50,12 +50,12 @@ module spine {
setMixWith (from: Animation, to: Animation, duration: number) { setMixWith (from: Animation, to: Animation, duration: number) {
if (from == null) throw new Error("from cannot be null."); if (from == null) throw new Error("from cannot be null.");
if (to == null) throw new Error("to cannot be null."); if (to == null) throw new Error("to cannot be null.");
let key = from.name + to.name; let key = from.name + "." + to.name;
this.animationToMixTime[key] = duration; this.animationToMixTime[key] = duration;
} }
getMix (from: Animation, to: Animation) { getMix (from: Animation, to: Animation) {
let key = from.name + to.name; let key = from.name + "." + to.name;
let value = this.animationToMixTime[key]; let value = this.animationToMixTime[key];
return value === undefined ? this.defaultMix : value; return value === undefined ? this.defaultMix : value;
} }