mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-09 08:38:43 +08:00
Merge branch '3.6' into 3.7-beta
This commit is contained in:
commit
8dc2f618e8
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@ -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
@ -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);
|
||||
|
||||
@ -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 {
|
||||
|
||||
13
spine-ts/core/src/polyfills.ts
Normal file
13
spine-ts/core/src/polyfills.ts
Normal 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));
|
||||
}
|
||||
})();
|
||||
Loading…
x
Reference in New Issue
Block a user