Merge branch '3.6' into 3.7-beta

This commit is contained in:
badlogic 2017-08-17 11:11:14 +02:00
commit 8dc2f618e8
7 changed files with 25 additions and 4 deletions

View File

@ -199,7 +199,10 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t
TwoColorTrianglesCommand* lastTwoColorTrianglesCommand = nullptr;
for (int i = 0, n = _skeleton->slotsCount; i < n; ++i) {
spSlot* slot = _skeleton->drawOrder[i];
if (!slot->attachment) continue;
if (!slot->attachment) {
spSkeletonClipping_clipEnd(_clipper, slot);
continue;
}
cocos2d::TrianglesCommand::Triangles triangles;
TwoColorTriangles trianglesTwoColor;
@ -268,6 +271,7 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t
spSkeletonClipping_clipStart(_clipper, slot, clip);
}
default:
spSkeletonClipping_clipEnd(_clipper, slot);
continue;
}

View File

@ -102,7 +102,7 @@ package spine.starling {
attachment.rendererObject = new Image(Texture.fromTexture(texture)); // Discard frame.
var root : Texture = texture.root;
var rectRegion : Rectangle = atlas.getRegion(path);
var rectRegion : Rectangle = texture.region;
if (!rotated) {
attachment.regionU = rectRegion.x / root.width;
attachment.regionV = rectRegion.y / root.height;

File diff suppressed because one or more lines are too long

View File

@ -699,7 +699,7 @@ module spine {
let eventMap = map.events[i];
let eventData = skeletonData.findEvent(eventMap.name);
if (eventData == null) throw new Error("Event not found: " + eventMap.name);
let event = new Event(eventMap.time, eventData);
let event = new Event(Utils.toSinglePrecision(eventMap.time), eventData);
event.intValue = this.getValue(eventMap, "int", eventData.intValue);
event.floatValue = this.getValue(eventMap, "float", eventData.floatValue);
event.stringValue = this.getValue(eventMap, "string", eventData.stringValue);

View File

@ -255,6 +255,10 @@ module spine {
static toFloatArray (array: Array<number>) {
return Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array;
}
static toSinglePrecision (value: number) {
return Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value;
}
}
export class DebugUtils {

View File

@ -0,0 +1,13 @@
interface Math {
fround(n: number): number;
}
(() => {
if (!Math.fround) {
Math.fround = (function (array) {
return function (x: number) {
return array[0] = x, array[0];
};
})(new Float32Array(1));
}
})();