Merge branch '3.7-beta' into 3.7-beta-cpp

This commit is contained in:
badlogic 2018-06-15 15:33:02 +02:00
commit aa0343ac50
9 changed files with 19 additions and 10 deletions

View File

@ -5,5 +5,5 @@
<AS3Classpath generateProblems="true" sdkBased="false" type="source" useAsSharedCode="false">src</AS3Classpath> <AS3Classpath generateProblems="true" sdkBased="false" type="source" useAsSharedCode="false">src</AS3Classpath>
<AS3Classpath generateProblems="true" sdkBased="false" type="lib" useAsSharedCode="false">lib/spine-starling.swc</AS3Classpath> <AS3Classpath generateProblems="true" sdkBased="false" type="lib" useAsSharedCode="false">lib/spine-starling.swc</AS3Classpath>
<AS3Classpath generateProblems="true" sdkBased="false" type="lib" useAsSharedCode="false">lib/spine-as3.swc</AS3Classpath> <AS3Classpath generateProblems="true" sdkBased="false" type="lib" useAsSharedCode="false">lib/spine-as3.swc</AS3Classpath>
<AS3Classpath generateProblems="true" sdkBased="false" type="lib" useAsSharedCode="false">lib/starling-2.1.swc</AS3Classpath> <AS3Classpath generateProblems="true" sdkBased="false" type="lib" useAsSharedCode="false">lib/starling-2.4.swc</AS3Classpath>
</AS3Classpath> </AS3Classpath>

View File

@ -4,5 +4,5 @@
<AS3Classpath generateProblems="true" sdkBased="false" type="source" useAsSharedCode="false">src</AS3Classpath> <AS3Classpath generateProblems="true" sdkBased="false" type="source" useAsSharedCode="false">src</AS3Classpath>
<AS3Classpath generateProblems="true" sdkBased="false" type="lib" useAsSharedCode="false">lib/spine-as3.swc</AS3Classpath> <AS3Classpath generateProblems="true" sdkBased="false" type="lib" useAsSharedCode="false">lib/spine-as3.swc</AS3Classpath>
<AS3Classpath generateProblems="true" sdkBased="true" type="lib" useAsSharedCode="false">frameworks/libs/air/airglobal.swc</AS3Classpath> <AS3Classpath generateProblems="true" sdkBased="true" type="lib" useAsSharedCode="false">frameworks/libs/air/airglobal.swc</AS3Classpath>
<AS3Classpath generateProblems="true" sdkBased="false" type="lib" useAsSharedCode="false">lib/starling-2.1.swc</AS3Classpath> <AS3Classpath generateProblems="true" sdkBased="false" type="lib" useAsSharedCode="false">lib/starling-2.4.swc</AS3Classpath>
</AS3Classpath> </AS3Classpath>

Binary file not shown.

View File

@ -29,6 +29,7 @@
*****************************************************************************/ *****************************************************************************/
package spine.starling { package spine.starling {
import starling.styles.MeshStyle;
import spine.attachments.ClippingAttachment; import spine.attachments.ClippingAttachment;
import spine.SkeletonClipping; import spine.SkeletonClipping;
import spine.Bone; import spine.Bone;
@ -98,6 +99,7 @@ package spine.starling {
for (var i : int = 0, n : int = drawOrder.length; i < n; ++i) { for (var i : int = 0, n : int = drawOrder.length; i < n; ++i) {
var worldVertices : Vector.<Number> = _tempVertices; var worldVertices : Vector.<Number> = _tempVertices;
var slot : Slot = drawOrder[i]; var slot : Slot = drawOrder[i];
if (slot.attachment is RegionAttachment) { if (slot.attachment is RegionAttachment) {
var region : RegionAttachment = slot.attachment as RegionAttachment; var region : RegionAttachment = slot.attachment as RegionAttachment;
verticesLength = 4 * 2; verticesLength = 4 * 2;
@ -169,17 +171,22 @@ package spine.starling {
if (clipper.isClipping()) { if (clipper.isClipping()) {
clipper.clipTriangles(worldVertices, indices, indices.length, uvs); clipper.clipTriangles(worldVertices, indices, indices.length, uvs);
// Need to create a new mesh here, see https://github.com/EsotericSoftware/spine-runtimes/issues/1125
mesh = new SkeletonMesh(mesh.texture);
if (_twoColorTint) mesh.setStyle(new TwoColorMeshStyle());
indexData = mesh.getIndexData();
verticesCount = clipper.clippedVertices.length >> 1; verticesCount = clipper.clippedVertices.length >> 1;
worldVertices = clipper.clippedVertices; worldVertices = clipper.clippedVertices;
uvs = clipper.clippedUvs; uvs = clipper.clippedUvs;
indices = clipper.clippedTriangles; indices = clipper.clippedTriangles;
indicesLength = indices.length; indicesLength = indices.length;
indexData.numIndices = indicesLength;
indexData.trim();
for (ii = 0; ii < indicesLength; ii++) { for (ii = 0; ii < indicesLength; ii++) {
indexData.setIndex(ii, indices[ii]); indexData.setIndex(ii, indices[ii]);
} }
indexData.numIndices = indicesLength;
indexData.trim();
} }
vertexData = mesh.getVertexData(); vertexData = mesh.getVertexData();
@ -214,8 +221,10 @@ package spine.starling {
mesh.setTexCoords(ii, uvs[iii], uvs[iii + 1]); mesh.setTexCoords(ii, uvs[iii], uvs[iii + 1]);
} }
} }
if (indexData.numIndices > 0 && vertexData.numVertices > 0) {
painter.state.blendMode = blendModes[slot.data.blendMode.ordinal]; painter.state.blendMode = blendModes[slot.data.blendMode.ordinal];
painter.batchMesh(mesh); painter.batchMesh(mesh);
}
clipper.clipEndWithSlot(slot); clipper.clipEndWithSlot(slot);
} }

View File

@ -1363,9 +1363,9 @@ namespace Spine.Unity.Editor {
bool pmaVertexColors = false; bool pmaVertexColors = false;
bool tintBlack = false; bool tintBlack = false;
foreach (SpineAtlasAsset atlasAsset in skeletonDataAsset.atlasAssets) { foreach (var atlasAsset in skeletonDataAsset.atlasAssets) {
if (!pmaVertexColors) { if (!pmaVertexColors) {
foreach (Material m in atlasAsset.materials) { foreach (Material m in atlasAsset.Materials) {
if (m.shader.name.Contains(PMAShaderQuery)) { if (m.shader.name.Contains(PMAShaderQuery)) {
pmaVertexColors = true; pmaVertexColors = true;
break; break;
@ -1374,7 +1374,7 @@ namespace Spine.Unity.Editor {
} }
if (!tintBlack) { if (!tintBlack) {
foreach (Material m in atlasAsset.materials) { foreach (Material m in atlasAsset.Materials) {
if (m.shader.name.Contains(TintBlackShaderQuery)) { if (m.shader.name.Contains(TintBlackShaderQuery)) {
tintBlack = true; tintBlack = true;
break; break;