Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanSweet committed Nov 28, 2016
2 parents 9eb18fa + c7c6e28 commit 9012326
Show file tree
Hide file tree
Showing 14 changed files with 643 additions and 112 deletions.
7 changes: 6 additions & 1 deletion spine-c/src/spine/AnimationState.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ void _spEventQueue_drain (_spEventQueue* self) {
}

void _spAnimationState_disposeTrackEntry (spTrackEntry* entry) {
if (entry->mixingFrom) _spAnimationState_disposeTrackEntry(entry->mixingFrom);
FREE(entry->timelinesFirst);
FREE(entry->timelinesRotation);
FREE(entry);
Expand All @@ -185,6 +184,12 @@ void _spAnimationState_disposeTrackEntries (spAnimationState* state, spTrackEntr
while (entry) {
spTrackEntry* next = entry->next;
_spAnimationState_disposeTrackEntry(entry);
spTrackEntry* from = entry->mixingFrom;
while (from) {
spTrackEntry* nextFrom = from->mixingFrom;
_spAnimationState_disposeTrackEntry(from);
from = nextFrom;
}
entry = next;
}
}
Expand Down
5 changes: 2 additions & 3 deletions spine-csharp/src/SkeletonBinary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,13 @@ public SkeletonData ReadSkeletonData (String path) {
#if WINDOWS_PHONE
using (var input = new BufferedStream(Microsoft.Xna.Framework.TitleContainer.OpenStream(path))) {
#else
using (var input = new BufferedStream(new FileStream(path, FileMode.Open))) {
#endif // WINDOWS_PHONE
using (var input = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)) {
#endif
SkeletonData skeletonData = ReadSkeletonData(input);
skeletonData.name = Path.GetFileNameWithoutExtension(path);
return skeletonData;
}
}

#endif // WINDOWS_STOREAPP

public static readonly TransformMode[] TransformModeValues = {
Expand Down
11 changes: 5 additions & 6 deletions spine-csharp/src/SkeletonJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public SkeletonJson (AttachmentLoader attachmentLoader) {
Scale = 1;
}

#if !(IS_UNITY) && WINDOWS_STOREAPP
#if !IS_UNITY && WINDOWS_STOREAPP
private async Task<SkeletonData> ReadFile(string path) {
var folder = Windows.ApplicationModel.Package.Current.InstalledLocation;
var file = await folder.GetFileAsync(path).AsTask().ConfigureAwait(false);
Expand All @@ -75,17 +75,16 @@ public SkeletonData ReadSkeletonData (String path) {
#else
public SkeletonData ReadSkeletonData (String path) {
#if WINDOWS_PHONE
Stream stream = Microsoft.Xna.Framework.TitleContainer.OpenStream(path);
using (StreamReader reader = new StreamReader(stream)) {
using (var reader = new StreamReader(Microsoft.Xna.Framework.TitleContainer.OpenStream(path))) {
#else
using (var reader = new StreamReader(path)) {
#endif // WINDOWS_PHONE
using (var reader = new StreamReader(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read))) {
#endif
SkeletonData skeletonData = ReadSkeletonData(reader);
skeletonData.name = Path.GetFileNameWithoutExtension(path);
return skeletonData;
}
}
#endif // WINDOWS_STOREAPP
#endif

public SkeletonData ReadSkeletonData (TextReader reader) {
if (reader == null) throw new ArgumentNullException("reader", "reader cannot be null.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public void DrawSkeletonUtilityButton (bool multi) {
// EditorGUILayout.Space();
// bool addSkeletonUtility = GUILayout.Button(buttonContent, GUILayout.Height(30));
// foreach (var t in targets) {
// var component = t as SkeletonAnimation;
// var component = t as Component;
// if (addSkeletonUtility && component.GetComponent<SkeletonUtility>() == null)
// component.gameObject.AddComponent<SkeletonUtility>();
// }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
// Spine/Skeleton Tint
// - Two color tint
// - unlit
// - Premultiplied alpha blending
// - No depth, no backface culling, no fog.

Shader "Spine/Skeleton Tint" {
Properties {
_Color ("Tint Color", Color) = (1,1,1,1)
_Black ("Black Point", Color) = (0,0,0,0)
_MainTex ("MainTex", 2D) = "black" {}
_Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1
}
Expand All @@ -23,6 +30,7 @@ Shader "Spine/Skeleton Tint" {
#include "UnityCG.cginc"
uniform sampler2D _MainTex; uniform float4 _MainTex_ST;
uniform float4 _Color;
uniform float4 _Black;

struct VertexInput {
float4 vertex : POSITION;
Expand All @@ -45,7 +53,8 @@ Shader "Spine/Skeleton Tint" {
}

float4 frag (VertexOutput i) : COLOR {
return (tex2D(_MainTex, i.uv) * i.vertexColor);
float4 texColor = tex2D(_MainTex, i.uv);
return (texColor * i.vertexColor) + float4(((1-texColor.rgb) * texColor.a * _Black.rgb), 0);
}
ENDCG
}
Expand Down
Loading

0 comments on commit 9012326

Please sign in to comment.