Merge branch '4.1' into 4.2-beta

This commit is contained in:
Mario Zechner 2023-01-16 14:00:14 +01:00
commit 1891d00025
10 changed files with 54 additions and 34 deletions

View File

@ -11,7 +11,7 @@ jobs:
- name: Install OS dependencies (needed for act on ubuntu-latest)
run: |
sudo apt update
sudo apt install -y --force-yes curl xz-utils libicu-dev git dos2unix
sudo apt install -y --force-yes curl xz-utils libicu-dev git dos2unix libncurses5
- uses: actions/checkout@v1

View File

@ -286,7 +286,7 @@ float *spPathConstraint_computeWorldPositions(spPathConstraint *self, spPathAtta
float *lengths = path->lengths;
curveCount -= closed ? 1 : 2;
pathLength = lengths[curveCount];
if (self->data->positionMode == SP_POSITION_MODE_PERCENT) position += pathLength;
if (self->data->positionMode == SP_POSITION_MODE_PERCENT) position *= pathLength;
switch (self->data->spacingMode) {
case SP_SPACING_MODE_PERCENT:
multiplier = pathLength;

View File

@ -106,7 +106,8 @@ static void toColor2(spColor *color, const char *value, int /*bool*/ hasAlpha) {
color->g = toColor(value, 1);
color->b = toColor(value, 2);
if (hasAlpha) color->a = toColor(value, 3);
else color->a =1.0f;
else
color->a = 1.0f;
}
static void

View File

@ -2,7 +2,7 @@ group = "com.esotericsoftware.spine"
version = "4.1.0"
ext {
libgdxVersion = "1.10.1-SNAPSHOT"
libgdxVersion = "1.11.1-SNAPSHOT"
javaVersion = 8
}

View File

@ -305,7 +305,7 @@ export class SpineAtlasFile extends Phaser.Loader.MultiFile {
} else {
file.data = {
data: file.data,
premultipliedAlpha: this.premultipliedAlpha || file.data.indexOf("pma: true") >= 0
premultipliedAlpha: this.premultipliedAlpha || file.data.indexOf("pma: true") >= 0
};
file.addToCache();
}

View File

@ -86,7 +86,7 @@ export class SceneRenderer implements Disposable {
this.enableRenderer(this.batcher);
}
drawSkeleton (skeleton: Skeleton, premultipliedAlpha = false, slotRangeStart = -1, slotRangeEnd = -1, transform: VertexTransformer | null = null) {
drawSkeleton (skeleton: Skeleton, premultipliedAlpha = false, slotRangeStart = -1, slotRangeEnd = -1, transform: VertexTransformer | null = null) {
this.enableRenderer(this.batcher);
this.skeletonRenderer.premultipliedAlpha = premultipliedAlpha;
this.skeletonRenderer.draw(this.batcher, skeleton, slotRangeStart, slotRangeEnd, transform);

View File

@ -51,6 +51,10 @@
#define PROBLEMATIC_PACKAGE_ASSET_MODIFICATION
#endif
#if UNITY_2019_2_OR_NEWER
#define HAS_PACKAGE_INFO
#endif
using System.Collections.Generic;
using System.IO;
using System.Linq;
@ -114,6 +118,17 @@ namespace Spine.Unity.Editor {
}
}
public static bool AssetCanBeModified (string assetPath) {
#if HAS_PACKAGE_INFO
UnityEditor.PackageManager.PackageInfo packageInfo = UnityEditor.PackageManager.PackageInfo.FindForAssetPath(assetPath);
return (packageInfo == null ||
packageInfo.source == UnityEditor.PackageManager.PackageSource.Embedded ||
packageInfo.source == UnityEditor.PackageManager.PackageSource.Local);
#else
return assetPath.StartsWith("Assets");
#endif
}
#region Match SkeletonData with Atlases
static readonly AttachmentType[] AtlasTypes = { AttachmentType.Region, AttachmentType.Linkedmesh, AttachmentType.Mesh };

View File

@ -91,6 +91,8 @@ namespace Spine.Unity.Editor {
string[] prefabAssets = AssetDatabase.FindAssets("t:Prefab");
foreach (string asset in prefabAssets) {
string assetPath = AssetDatabase.GUIDToAssetPath(asset);
if (!AssetUtility.AssetCanBeModified(assetPath)) continue;
GameObject prefabGameObject = AssetDatabase.LoadAssetAtPath<GameObject>(assetPath);
if (SpineEditorUtilities.CleanupSpinePrefabMesh(prefabGameObject)) {
#if HAS_SAVE_ASSET_IF_DIRTY
@ -139,6 +141,8 @@ namespace Spine.Unity.Editor {
string[] spriteAtlasAssets = AssetDatabase.FindAssets("t:SpineSpriteAtlasAsset");
foreach (string asset in spriteAtlasAssets) {
string assetPath = AssetDatabase.GUIDToAssetPath(asset);
if (!AssetUtility.AssetCanBeModified(assetPath)) continue;
SpineSpriteAtlasAsset atlasAsset = AssetDatabase.LoadAssetAtPath<SpineSpriteAtlasAsset>(assetPath);
if (atlasAsset && atlasAsset.materials.Length > 0) {
spriteAtlasTexturesToRestore[assetPath] = AssetDatabase.GetAssetPath(atlasAsset.materials[0].mainTexture);