diff --git a/.gitignore b/.gitignore
index 7ef3958..434c942 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
/SpineViewerWPF/bin
/SpineViewerWPF/obj
-/packages
+/.vs
+/MigrationBackup
\ No newline at end of file
diff --git a/README.md b/README.md
index df0897b..b811f8c 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,11 @@
# SpineViewerWPF
-a tool can view spine files with different spine-runtimes version and export gif or png file.
+A tool that can view spine files with different spine-runtime versions and export to gif or png.
中文說明請看[這裡](README_zhTW.md)
+## Usage
+Start by loading an Atlas file for the specific spine you want to view, and the program will then try to import the skeleton data in JSON format and the sprite-atlas in PNG format. All 3 files must be named according to the atlas data (eg: Spine1.atlas, Spine1.json, Spine1.png). Make sure to select the correct spine version according to your skeleton data, or else there may be visual bugs, or the spine will not load/animate correctly.
+
## Hot Key
* Ctrl+Mousewheel Canvas Scaling
* Alt+Mousewheel Spine Scaling
@@ -10,7 +13,7 @@ a tool can view spine files with different spine-runtimes version and export gif
* Alt+Mousedown+Mousemove Spine Moving
## Features
-* Suppot Spine Runtimes Version
+* Support Spine Runtime Versions
* **2.1.08**
* **2.1.25**
* **3.1.07**
@@ -25,23 +28,29 @@ a tool can view spine files with different spine-runtimes version and export gif
* **4.0.31**
* **4.0.64**
* **4.1.00**
+ * **4.2.33**
* Export animation to gif or png file.
* Can view Animation with different options.
-
-
-
-## Usage
-
+## Uses
Library:
- [ImageSharp](https://github.com/SixLabors/ImageSharp)
- [WpfXnaControl](https://github.com/erickeek/WpfXnaControl)
- [spine-runtimes](https://github.com/EsotericSoftware/spine-runtimes)
-
Requirements:
-- [.NET Framework 4.7.2](http://go.microsoft.com/fwlink/?linkid=863265)
+- [.NET 8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)
- [Microsoft XNA Framework Redistributable 4.0](https://www.microsoft.com/en-us/download/details.aspx?id=20914)
+## Changelog
+* 31/01/2025 (Eleiyas)
+ * Upgraded program to .NET 8.0
+ * Updated packages to latest versions
+ * Imported MonoGame packages to retain usage of Microsoft.Xna.Framework
+ * Custom import of WpfXnaControl.dll file as original NuGet package is massively outdated
+ * Cleaned code
+ * Updated ReadMe
+ * Implemented Spine Runtime 4.2.33
+
## Issue:
* \_(:3」∠)\_
diff --git a/SpineViewerWPF.sln b/SpineViewerWPF.sln
index cf62350..e68699b 100644
--- a/SpineViewerWPF.sln
+++ b/SpineViewerWPF.sln
@@ -1,9 +1,9 @@
-
+
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2006
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpineViewerWPF", "SpineViewerWPF\SpineViewerWPF.csproj", "{28600FC6-6C22-4BEF-8865-AD159B5E8C5F}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SpineViewerWPF", "SpineViewerWPF\SpineViewerWPF.csproj", "{28600FC6-6C22-4BEF-8865-AD159B5E8C5F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/SpineViewerWPF/.vs/SpineViewerWPF.csproj.dtbcache.json b/SpineViewerWPF/.vs/SpineViewerWPF.csproj.dtbcache.json
new file mode 100644
index 0000000..d06170e
--- /dev/null
+++ b/SpineViewerWPF/.vs/SpineViewerWPF.csproj.dtbcache.json
@@ -0,0 +1 @@
+{"RootPath":"F:\\SpineViewerWPF\\SpineViewerWPF","ProjectFileName":"SpineViewerWPF.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"PublicFunction\\BlendXna.cs"},{"SourceFile":"PublicFunction\\Common.cs"},{"SourceFile":"PublicFunction\\GlobalValue.cs"},{"SourceFile":"PublicFunction\\NewTextureLoader.cs"},{"SourceFile":"PublicFunction\\Player.cs"},{"SourceFile":"PublicFunction\\Player\\IPlayer.cs"},{"SourceFile":"PublicFunction\\Player\\Player_2_1_08.cs"},{"SourceFile":"PublicFunction\\Player\\Player_2_1_25.cs"},{"SourceFile":"PublicFunction\\Player\\Player_3_1_07.cs"},{"SourceFile":"PublicFunction\\Player\\Player_3_2_xx.cs"},{"SourceFile":"PublicFunction\\Player\\Player_3_4_02.cs"},{"SourceFile":"PublicFunction\\Player\\Player_3_5_51.cs"},{"SourceFile":"PublicFunction\\Player\\Player_3_6_32.cs"},{"SourceFile":"PublicFunction\\Player\\Player_3_6_39.cs"},{"SourceFile":"PublicFunction\\Player\\Player_3_6_53.cs"},{"SourceFile":"PublicFunction\\Player\\Player_3_7_94.cs"},{"SourceFile":"PublicFunction\\Player\\Player_4_1_00.cs"},{"SourceFile":"PublicFunction\\Player\\Player_4_0_64.cs"},{"SourceFile":"PublicFunction\\Player\\Player_4_0_31.cs"},{"SourceFile":"PublicFunction\\Player\\Player_3_8_95.cs"},{"SourceFile":"PublicFunction\\XnaLoader\\Util.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\Animation.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\AnimationState.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\AnimationStateData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\Atlas.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\Attachments\\AtlasAttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\Attachments\\Attachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\Attachments\\AttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\Attachments\\AttachmentType.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\Attachments\\BoundingBoxAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\Attachments\\MeshAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\Attachments\\RegionAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\Attachments\\SkinnedMeshAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\Bone.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\BoneData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\Event.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\EventData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\IkConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\IkConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\Json.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\Skeleton.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\SkeletonBounds.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\SkeletonData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\SkeletonJson.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\Skin.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\Slot.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\SlotData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\XnaLoader\\MeshBatcher.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\XnaLoader\\RegionBatcher.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\XnaLoader\\SkeletonMeshRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\XnaLoader\\SkeletonRegionRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.08\\XnaLoader\\XnaTextureLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\Animation.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\AnimationState.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\AnimationStateData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\Atlas.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\Attachments\\AtlasAttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\Attachments\\Attachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\Attachments\\AttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\Attachments\\AttachmentType.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\Attachments\\BoundingBoxAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\Attachments\\MeshAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\Attachments\\RegionAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\Attachments\\SkinnedMeshAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\Bone.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\BoneData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\Event.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\EventData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\IkConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\IkConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\Json.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\Skeleton.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\SkeletonBinary.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\SkeletonBounds.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\SkeletonData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\SkeletonJson.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\Skin.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\Slot.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\SlotData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\XnaLoader\\MeshBatcher.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\XnaLoader\\RegionBatcher.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\XnaLoader\\SkeletonMeshRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\XnaLoader\\SkeletonRegionRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-2.1.25\\XnaLoader\\XnaTextureLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\Animation.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\AnimationState.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\AnimationStateData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\Atlas.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\Attachments\\AtlasAttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\Attachments\\Attachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\Attachments\\AttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\Attachments\\AttachmentType.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\Attachments\\BoundingBoxAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\Attachments\\IFfdAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\Attachments\\MeshAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\Attachments\\RegionAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\Attachments\\WeightedMeshAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\BlendMode.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\Bone.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\BoneData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\Event.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\EventData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\ExposedList.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\IkConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\IkConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\IUpdatable.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\Json.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\MathUtils.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\Skeleton.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\SkeletonBinary.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\SkeletonBounds.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\SkeletonData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\SkeletonJson.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\Skin.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\Slot.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\SlotData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\TransformConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\TransformConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\XnaLoader\\MeshBatcher.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\XnaLoader\\RegionBatcher.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\XnaLoader\\SkeletonMeshRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\XnaLoader\\SkeletonRegionRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.1.07\\XnaLoader\\XnaTextureLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\Animation.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\AnimationState.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\AnimationStateData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\Atlas.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\Attachments\\AtlasAttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\Attachments\\Attachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\Attachments\\AttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\Attachments\\AttachmentType.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\Attachments\\BoundingBoxAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\Attachments\\IFfdAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\Attachments\\MeshAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\Attachments\\RegionAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\Attachments\\WeightedMeshAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\BlendMode.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\Bone.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\BoneData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\Event.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\EventData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\ExposedList.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\IkConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\IkConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\IUpdatable.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\Json.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\MathUtils.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\Skeleton.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\SkeletonBinary.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\SkeletonBounds.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\SkeletonData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\SkeletonJson.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\Skin.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\Slot.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\SlotData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\TransformConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\TransformConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\XnaLoader\\MeshBatcher.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\XnaLoader\\RegionBatcher.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\XnaLoader\\SkeletonMeshRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\XnaLoader\\SkeletonRegionRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.2.xx\\XnaLoader\\XnaTextureLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\Animation.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\AnimationState.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\AnimationStateData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\Atlas.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\Attachments\\AtlasAttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\Attachments\\Attachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\Attachments\\AttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\Attachments\\AttachmentType.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\Attachments\\BoundingBoxAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\Attachments\\MeshAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\Attachments\\PathAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\Attachments\\RegionAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\Attachments\\VertexAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\BlendMode.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\Bone.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\BoneData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\Event.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\EventData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\ExposedList.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\IkConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\IkConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\IUpdatable.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\Json.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\MathUtils.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\PathConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\PathConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\Skeleton.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\SkeletonBinary.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\SkeletonBounds.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\SkeletonData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\SkeletonJson.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\Skin.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\Slot.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\SlotData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\TransformConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\TransformConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\XnaLoader\\MeshBatcher.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\XnaLoader\\RegionBatcher.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\XnaLoader\\SkeletonMeshRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\XnaLoader\\SkeletonRegionRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.4.02\\XnaLoader\\XnaTextureLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\Animation.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\AnimationState.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\AnimationStateData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\Atlas.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\Attachments\\AtlasAttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\Attachments\\Attachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\Attachments\\AttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\Attachments\\AttachmentType.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\Attachments\\BoundingBoxAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\Attachments\\MeshAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\Attachments\\PathAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\Attachments\\RegionAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\Attachments\\VertexAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\BlendMode.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\Bone.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\BoneData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\Event.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\EventData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\ExposedList.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\IConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\IkConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\IkConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\IUpdatable.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\Json.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\MathUtils.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\PathConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\PathConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\Skeleton.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\SkeletonBinary.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\SkeletonBounds.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\SkeletonData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\SkeletonJson.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\Skin.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\Slot.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\SlotData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\TransformConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\TransformConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\XnaLoader\\MeshBatcher.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\XnaLoader\\RegionBatcher.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\XnaLoader\\SkeletonMeshRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\XnaLoader\\SkeletonRegionRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.5.51\\XnaLoader\\XnaTextureLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\Animation.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\AnimationState.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\AnimationStateData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\Atlas.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\Attachments\\AtlasAttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\Attachments\\Attachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\Attachments\\AttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\Attachments\\AttachmentType.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\Attachments\\BoundingBoxAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\Attachments\\ClippingAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\Attachments\\MeshAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\Attachments\\PathAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\Attachments\\PointAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\Attachments\\RegionAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\Attachments\\VertexAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\BlendMode.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\Bone.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\BoneData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\Event.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\EventData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\ExposedList.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\IConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\IkConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\IkConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\IUpdatable.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\Json.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\MathUtils.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\PathConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\PathConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\Skeleton.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\SkeletonBinary.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\SkeletonBounds.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\SkeletonClipping.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\SkeletonData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\SkeletonJson.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\Skin.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\Slot.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\SlotData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\TransformConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\TransformConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\Triangulator.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\XnaLoader\\MeshBatcher.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\XnaLoader\\SkeletonRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.32\\XnaLoader\\XnaTextureLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\Animation.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\AnimationState.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\AnimationStateData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\Atlas.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\Attachments\\AtlasAttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\Attachments\\Attachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\Attachments\\AttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\Attachments\\AttachmentType.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\Attachments\\BoundingBoxAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\Attachments\\ClippingAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\Attachments\\MeshAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\Attachments\\PathAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\Attachments\\PointAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\Attachments\\RegionAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\Attachments\\VertexAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\BlendMode.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\Bone.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\BoneData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\Event.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\EventData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\ExposedList.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\IConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\IkConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\IkConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\IUpdatable.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\Json.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\MathUtils.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\PathConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\PathConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\Skeleton.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\SkeletonBinary.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\SkeletonBounds.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\SkeletonClipping.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\SkeletonData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\SkeletonJson.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\Skin.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\Slot.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\SlotData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\TransformConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\TransformConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\Triangulator.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\XnaLoader\\MeshBatcher.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\XnaLoader\\ShapeRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\XnaLoader\\SkeletonRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.39\\XnaLoader\\XnaTextureLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\Animation.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\AnimationState.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\AnimationStateData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\Atlas.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\Attachments\\AtlasAttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\Attachments\\Attachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\Attachments\\AttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\Attachments\\AttachmentType.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\Attachments\\BoundingBoxAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\Attachments\\ClippingAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\Attachments\\MeshAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\Attachments\\PathAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\Attachments\\PointAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\Attachments\\RegionAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\Attachments\\VertexAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\BlendMode.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\Bone.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\BoneData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\Event.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\EventData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\ExposedList.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\IConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\IkConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\IkConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\IUpdatable.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\Json.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\MathUtils.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\PathConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\PathConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\Skeleton.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\SkeletonBinary.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\SkeletonBounds.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\SkeletonClipping.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\SkeletonData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\SkeletonJson.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\Skin.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\Slot.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\SlotData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\TransformConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\TransformConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\Triangulator.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\XnaLoader\\MeshBatcher.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\XnaLoader\\ShapeRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\XnaLoader\\SkeletonRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.6.53\\XnaLoader\\XnaTextureLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\Animation.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\AnimationState.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\AnimationStateData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\Atlas.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\Attachments\\AtlasAttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\Attachments\\Attachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\Attachments\\AttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\Attachments\\AttachmentType.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\Attachments\\BoundingBoxAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\Attachments\\ClippingAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\Attachments\\MeshAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\Attachments\\PathAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\Attachments\\PointAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\Attachments\\RegionAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\Attachments\\VertexAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\BlendMode.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\Bone.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\BoneData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\Event.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\EventData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\ExposedList.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\IConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\IkConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\IkConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\IUpdatable.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\Json.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\MathUtils.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\PathConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\PathConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\Skeleton.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\SkeletonBinary.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\SkeletonBounds.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\SkeletonClipping.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\SkeletonData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\SkeletonJson.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\Skin.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\Slot.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\SlotData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\TransformConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\TransformConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\Triangulator.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\XnaLoader\\MeshBatcher.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\XnaLoader\\ShapeRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\XnaLoader\\SkeletonRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\XnaLoader\\VertexEffect.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.7.94\\XnaLoader\\XnaTextureLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\Animation.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\AnimationState.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\AnimationStateData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\Atlas.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\Attachments\\AtlasAttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\Attachments\\Attachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\Attachments\\AttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\Attachments\\AttachmentType.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\Attachments\\BoundingBoxAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\Attachments\\ClippingAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\Attachments\\MeshAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\Attachments\\PathAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\Attachments\\PointAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\Attachments\\RegionAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\Attachments\\VertexAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\BlendMode.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\Bone.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\BoneData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\Collections\\OrderedDictionary.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\ConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\Event.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\EventData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\ExposedList.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\IkConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\IkConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\IUpdatable.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\Json.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\MathUtils.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\PathConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\PathConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\Skeleton.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\SkeletonBinary.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\SkeletonBounds.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\SkeletonClipping.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\SkeletonData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\SkeletonJson.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\Skin.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\Slot.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\SlotData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\TransformConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\TransformConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\Triangulator.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\XnaLoader\\MeshBatcher.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\XnaLoader\\ShapeRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\XnaLoader\\SkeletonRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\XnaLoader\\VertexEffect.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-3.8.95\\XnaLoader\\XnaTextureLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\Animation.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\AnimationState.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\AnimationStateData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\Atlas.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\Attachments\\AtlasAttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\Attachments\\Attachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\Attachments\\AttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\Attachments\\AttachmentType.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\Attachments\\BoundingBoxAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\Attachments\\ClippingAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\Attachments\\MeshAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\Attachments\\PathAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\Attachments\\PointAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\Attachments\\RegionAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\Attachments\\VertexAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\BlendMode.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\Bone.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\BoneData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\ConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\Event.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\EventData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\ExposedList.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\IkConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\IkConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\IUpdatable.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\Json.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\MathUtils.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\PathConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\PathConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\Skeleton.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\SkeletonBinary.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\SkeletonBounds.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\SkeletonClipping.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\SkeletonData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\SkeletonJson.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\SkeletonLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\Skin.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\Slot.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\SlotData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\TransformConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\TransformConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\Triangulator.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\XnaLoader\\MeshBatcher.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\XnaLoader\\ShapeRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\XnaLoader\\SkeletonRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\XnaLoader\\VertexEffect.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.31\\XnaLoader\\XnaTextureLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\Animation.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\AnimationState.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\AnimationStateData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\Atlas.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\Attachments\\AtlasAttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\Attachments\\Attachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\Attachments\\AttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\Attachments\\AttachmentType.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\Attachments\\BoundingBoxAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\Attachments\\ClippingAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\Attachments\\MeshAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\Attachments\\PathAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\Attachments\\PointAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\Attachments\\RegionAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\Attachments\\VertexAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\BlendMode.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\Bone.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\BoneData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\ConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\Event.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\EventData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\ExposedList.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\IkConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\IkConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\IUpdatable.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\Json.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\MathUtils.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\PathConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\PathConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\Skeleton.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\SkeletonBinary.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\SkeletonBounds.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\SkeletonClipping.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\SkeletonData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\SkeletonJson.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\SkeletonLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\Skin.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\Slot.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\SlotData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\TransformConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\TransformConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\Triangulator.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\XnaLoader\\MeshBatcher.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\XnaLoader\\ShapeRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\XnaLoader\\SkeletonRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\XnaLoader\\VertexEffect.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.0.64\\XnaLoader\\XnaTextureLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\Animation.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\AnimationState.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\AnimationStateData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\Atlas.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\Attachments\\AtlasAttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\Attachments\\Attachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\Attachments\\AttachmentLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\Attachments\\AttachmentType.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\Attachments\\BoundingBoxAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\Attachments\\ClippingAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\Attachments\\IHasTextureRegion.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\Attachments\\MeshAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\Attachments\\PathAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\Attachments\\PointAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\Attachments\\RegionAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\Attachments\\Sequence.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\Attachments\\VertexAttachment.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\BlendMode.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\Bone.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\BoneData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\ConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\Event.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\EventData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\ExposedList.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\IkConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\IkConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\IUpdatable.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\Json.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\MathUtils.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\PathConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\PathConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\Skeleton.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\SkeletonBinary.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\SkeletonBounds.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\SkeletonClipping.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\SkeletonData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\SkeletonJson.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\SkeletonLoader.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\Skin.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\Slot.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\SlotData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\SpringConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\SpringConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\TextureRegion.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\TransformConstraint.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\TransformConstraintData.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\Triangulator.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\XnaLoader\\MeshBatcher.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\XnaLoader\\ShapeRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\XnaLoader\\SkeletonRenderer.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\XnaLoader\\VertexEffect.cs"},{"SourceFile":"SpineLibrary\\spine-runtimes-4.1.00\\XnaLoader\\XnaTextureLoader.cs"},{"SourceFile":"Views\\UCPlayer.xaml.cs"},{"SourceFile":"Windows\\Open.xaml.cs"},{"SourceFile":"App.xaml.cs"},{"SourceFile":"MainWindow.xaml.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"Properties\\Resources.Designer.cs"},{"SourceFile":"Properties\\Settings.Designer.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.7.2.AssemblyAttributes.cs"},{"SourceFile":"F:\\SpineViewerWPF\\SpineViewerWPF\\obj\\Debug\\MainWindow.g.cs"},{"SourceFile":"F:\\SpineViewerWPF\\SpineViewerWPF\\obj\\Debug\\Views\\UCPlayer.g.cs"},{"SourceFile":"F:\\SpineViewerWPF\\SpineViewerWPF\\obj\\Debug\\Windows\\Open.g.cs"},{"SourceFile":"F:\\SpineViewerWPF\\SpineViewerWPF\\obj\\Debug\\App.g.cs"}],"References":[{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_32\\Microsoft.Xna.Framework\\v4.0_4.0.0.0__842cf8be1de50553\\Microsoft.Xna.Framework.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_32\\Microsoft.Xna.Framework.Game\\v4.0_4.0.0.0__842cf8be1de50553\\Microsoft.Xna.Framework.Game.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_32\\Microsoft.Xna.Framework.Graphics\\v4.0_4.0.0.0__842cf8be1de50553\\Microsoft.Xna.Framework.Graphics.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\PresentationCore.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\PresentationFramework.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\PublicAssemblies\\System.Buffers.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Drawing.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Numerics.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\PublicAssemblies\\System.Numerics.Vectors.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Windows.Forms.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xaml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\WindowsBase.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"F:\\SpineViewerWPF\\SpineViewerWPF\\bin\\Debug\\SpineViewerWPF.exe","OutputItemRelativePath":"SpineViewerWPF.exe"},{"OutputItemFullPath":"","OutputItemRelativePath":""}],"CopyToOutputEntries":[]}
\ No newline at end of file
diff --git a/SpineViewerWPF/App.config b/SpineViewerWPF/App.config
index 647c18b..611b730 100644
--- a/SpineViewerWPF/App.config
+++ b/SpineViewerWPF/App.config
@@ -16,7 +16,11 @@
-
+
+
+
+
+
diff --git a/SpineViewerWPF/App.xaml.cs b/SpineViewerWPF/App.xaml.cs
index dea2748..11e88c3 100644
--- a/SpineViewerWPF/App.xaml.cs
+++ b/SpineViewerWPF/App.xaml.cs
@@ -1,11 +1,6 @@
-using Microsoft.Xna.Framework.Graphics;
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Data;
-using System.Linq;
-using System.Threading.Tasks;
+using System;
using System.Windows;
+using Microsoft.Xna.Framework.Graphics;
using WpfXnaControl;
namespace SpineViewerWPF
@@ -30,9 +25,9 @@ public partial class App : Application
public static int recordImageCount;
public static double canvasWidth = SystemParameters.WorkArea.Width;
public static double canvasHeight = SystemParameters.WorkArea.Height;
- public static double mainWidth ;
- public static double mainHeight ;
+ public static double mainWidth;
+ public static double mainHeight;
- public static string tempDirPath = $"{App.rootDir}\\Temp\\";
+ public static string tempDirPath = $"{App.rootDir}\\Temp\\";
}
}
diff --git a/SpineViewerWPF/MainWindow.xaml b/SpineViewerWPF/MainWindow.xaml
index c35e545..fab4562 100644
--- a/SpineViewerWPF/MainWindow.xaml
+++ b/SpineViewerWPF/MainWindow.xaml
@@ -16,10 +16,10 @@
@@ -40,9 +40,9 @@
-
-
-
+
+
+
@@ -128,13 +128,13 @@
-
+
-
+
-
+
-
+
@@ -224,7 +224,7 @@
-
+
diff --git a/SpineViewerWPF/MainWindow.xaml.cs b/SpineViewerWPF/MainWindow.xaml.cs
index 94869c8..8087dee 100644
--- a/SpineViewerWPF/MainWindow.xaml.cs
+++ b/SpineViewerWPF/MainWindow.xaml.cs
@@ -1,25 +1,14 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.IO;
+using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
-using System.Windows.Documents;
using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-using SpineViewerWPF.Views;
using Microsoft.Win32;
-using WpfXnaControl;
-using System.Text.RegularExpressions;
-using System.IO;
using Microsoft.Xna.Framework;
+using SpineViewerWPF.Views;
using SpineViewerWPF.Windows;
-using Microsoft.Xna.Framework.Graphics;
namespace SpineViewerWPF
{
@@ -32,16 +21,17 @@ public partial class MainWindow : Window
public static ContentControl MasterControl;
public static UCPlayer UC_Player;
public static Open open;
- System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
+ System.Windows.Threading.DispatcherTimer dispatcherTimer = new();
+
public MainWindow()
{
InitializeComponent();
- Game game = new Game();
+ Game game = new();
//game.IsFixedTimeStep = true;
- this.Title = $"SpineViewerWPF v{System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()}";
+ this.Title = $"SpineViewerWPF v3.0.0.0-E";
MasterMain = this;
- dispatcherTimer.Tick += dispatcherTimer_Tick;
- dispatcherTimer.Interval = new TimeSpan(0, 0, 0,0,100);
+ dispatcherTimer.Tick += DispatcherTimer_Tick;
+ dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 100);
dispatcherTimer.Start();
LoadSetting();
@@ -84,7 +74,7 @@ private void LoadSetting()
chb_FilpY.SetBinding(CheckBox.IsCheckedProperty, new Binding() { Source = App.globalValues, Path = new PropertyPath("FilpY") });
chb_LessMemory.SetBinding(CheckBox.IsCheckedProperty, new Binding() { Source = App.globalValues, Path = new PropertyPath("UseCache") });
- TextCompositionManager.AddPreviewTextInputStartHandler(tb_Fps, tb_Fps_PreviewTextInput);
+ TextCompositionManager.AddPreviewTextInputStartHandler(tb_Fps, Tb_Fps_PreviewTextInput);
sl_Loading.SetBinding(Slider.ValueProperty, new Binding() { Source = App.globalValues, Path = new PropertyPath("Lock") });
lb_Loading.SetBinding(ContentProperty, new Binding() { Source = App.globalValues, Path = new PropertyPath("LoadingProcess") });
GridAttributes.ColumnDefinitions[0].Width = new GridLength(34);
@@ -95,7 +85,7 @@ private void LoadSetting()
App.mainHeight = this.ActualHeight;
}
- private void cb_AnimeList_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ private void Cb_AnimeList_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (cb_AnimeList.SelectedIndex != -1)
{
@@ -107,13 +97,7 @@ private void cb_AnimeList_SelectionChanged(object sender, SelectionChangedEventA
}
}
- public void UpdateSpine()
- {
- if (UC_Player != null)
- {
- UC_Player.ChangeSet();
- }
- }
+ public static void UpdateSpine() => UC_Player?.ChangeSet();
public static void SetCBAnimeName()
{
@@ -137,7 +121,7 @@ private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
}
- private void cb_SkinList_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ private void Cb_SkinList_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (cb_SkinList.SelectedIndex != -1)
{
@@ -150,25 +134,25 @@ private void cb_SkinList_SelectionChanged(object sender, SelectionChangedEventAr
}
- private void chb_IsLoop_Click(object sender, RoutedEventArgs e)
+ private void Chb_IsLoop_Click(object sender, RoutedEventArgs e)
{
App.globalValues.SetAnime = true;
}
- private void chb_PreMultiplyAlpha_Click(object sender, RoutedEventArgs e)
+ private void Chb_PreMultiplyAlpha_Click(object sender, RoutedEventArgs e)
{
UpdateSpine();
}
- private void tb_Fps_PreviewTextInput(object sender, TextCompositionEventArgs e)
+ private void Tb_Fps_PreviewTextInput(object sender, TextCompositionEventArgs e)
{
- Regex regExp = new Regex(@"\d");
+ Regex regExp = new(@"\d");
string singleValue = e.Text;
e.Handled = !regExp.Match(singleValue).Success;
}
- private void loadFileToolStripMenuItem_Click(object sender, RoutedEventArgs e)
+ private void LoadFileToolStripMenuItem_Click(object sender, RoutedEventArgs e)
{
open = new Open(this);
open.Show();
@@ -196,15 +180,9 @@ public void LoadPlayer(string spineVersion)
btn_PlayControl.Content = this.FindResource("img_pause");
DependencyObject xnaParent = ((UserControl)Player.Content).Parent;
- if (xnaParent != null)
- {
- xnaParent.SetValue(ContentPresenter.ContentProperty, null);
- }
+ xnaParent?.SetValue(ContentPresenter.ContentProperty, null);
Canvas oldCanvas = (Canvas)App.appXC.Parent;
- if (oldCanvas != null)
- {
- oldCanvas.Children.Clear();
- }
+ oldCanvas?.Children.Clear();
Player.Content = null;
UC_Player = new UCPlayer();
Player.Content = UC_Player;
@@ -228,7 +206,7 @@ public void LoadPlayer(string spineVersion)
- private void cb_export_type_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ private void Cb_export_type_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (cb_export_type.SelectedIndex != -1)
{
@@ -241,7 +219,7 @@ private void cb_export_type_SelectionChanged(object sender, SelectionChangedEven
int tempSpeed = 0;
- private void btn_PlayControl_Click(object sender, RoutedEventArgs e)
+ private void Btn_PlayControl_Click(object sender, RoutedEventArgs e)
{
if (App.globalValues.Speed == 0)
{
@@ -266,12 +244,12 @@ private void btn_PlayControl_Click(object sender, RoutedEventArgs e)
}
}
- private void btn_CaptureControl_Click(object sender, RoutedEventArgs e)
+ private void Btn_CaptureControl_Click(object sender, RoutedEventArgs e)
{
Common.TakeScreenshot();
}
- private void btn_RecodeControl_Click(object sender, RoutedEventArgs e)
+ private void Btn_RecodeControl_Click(object sender, RoutedEventArgs e)
{
if (!App.globalValues.IsRecoding)
{
@@ -279,11 +257,12 @@ private void btn_RecodeControl_Click(object sender, RoutedEventArgs e)
{
case "Png Sequence":
- SaveFileDialog saveFileDialog = new SaveFileDialog();
-
- saveFileDialog.Filter = "All files (*.*)|*.*";
- saveFileDialog.RestoreDirectory = true;
- saveFileDialog.FileName = "Save Path";
+ SaveFileDialog saveFileDialog = new()
+ {
+ Filter = "All files (*.*)|*.*",
+ RestoreDirectory = true,
+ FileName = "Save Path"
+ };
if (saveFileDialog.ShowDialog() == true)
{
@@ -312,9 +291,11 @@ private void btn_RecodeControl_Click(object sender, RoutedEventArgs e)
private void Btn_SelectBG_Click(object sender, RoutedEventArgs e)
{
- OpenFileDialog openFileDialog = new OpenFileDialog();
- openFileDialog.InitialDirectory = App.lastDir;
- openFileDialog.Filter = "Png Files (*.png)|*.png|Jpeg Files (*.jpg)|*.jpg;";
+ OpenFileDialog openFileDialog = new()
+ {
+ InitialDirectory = App.lastDir,
+ Filter = "Png Files (*.png)|*.png|Jpeg Files (*.jpg)|*.jpg;"
+ };
if (openFileDialog.ShowDialog() == true)
{
@@ -374,16 +355,14 @@ private void Window_Closed(object sender, EventArgs e)
{
Properties.Settings.Default.LastSelectDir = App.lastDir;
Properties.Settings.Default.Save();
- if (open != null)
- open.Close();
+ open?.Close();
}
- private void mi_Exit_Click(object sender, RoutedEventArgs e)
+ private void Mi_Exit_Click(object sender, RoutedEventArgs e)
{
Properties.Settings.Default.LastSelectDir = App.lastDir;
Properties.Settings.Default.Save();
- if (open != null)
- open.Close();
+ open?.Close();
Application.Current.Shutdown();
}
@@ -398,9 +377,9 @@ private void Window_GotFocus(object sender, RoutedEventArgs e)
}
- private void dispatcherTimer_Tick(object sender, EventArgs e)
+ private void DispatcherTimer_Tick(object sender, EventArgs e)
{
- if (App.graphicsDevice != null && App.graphicsDevice.GraphicsDeviceStatus == Microsoft.Xna.Framework.Graphics.GraphicsDeviceStatus.NotReset)
+ if (App.graphicsDevice != null && App.graphicsDevice.GraphicsDeviceStatus == Microsoft.Xna.Framework.Graphics.GraphicsDeviceStatus.NotReset)
{
App.graphicsDevice.Reset();
}
diff --git a/SpineViewerWPF/Properties/AssemblyInfo.cs b/SpineViewerWPF/Properties/AssemblyInfo.cs
deleted file mode 100644
index 424ed66..0000000
--- a/SpineViewerWPF/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Windows;
-
-// 組件的一般資訊是由下列的屬性集控制。
-// 變更這些屬性的值即可修改組件的相關
-// 資訊。
-[assembly: AssemblyTitle("SpineViewerWPF")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("SpineViewerWPF")]
-[assembly: AssemblyCopyright("Copyright © 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// 將 ComVisible 設為 false 可對 COM 元件隱藏
-// 組件中的類型。若必須從 COM 存取此組件中的類型,
-// 的類型,請在該類型上將 ComVisible 屬性設定為 true。
-[assembly: ComVisible(false)]
-
-//若要開始建置可當地語系化的應用程式,請在
-//.csproj 檔案中的 CultureYouAreCodingWith
-//CultureYouAreCodingWith。例如,如果原始程式檔使用美式英文,
-//請將 設為 en-US。然後取消註解下列
-//NeutralResourceLanguage 屬性。在下一行中更新 "en-US",
-//以符合專案檔中的 UICulture 設定。
-
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
-[assembly: ThemeInfo(
- ResourceDictionaryLocation.None, //主題特定資源字典的位置
- //(在頁面中找不到時使用,
- // 或應用程式資源字典中找不到資源時)
- ResourceDictionaryLocation.SourceAssembly //泛型資源字典的位置
- //(在頁面中找不到時使用,
- // 或是應用程式或任何主題特定資源字典中找不到資源時)
-)]
-
-
-// 組件的版本資訊由下列四個值所組成:
-//
-// 主要版本
-// 次要版本
-// 組建編號
-// 修訂編號
-//
-// 您可以指定所有的值,或將組建編號或修訂編號設為預設值
-// 指定為預設值:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("2.4.0.0")]
-[assembly: AssemblyFileVersion("2.4.0.0")]
diff --git a/SpineViewerWPF/Properties/Settings.Designer.cs b/SpineViewerWPF/Properties/Settings.Designer.cs
index 87c4afd..9daa67b 100644
--- a/SpineViewerWPF/Properties/Settings.Designer.cs
+++ b/SpineViewerWPF/Properties/Settings.Designer.cs
@@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
//
-// 這段程式碼是由工具產生的。
-// 執行階段版本:4.0.30319.42000
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
//
-// 對這個檔案所做的變更可能會造成錯誤的行為,而且如果重新產生程式碼,
-// 變更將會遺失。
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
//
//------------------------------------------------------------------------------
@@ -12,7 +12,7 @@ namespace SpineViewerWPF.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.3.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.12.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
diff --git a/SpineViewerWPF/PublicFunction/BlendXna.cs b/SpineViewerWPF/PublicFunction/BlendXna.cs
index 384da7b..a9f163d 100644
--- a/SpineViewerWPF/PublicFunction/BlendXna.cs
+++ b/SpineViewerWPF/PublicFunction/BlendXna.cs
@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Graphics;
public static class BlendXna
{
@@ -32,7 +27,7 @@ public static class BlendXna
public const int GL_DST_COLOR = 0x0306;
public const int GL_ONE_MINUS_DST_COLOR = 0x0307;
public const int GL_SRC_ALPHA_SATURATE = 0x0308;
-
+
public static Blend GetXNABlend(int glBlend)
{
diff --git a/SpineViewerWPF/PublicFunction/Common.cs b/SpineViewerWPF/PublicFunction/Common.cs
index fb95268..7ada673 100644
--- a/SpineViewerWPF/PublicFunction/Common.cs
+++ b/SpineViewerWPF/PublicFunction/Common.cs
@@ -1,19 +1,16 @@
-using Microsoft.Win32;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading;
+using System.Windows;
+using System.Windows.Media.Imaging;
+using Microsoft.Win32;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Formats.Gif;
-//using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
-using SixLabors.ImageSharp.Processing;
using SpineViewerWPF;
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.IO;
-using System.Threading;
-using System.Windows;
-using System.Windows.Media.Imaging;
public class Common
{
@@ -38,13 +35,10 @@ public static void Reset()
App.globalValues.FilpY = false;
App.globalValues.PosBGX = 0;
App.globalValues.PosBGY = 0;
- if (App.textureBG != null)
- App.textureBG.Dispose();
+ App.textureBG?.Dispose();
- if (App.globalValues.AnimeList != null)
- App.globalValues.AnimeList.Clear();
- if (App.globalValues.SkinList != null)
- App.globalValues.SkinList.Clear();
+ App.globalValues.AnimeList?.Clear();
+ App.globalValues.SkinList?.Clear();
}
@@ -85,7 +79,7 @@ public static bool CheckSpineFile(string path)
App.globalValues.SelectSpineFile = "";
return false;
}
-
+
}
@@ -102,18 +96,12 @@ public static string GetJsonPath(string path)
public static Texture2D SetBG(string path)
{
- using (FileStream fileStream = new FileStream(path, FileMode.Open))
- {
- using (System.Drawing.Image image = System.Drawing.Image.FromStream(fileStream))
- {
- using (MemoryStream ms = new MemoryStream())
- {
- image.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
- ms.Seek(0, SeekOrigin.Begin);
- return Texture2D.FromStream(App.appXC.GraphicsDevice, ms);
- }
- }
- }
+ using FileStream fileStream = new(path, FileMode.Open);
+ using System.Drawing.Image image = System.Drawing.Image.FromStream(fileStream);
+ using MemoryStream ms = new();
+ image.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
+ ms.Seek(0, SeekOrigin.Begin);
+ return Texture2D.FromStream(App.appXC.GraphicsDevice, ms);
}
@@ -132,16 +120,16 @@ public static void SetBGXY(double MosX, double MosY, double oldX, double oldY)
public static void RecodingEnd(float AnimationEnd)
{
- if(App.globalValues.ExportType == "Gif")
+ if (App.globalValues.ExportType == "Gif")
{
- Thread t = new Thread(() =>
+ Thread t = new(() =>
{
if (!App.globalValues.UseCache)
{
- List lms = new List();
+ List lms = [];
for (int i = 0; i < App.globalValues.GifList.Count; i++)
{
- MemoryStream ms = new MemoryStream();
+ MemoryStream ms = new();
App.globalValues.GifList[i].SaveAsPng(ms, App.globalValues.GifList[i].Width, App.globalValues.GifList[i].Height);
lms.Add(ms);
App.globalValues.GifList[i].Dispose();
@@ -164,9 +152,11 @@ public static void RecodingEnd(float AnimationEnd)
public static void SaveToGif(List lms, float time = 0)
{
- SaveFileDialog saveFileDialog = new SaveFileDialog();
- saveFileDialog.Filter = "Gif Image|*.gif";
- saveFileDialog.Title = "Save a Gif File";
+ SaveFileDialog saveFileDialog = new()
+ {
+ Filter = "Gif Image|*.gif",
+ Title = "Save a Gif File"
+ };
string fileName = GetFileNameNoEx(App.globalValues.SelectAtlasFile);
if (App.globalValues.SelectAnimeName != "")
@@ -179,7 +169,7 @@ public static void SaveToGif(List lms, float time = 0)
{
return;
}
- int delay = 0;
+ int delay;
if (time == 0)
{
delay = 1000 / App.globalValues.Speed;
@@ -188,17 +178,14 @@ public static void SaveToGif(List lms, float time = 0)
{
delay = (int)(time * 1000 * (App.globalValues.Speed / 30f) / lms.Count);
}
-
+
if (saveFileDialog.FileName != "")
{
-
- SixLabors.ImageSharp.Image img = null;
-
- SixLabors.ImageSharp.Image gif = new SixLabors.ImageSharp.Image(Convert.ToInt32(App.globalValues.FrameWidth), Convert.ToInt32(App.globalValues.FrameHeight));
+ SixLabors.ImageSharp.Image gif = new(Convert.ToInt32(App.globalValues.FrameWidth), Convert.ToInt32(App.globalValues.FrameHeight));
for (int i = 0; i < lms.Count; ++i)
{
- img = SixLabors.ImageSharp.Image.Load(lms[i].ToArray());
+ Image img = SixLabors.ImageSharp.Image.Load(lms[i].ToArray());
gif.Frames.AddFrame(img.Frames[0]);
img.Dispose();
}
@@ -240,9 +227,11 @@ public static void SaveToGif(List lms, float time = 0)
public static void SaveToGif2(float time = 0)
{
- SaveFileDialog saveFileDialog = new SaveFileDialog();
- saveFileDialog.Filter = "Gif Image|*.gif";
- saveFileDialog.Title = "Save a Gif File";
+ SaveFileDialog saveFileDialog = new()
+ {
+ Filter = "Gif Image|*.gif",
+ Title = "Save a Gif File"
+ };
string fileName = GetFileNameNoEx(App.globalValues.SelectAtlasFile);
if (App.globalValues.SelectAnimeName != "")
@@ -251,15 +240,15 @@ public static void SaveToGif2(float time = 0)
fileName += $"_{App.globalValues.SelectSkin}";
saveFileDialog.FileName = fileName;
- if(saveFileDialog.ShowDialog() == false )
+ if (saveFileDialog.ShowDialog() == false)
{
return;
}
- string[] pngList = Directory.GetFiles($"{App.rootDir}\\Temp\\", "*.png",SearchOption.TopDirectoryOnly);
+ string[] pngList = Directory.GetFiles($"{App.rootDir}\\Temp\\", "*.png", SearchOption.TopDirectoryOnly);
- int delay = 0;
+ int delay;
if (time == 0)
{
delay = 1000 / App.globalValues.Speed;
@@ -271,24 +260,21 @@ public static void SaveToGif2(float time = 0)
if (saveFileDialog.FileName != "")
{
-
- SixLabors.ImageSharp.Image img = null;
-
- SixLabors.ImageSharp.Image gif = new SixLabors.ImageSharp.Image(Convert.ToInt32(App.globalValues.FrameWidth), Convert.ToInt32(App.globalValues.FrameHeight));
+ SixLabors.ImageSharp.Image gif = new(Convert.ToInt32(App.globalValues.FrameWidth), Convert.ToInt32(App.globalValues.FrameHeight));
for (int i = 0; i < pngList.Length; ++i)
{
- img = SixLabors.ImageSharp.Image.Load(pngList[i]);
+ Image img = SixLabors.ImageSharp.Image.Load(pngList[i]);
gif.Frames.AddFrame(img.Frames[0]);
img.Dispose();
}
-
+
foreach (ImageFrame frame in gif.Frames)
{
GifFrameMetadata meta = frame.Metadata.GetGifMetadata(); // Get or create if none.
-
- meta.FrameDelay = delay/10; // Set to 30/100 of a second.
+
+ meta.FrameDelay = delay / 10; // Set to 30/100 of a second.
meta.DisposalMethod = GifDisposalMethod.RestoreToBackground;
}
@@ -297,7 +283,7 @@ public static void SaveToGif2(float time = 0)
gif.Frames.RemoveFrame(0);
using (FileStream fs = File.Create(saveFileDialog.FileName))
{
- gif.SaveAsGif(fs,new GifEncoder() { ColorTableMode = GifColorTableMode.Global});
+ gif.SaveAsGif(fs, new GifEncoder() { ColorTableMode = GifColorTableMode.Global });
}
gif.Dispose();
@@ -324,16 +310,18 @@ public static BitmapSource SourceFrom(MemoryStream stream, int? size = null)
bitmapImage.StreamSource = stream;
bitmapImage.EndInit();
- bitmapImage.Freeze();
+ bitmapImage.Freeze();
return bitmapImage;
}
public static void SaveToPng(Texture2D texture2D)
{
- SaveFileDialog saveFileDialog = new SaveFileDialog();
- saveFileDialog.Filter = "Png Image|*.png";
- saveFileDialog.Title = "Save a Png File";
+ SaveFileDialog saveFileDialog = new()
+ {
+ Filter = "Png Image|*.png",
+ Title = "Save a Png File"
+ };
string fileName = GetFileNameNoEx(App.globalValues.SelectAtlasFile);
if (App.globalValues.SelectAnimeName != "")
fileName += $"_{App.globalValues.SelectAnimeName}";
@@ -345,10 +333,8 @@ public static void SaveToPng(Texture2D texture2D)
if (result == true)
{
- using (var fs = (FileStream)saveFileDialog.OpenFile())
- {
- texture2D.SaveAsPng(fs, texture2D.Width, texture2D.Height);
- }
+ using var fs = (FileStream)saveFileDialog.OpenFile();
+ texture2D.SaveAsPng(fs, texture2D.Width, texture2D.Height);
}
}
@@ -360,7 +346,7 @@ public static void TakeRecodeScreenshot(GraphicsDevice _graphicsDevice)
_graphicsDevice.SetRenderTarget(null);
wpfRenderTarget.GetData(screenData);
- Texture2D texture = new Texture2D(_graphicsDevice, _graphicsDevice.PresentationParameters.BackBufferWidth, _graphicsDevice.PresentationParameters.BackBufferHeight, false, _graphicsDevice.PresentationParameters.BackBufferFormat);
+ Texture2D texture = new(_graphicsDevice, _graphicsDevice.PresentationParameters.BackBufferWidth, _graphicsDevice.PresentationParameters.BackBufferHeight, false, _graphicsDevice.PresentationParameters.BackBufferFormat);
texture.SetData(screenData);
if (!App.globalValues.UseCache && App.globalValues.ExportType == "Gif")
@@ -377,12 +363,12 @@ public static void TakeRecodeScreenshot(GraphicsDevice _graphicsDevice)
fileName += $"_{App.globalValues.SelectSkin}";
string exportDir = App.tempDirPath;
- if(App.globalValues.ExportType == "Png Sequence")
+ if (App.globalValues.ExportType == "Png Sequence")
{
exportDir = App.globalValues.ExportPath + "\\";
}
- using (FileStream fs = new FileStream($"{exportDir}{fileName}_{App.recordImageCount.ToString().PadLeft(7,'0')}.png"
- ,FileMode.Create))
+ using (FileStream fs = new($"{exportDir}{fileName}_{App.recordImageCount.ToString().PadLeft(7, '0')}.png"
+ , FileMode.Create))
{
texture.SaveAsPng(fs, _graphicsDevice.PresentationParameters.BackBufferWidth
, _graphicsDevice.PresentationParameters.BackBufferHeight);
@@ -404,18 +390,18 @@ public static void TakeScreenshot()
GraphicsDevice _graphicsDevice = App.appXC.GraphicsDevice;
App.globalValues.TimeScale = 0;
- using (RenderTarget2D renderTarget = new RenderTarget2D(_graphicsDevice, _graphicsDevice.PresentationParameters.BackBufferWidth, _graphicsDevice.PresentationParameters.BackBufferHeight))
+ using (RenderTarget2D renderTarget = new(_graphicsDevice, _graphicsDevice.PresentationParameters.BackBufferWidth, _graphicsDevice.PresentationParameters.BackBufferHeight))
{
_graphicsDevice.Textures[0] = null;
_graphicsDevice.SetRenderTarget(renderTarget);
App.appXC.Draw();
- GameTime gameTime = new GameTime();
+ GameTime gameTime = new();
App.appXC.Update(gameTime);
_graphicsDevice.Viewport = new Viewport(0, 0, _graphicsDevice.PresentationParameters.BackBufferWidth, _graphicsDevice.PresentationParameters.BackBufferHeight);
_graphicsDevice.SetRenderTarget(null);
int[] screenData = new int[_graphicsDevice.PresentationParameters.BackBufferWidth * _graphicsDevice.PresentationParameters.BackBufferHeight];
renderTarget.GetData(screenData);
- Texture2D texture = new Texture2D(_graphicsDevice, _graphicsDevice.PresentationParameters.BackBufferWidth, _graphicsDevice.PresentationParameters.BackBufferHeight, false, _graphicsDevice.PresentationParameters.BackBufferFormat);
+ Texture2D texture = new(_graphicsDevice, _graphicsDevice.PresentationParameters.BackBufferWidth, _graphicsDevice.PresentationParameters.BackBufferHeight, false, _graphicsDevice.PresentationParameters.BackBufferFormat);
texture.SetData(screenData);
Common.SaveToPng(texture);
texture.Dispose();
@@ -429,7 +415,7 @@ public static void ClearCacheFile()
string[] fileList = Directory.GetFiles($"{App.rootDir}\\Temp\\", "*.*", SearchOption.AllDirectories);
if (fileList.Length > 0)
{
- foreach(string path in fileList)
+ foreach (string path in fileList)
{
File.Delete(path);
}
@@ -445,6 +431,4 @@ public static void SetInitLocation(float height)
}
}
-}
-
-
+}
\ No newline at end of file
diff --git a/SpineViewerWPF/PublicFunction/GlobalValue.cs b/SpineViewerWPF/PublicFunction/GlobalValue.cs
index c7a3764..53b08e7 100644
--- a/SpineViewerWPF/PublicFunction/GlobalValue.cs
+++ b/SpineViewerWPF/PublicFunction/GlobalValue.cs
@@ -1,10 +1,7 @@
-using Microsoft.Xna.Framework.Graphics;
-using System;
+using System;
using System.Collections.Generic;
using System.ComponentModel;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using Microsoft.Xna.Framework.Graphics;
public class GlobalValue : INotifyPropertyChanged
@@ -61,7 +58,7 @@ public string SelectAtlasFile
if (_SelectAtlasFile != value)
{
_SelectAtlasFile = value;
- OnPropertyChanged("SelectAtlasFile");
+ OnPropertyChanged(nameof(SelectAtlasFile));
}
}
}
@@ -77,7 +74,7 @@ public string SelectSpineFile
if (_SelectSpineFile != value)
{
_SelectSpineFile = value;
- OnPropertyChanged("SelectSpineFile");
+ OnPropertyChanged(nameof(SelectSpineFile));
}
}
}
@@ -93,7 +90,7 @@ public string SpineVersion
if (_SpineVersion != value)
{
_SpineVersion = value;
- OnPropertyChanged("SpineVersion");
+ OnPropertyChanged(nameof(SpineVersion));
}
}
}
@@ -110,7 +107,7 @@ public List AnimeList
if (_AnimeList != value)
{
_AnimeList = value;
- OnPropertyChanged("AnimeList");
+ OnPropertyChanged(nameof(AnimeList));
}
}
}
@@ -125,7 +122,7 @@ public List SkinList
if (_SkinList != value)
{
_SkinList = value;
- OnPropertyChanged("SkinList");
+ OnPropertyChanged(nameof(SkinList));
}
}
}
@@ -140,7 +137,7 @@ public float Scale
if (_Scale != value)
{
_Scale = (float)Math.Round(value, 2);
- OnPropertyChanged("Scale");
+ OnPropertyChanged(nameof(Scale));
}
}
}
@@ -154,8 +151,8 @@ public double ViewScale
{
if (_ViewScale != value)
{
- _ViewScale = (double)Math.Round(value, 2);
- OnPropertyChanged("ViewScale");
+ _ViewScale = Math.Round(value, 2);
+ OnPropertyChanged(nameof(ViewScale));
}
}
}
@@ -173,7 +170,7 @@ public int Speed
if (_Speed != value)
{
_Speed = value;
- OnPropertyChanged("Speed");
+ OnPropertyChanged(nameof(Speed));
}
}
}
@@ -189,7 +186,7 @@ public float PosX
if (_PosX != value)
{
_PosX = (float)Math.Round(value, 2);
- OnPropertyChanged("PosX");
+ OnPropertyChanged(nameof(PosX));
}
}
}
@@ -204,7 +201,7 @@ public float PosY
if (_PosY != value)
{
_PosY = (float)Math.Round(value, 2);
- OnPropertyChanged("PosY");
+ OnPropertyChanged(nameof(PosY));
}
}
}
@@ -220,7 +217,7 @@ public float PosBGX
if (_PosBGX != value)
{
_PosBGX = (float)Math.Round(value, 2);
- OnPropertyChanged("PosBGX");
+ OnPropertyChanged(nameof(PosBGX));
}
}
}
@@ -235,7 +232,7 @@ public float PosBGY
if (_PosBGY != value)
{
_PosBGY = (float)Math.Round(value, 2);
- OnPropertyChanged("PosBGY");
+ OnPropertyChanged(nameof(PosBGY));
}
}
}
@@ -250,7 +247,7 @@ public bool Alpha
if (_Alpha != value)
{
_Alpha = value;
- OnPropertyChanged("Alpha");
+ OnPropertyChanged(nameof(Alpha));
}
}
}
@@ -265,7 +262,7 @@ public bool UseBG
if (_UseBG != value)
{
_UseBG = value;
- OnPropertyChanged("UseBG");
+ OnPropertyChanged(nameof(UseBG));
}
}
}
@@ -280,7 +277,7 @@ public bool ControlBG
if (_ControlBG != value)
{
_ControlBG = value;
- OnPropertyChanged("ControlBG");
+ OnPropertyChanged(nameof(ControlBG));
}
}
}
@@ -295,7 +292,7 @@ public bool IsLoop
if (_IsLoop != value)
{
_IsLoop = value;
- OnPropertyChanged("IsLoop");
+ OnPropertyChanged(nameof(IsLoop));
}
}
}
@@ -310,7 +307,7 @@ public string SelectAnimeName
if (_SelectAnimeName != value)
{
_SelectAnimeName = value;
- OnPropertyChanged("SelectAnimeName");
+ OnPropertyChanged(nameof(SelectAnimeName));
}
}
}
@@ -325,7 +322,7 @@ public string SelectSkin
if (_SelectSkin != value)
{
_SelectSkin = value;
- OnPropertyChanged("SelectSkin");
+ OnPropertyChanged(nameof(SelectSkin));
}
}
}
@@ -340,7 +337,7 @@ public string SelectBG
if (_SelectBG != value)
{
_SelectBG = value;
- OnPropertyChanged("SelectBG");
+ OnPropertyChanged(nameof(SelectBG));
}
}
}
@@ -356,7 +353,7 @@ public float TimeScale
if (_TimeScale != value)
{
_TimeScale = value;
- OnPropertyChanged("TimeScale");
+ OnPropertyChanged(nameof(TimeScale));
}
}
}
@@ -371,7 +368,7 @@ public string SelectSpineVersion
if (_SelectSpineVersion != value)
{
_SelectSpineVersion = value;
- OnPropertyChanged("SelectSpineVersion");
+ OnPropertyChanged(nameof(SelectSpineVersion));
}
}
}
@@ -386,7 +383,7 @@ public double FrameWidth
if (_FrameWidth != value)
{
_FrameWidth = value;
- OnPropertyChanged("FrameWidth");
+ OnPropertyChanged(nameof(FrameWidth));
}
}
}
@@ -401,7 +398,7 @@ public double FrameHeight
if (_FrameHeight != value)
{
_FrameHeight = value;
- OnPropertyChanged("FrameHeight");
+ OnPropertyChanged(nameof(FrameHeight));
}
}
}
@@ -417,7 +414,7 @@ public bool PreMultiplyAlpha
if (_PreMultiplyAlpha != value)
{
_PreMultiplyAlpha = value;
- OnPropertyChanged("PreMultiplyAlpha");
+ OnPropertyChanged(nameof(PreMultiplyAlpha));
}
}
}
@@ -433,7 +430,7 @@ public bool SetSkin
if (_SetSkin != value)
{
_SetSkin = value;
- OnPropertyChanged("SetSkin");
+ OnPropertyChanged(nameof(SetSkin));
}
}
}
@@ -449,7 +446,7 @@ public bool SetAnime
if (_SetAnime != value)
{
_SetAnime = value;
- OnPropertyChanged("SetAnime");
+ OnPropertyChanged(nameof(SetAnime));
}
}
}
@@ -465,7 +462,7 @@ public string FileHash
if (_FileHash != value)
{
_FileHash = value;
- OnPropertyChanged("FileHash");
+ OnPropertyChanged(nameof(FileHash));
}
}
}
@@ -481,7 +478,7 @@ public string ExportType
if (_ExportType != value)
{
_ExportType = value;
- OnPropertyChanged("ExportType");
+ OnPropertyChanged(nameof(ExportType));
}
}
}
@@ -497,7 +494,7 @@ public string ExportPath
if (_ExportPath != value)
{
_ExportPath = value;
- OnPropertyChanged("ExportPath");
+ OnPropertyChanged(nameof(ExportPath));
}
}
}
@@ -512,7 +509,7 @@ public string LoadingProcess
if (_LoadingProcess != value)
{
_LoadingProcess = value;
- OnPropertyChanged("LoadingProcess");
+ OnPropertyChanged(nameof(LoadingProcess));
}
}
@@ -529,7 +526,7 @@ public float Lock
if (float.TryParse(value.ToString(), out _Lock))
{
_Lock = (float)Math.Round(value, 2);
- OnPropertyChanged("Lock");
+ OnPropertyChanged(nameof(Lock));
}
}
}
@@ -539,8 +536,7 @@ public List GifList
get
{
- if (_GifList == null)
- _GifList = new List();
+ _GifList ??= [];
return _GifList;
@@ -551,7 +547,7 @@ public List GifList
{
_GifList = value;
}
-
+
}
}
@@ -567,7 +563,7 @@ public bool IsRecoding
if (_IsRecoding != value)
{
_IsRecoding = value;
- OnPropertyChanged("IsRecoding");
+ OnPropertyChanged(nameof(IsRecoding));
}
}
}
@@ -583,7 +579,7 @@ public bool FilpX
if (_FilpX != value)
{
_FilpX = value;
- OnPropertyChanged("FilpX");
+ OnPropertyChanged(nameof(FilpX));
}
}
}
@@ -599,7 +595,7 @@ public bool FilpY
if (_FilpY != value)
{
_FilpY = value;
- OnPropertyChanged("FilpY");
+ OnPropertyChanged(nameof(FilpY));
}
}
}
@@ -617,7 +613,7 @@ public float RedcodePanelWidth
if (_RedcodePanelWidth != value)
{
_RedcodePanelWidth = value;
- OnPropertyChanged("RedcodePanelWidth");
+ OnPropertyChanged(nameof(RedcodePanelWidth));
}
}
}
@@ -636,7 +632,7 @@ public float Rotation
if (_Rotation != value)
{
_Rotation = value;
- OnPropertyChanged("Rotation");
+ OnPropertyChanged(nameof(Rotation));
}
}
}
@@ -653,7 +649,7 @@ public bool UseCache
if (_UseCache != value)
{
_UseCache = value;
- OnPropertyChanged("UseCache");
+ OnPropertyChanged(nameof(UseCache));
}
}
}
diff --git a/SpineViewerWPF/PublicFunction/NewTextureLoader.cs b/SpineViewerWPF/PublicFunction/NewTextureLoader.cs
index 2e73b50..1f9a76e 100644
--- a/SpineViewerWPF/PublicFunction/NewTextureLoader.cs
+++ b/SpineViewerWPF/PublicFunction/NewTextureLoader.cs
@@ -1,12 +1,6 @@
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using System;
-using System.Collections.Generic;
-using System.Drawing;
+using System.Drawing;
using System.IO;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using Microsoft.Xna.Framework.Graphics;
public class NewTextureLoader
{
diff --git a/SpineViewerWPF/PublicFunction/Player.cs b/SpineViewerWPF/PublicFunction/Player.cs
index d83e6f3..a59cea7 100644
--- a/SpineViewerWPF/PublicFunction/Player.cs
+++ b/SpineViewerWPF/PublicFunction/Player.cs
@@ -1,13 +1,8 @@
-using Microsoft.Xna.Framework;
+using System.Windows;
+using System.Windows.Input;
+using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using SpineViewerWPF;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Input;
public class Player
{
@@ -37,18 +32,18 @@ public static void UserControl_SizeChanged(ref GraphicsDevice graphicsDevice)
public static void Frame_MouseWheel(MouseWheelEventArgs e)
{
- if (e.Delta > 0)
- {
- App.globalValues.Scale += 0.02f;
- }
- else
+ if (e.Delta > 0)
+ {
+ App.globalValues.Scale += 0.02f;
+ }
+ else
+ {
+ if (App.globalValues.Scale > 0.04f)
{
- if (App.globalValues.Scale > 0.04f)
- {
- App.globalValues.Scale -= 0.02f;
- }
+ App.globalValues.Scale -= 0.02f;
}
-
+ }
+
}
public static void DrawBG(ref SpriteBatch spriteBatch)
diff --git a/SpineViewerWPF/PublicFunction/Player/IPlayer.cs b/SpineViewerWPF/PublicFunction/Player/IPlayer.cs
index 0b3ce43..4b36184 100644
--- a/SpineViewerWPF/PublicFunction/Player/IPlayer.cs
+++ b/SpineViewerWPF/PublicFunction/Player/IPlayer.cs
@@ -1,11 +1,5 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
-using Microsoft.Xna.Framework.Graphics;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
public interface IPlayer
diff --git a/SpineViewerWPF/PublicFunction/Player/Player_2_1_08.cs b/SpineViewerWPF/PublicFunction/Player/Player_2_1_08.cs
index 68e3272..16d7b45 100644
--- a/SpineViewerWPF/PublicFunction/Player/Player_2_1_08.cs
+++ b/SpineViewerWPF/PublicFunction/Player/Player_2_1_08.cs
@@ -1,13 +1,9 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Spine2_1_08;
-using SpineViewerWPF;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
-using Microsoft.Xna.Framework.Graphics;
+using Spine2_1_08;
+using SpineViewerWPF;
public class Player_2_1_08 : IPlayer
@@ -107,7 +103,7 @@ public void Update(GameTime gameTime)
App.graphicsDevice.Clear(Color.Transparent);
Player.DrawBG(ref App.spriteBatch);
- App.globalValues.TimeScale = (float)App.globalValues.Speed / 30f;
+ App.globalValues.TimeScale = App.globalValues.Speed / 30f;
state.Update((float)gameTime.ElapsedGameTime.TotalMilliseconds / 1000f);
@@ -141,12 +137,12 @@ public void Update(GameTime gameTime)
public void Draw()
{
-
+
if (state != null)
{
TrackEntry entry = state.GetCurrent(0);
- float speed = (float)App.globalValues.Speed / 30f;
+ float speed = App.globalValues.Speed / 30f;
if (entry != null)
{
if (App.globalValues.IsRecoding && (App.globalValues.GifList != null || App.recordImageCount > 0) && entry.LastTime < entry.EndTime)
@@ -182,7 +178,7 @@ public void Draw()
App.globalValues.Lock = (entry.LastTime % entry.EndTime) / entry.EndTime;
entry.TimeScale = App.globalValues.TimeScale;
}
- App.globalValues.LoadingProcess = $"{ Math.Round((entry.Time % entry.EndTime) / entry.EndTime * 100, 2)}%";
+ App.globalValues.LoadingProcess = $"{Math.Round((entry.Time % entry.EndTime) / entry.EndTime * 100, 2)}%";
}
}
diff --git a/SpineViewerWPF/PublicFunction/Player/Player_2_1_25.cs b/SpineViewerWPF/PublicFunction/Player/Player_2_1_25.cs
index d1a3000..5fd269d 100644
--- a/SpineViewerWPF/PublicFunction/Player/Player_2_1_25.cs
+++ b/SpineViewerWPF/PublicFunction/Player/Player_2_1_25.cs
@@ -1,13 +1,9 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Spine2_1_25;
-using SpineViewerWPF;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
-using Microsoft.Xna.Framework.Graphics;
+using Spine2_1_25;
+using SpineViewerWPF;
public class Player_2_1_25 : IPlayer
{
@@ -116,7 +112,7 @@ public void Update(GameTime gameTime)
App.graphicsDevice.Clear(Color.Transparent);
Player.DrawBG(ref App.spriteBatch);
- App.globalValues.TimeScale = (float)App.globalValues.Speed / 30f;
+ App.globalValues.TimeScale = App.globalValues.Speed / 30f;
state.Update((float)gameTime.ElapsedGameTime.TotalMilliseconds / 1000f);
@@ -159,12 +155,12 @@ public void Update(GameTime gameTime)
public void Draw()
{
-
+
if (state != null)
{
TrackEntry entry = state.GetCurrent(0);
- float speed = (float)App.globalValues.Speed / 30f;
+ float speed = App.globalValues.Speed / 30f;
if (entry != null)
{
if (App.globalValues.IsRecoding && (App.globalValues.GifList != null || App.recordImageCount > 0) && entry.LastTime < entry.EndTime)
@@ -200,7 +196,7 @@ public void Draw()
App.globalValues.Lock = (entry.LastTime % entry.EndTime) / entry.EndTime;
entry.TimeScale = App.globalValues.TimeScale;
}
- App.globalValues.LoadingProcess = $"{ Math.Round((entry.Time % entry.EndTime) / entry.EndTime * 100, 2)}%";
+ App.globalValues.LoadingProcess = $"{Math.Round((entry.Time % entry.EndTime) / entry.EndTime * 100, 2)}%";
}
}
diff --git a/SpineViewerWPF/PublicFunction/Player/Player_3_1_07.cs b/SpineViewerWPF/PublicFunction/Player/Player_3_1_07.cs
index 1b58a03..62720fe 100644
--- a/SpineViewerWPF/PublicFunction/Player/Player_3_1_07.cs
+++ b/SpineViewerWPF/PublicFunction/Player/Player_3_1_07.cs
@@ -1,13 +1,9 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Spine3_1_07;
-using SpineViewerWPF;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
-using Microsoft.Xna.Framework.Graphics;
+using Spine3_1_07;
+using SpineViewerWPF;
public class Player_3_1_07 : IPlayer
{
@@ -116,7 +112,7 @@ public void Update(GameTime gameTime)
App.graphicsDevice.Clear(Color.Transparent);
Player.DrawBG(ref App.spriteBatch);
- App.globalValues.TimeScale = (float)App.globalValues.Speed / 30f;
+ App.globalValues.TimeScale = App.globalValues.Speed / 30f;
state.Update((float)gameTime.ElapsedGameTime.TotalMilliseconds / 1000f);
@@ -159,12 +155,12 @@ public void Update(GameTime gameTime)
public void Draw()
{
-
+
if (state != null)
{
TrackEntry entry = state.GetCurrent(0);
- float speed = (float)App.globalValues.Speed / 30f;
+ float speed = App.globalValues.Speed / 30f;
if (entry != null)
{
@@ -201,7 +197,7 @@ public void Draw()
App.globalValues.Lock = (entry.LastTime % entry.EndTime) / entry.EndTime;
entry.TimeScale = App.globalValues.TimeScale;
}
- App.globalValues.LoadingProcess = $"{ Math.Round((entry.Time % entry.EndTime) / entry.EndTime * 100, 2)}%";
+ App.globalValues.LoadingProcess = $"{Math.Round((entry.Time % entry.EndTime) / entry.EndTime * 100, 2)}%";
}
}
diff --git a/SpineViewerWPF/PublicFunction/Player/Player_3_2_xx.cs b/SpineViewerWPF/PublicFunction/Player/Player_3_2_xx.cs
index c28f6cf..a1b2902 100644
--- a/SpineViewerWPF/PublicFunction/Player/Player_3_2_xx.cs
+++ b/SpineViewerWPF/PublicFunction/Player/Player_3_2_xx.cs
@@ -1,13 +1,9 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Spine3_2_xx;
-using SpineViewerWPF;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
-using Microsoft.Xna.Framework.Graphics;
+using Spine3_2_xx;
+using SpineViewerWPF;
public class Player_3_2_xx : IPlayer
{
@@ -116,7 +112,7 @@ public void Update(GameTime gameTime)
App.graphicsDevice.Clear(Color.Transparent);
Player.DrawBG(ref App.spriteBatch);
- App.globalValues.TimeScale = (float)App.globalValues.Speed / 30f;
+ App.globalValues.TimeScale = App.globalValues.Speed / 30f;
state.Update((float)gameTime.ElapsedGameTime.TotalMilliseconds / 1000f);
@@ -164,7 +160,7 @@ public void Draw()
if (state != null)
{
TrackEntry entry = state.GetCurrent(0);
- float speed = (float)App.globalValues.Speed / 30f;
+ float speed = App.globalValues.Speed / 30f;
if (entry != null)
{
@@ -201,7 +197,7 @@ public void Draw()
App.globalValues.Lock = (entry.LastTime % entry.EndTime) / entry.EndTime;
entry.TimeScale = App.globalValues.TimeScale;
}
- App.globalValues.LoadingProcess = $"{ Math.Round((entry.Time % entry.EndTime) / entry.EndTime * 100, 2)}%";
+ App.globalValues.LoadingProcess = $"{Math.Round((entry.Time % entry.EndTime) / entry.EndTime * 100, 2)}%";
}
}
diff --git a/SpineViewerWPF/PublicFunction/Player/Player_3_4_02.cs b/SpineViewerWPF/PublicFunction/Player/Player_3_4_02.cs
index ea74209..900eff9 100644
--- a/SpineViewerWPF/PublicFunction/Player/Player_3_4_02.cs
+++ b/SpineViewerWPF/PublicFunction/Player/Player_3_4_02.cs
@@ -1,13 +1,9 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Spine3_4_02;
-using SpineViewerWPF;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
-using Microsoft.Xna.Framework.Graphics;
+using Spine3_4_02;
+using SpineViewerWPF;
public class Player_3_4_02 : IPlayer
{
@@ -116,7 +112,7 @@ public void Update(GameTime gameTime)
App.graphicsDevice.Clear(Color.Transparent);
Player.DrawBG(ref App.spriteBatch);
- App.globalValues.TimeScale = (float)App.globalValues.Speed / 30f;
+ App.globalValues.TimeScale = App.globalValues.Speed / 30f;
state.Update((float)gameTime.ElapsedGameTime.TotalMilliseconds / 1000f);
@@ -164,7 +160,7 @@ public void Draw()
if (state != null)
{
TrackEntry entry = state.GetCurrent(0);
- float speed = (float)App.globalValues.Speed / 30f;
+ float speed = App.globalValues.Speed / 30f;
if (entry != null)
{
@@ -201,7 +197,7 @@ public void Draw()
App.globalValues.Lock = (entry.LastTime % entry.EndTime) / entry.EndTime;
entry.TimeScale = App.globalValues.TimeScale;
}
- App.globalValues.LoadingProcess = $"{ Math.Round((entry.Time % entry.EndTime) / entry.EndTime * 100, 2)}%";
+ App.globalValues.LoadingProcess = $"{Math.Round((entry.Time % entry.EndTime) / entry.EndTime * 100, 2)}%";
}
}
diff --git a/SpineViewerWPF/PublicFunction/Player/Player_3_5_51.cs b/SpineViewerWPF/PublicFunction/Player/Player_3_5_51.cs
index d9dd65e..7d81aa1 100644
--- a/SpineViewerWPF/PublicFunction/Player/Player_3_5_51.cs
+++ b/SpineViewerWPF/PublicFunction/Player/Player_3_5_51.cs
@@ -1,13 +1,9 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Spine3_5_51;
-using SpineViewerWPF;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
-using Microsoft.Xna.Framework.Graphics;
+using Spine3_5_51;
+using SpineViewerWPF;
public class Player_3_5_51 : IPlayer
{
@@ -116,7 +112,7 @@ public void Update(GameTime gameTime)
App.graphicsDevice.Clear(Color.Transparent);
Player.DrawBG(ref App.spriteBatch);
- App.globalValues.TimeScale = (float)App.globalValues.Speed / 30f;
+ App.globalValues.TimeScale = App.globalValues.Speed / 30f;
state.Update((float)gameTime.ElapsedGameTime.TotalMilliseconds / 1000f);
@@ -159,12 +155,12 @@ public void Update(GameTime gameTime)
public void Draw()
{
-
+
if (state != null)
{
TrackEntry entry = state.GetCurrent(0);
- float speed = (float)App.globalValues.Speed / 30f;
+ float speed = App.globalValues.Speed / 30f;
if (entry != null)
{
if (App.globalValues.IsRecoding && (App.globalValues.GifList != null || App.recordImageCount > 0) && !entry.IsComplete)
@@ -200,7 +196,7 @@ public void Draw()
App.globalValues.Lock = entry.AnimationTime / entry.AnimationEnd;
entry.TimeScale = App.globalValues.TimeScale;
}
- App.globalValues.LoadingProcess = $"{ Math.Round(entry.AnimationTime / entry.AnimationEnd * 100, 2)}%";
+ App.globalValues.LoadingProcess = $"{Math.Round(entry.AnimationTime / entry.AnimationEnd * 100, 2)}%";
}
}
diff --git a/SpineViewerWPF/PublicFunction/Player/Player_3_6_32.cs b/SpineViewerWPF/PublicFunction/Player/Player_3_6_32.cs
index 7fd7c53..da9c245 100644
--- a/SpineViewerWPF/PublicFunction/Player/Player_3_6_32.cs
+++ b/SpineViewerWPF/PublicFunction/Player/Player_3_6_32.cs
@@ -1,13 +1,10 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Spine3_6_32;
-using SpineViewerWPF;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
+using Spine3_6_32;
+using SpineViewerWPF;
public class Player_3_6_32 : IPlayer
{
@@ -116,7 +113,7 @@ public void Update(GameTime gameTime)
App.graphicsDevice.Clear(Color.Transparent);
Player.DrawBG(ref App.spriteBatch);
- App.globalValues.TimeScale = (float)App.globalValues.Speed / 30f;
+ App.globalValues.TimeScale = App.globalValues.Speed / 30f;
state.Update((float)gameTime.ElapsedGameTime.TotalMilliseconds / 1000f);
@@ -167,12 +164,12 @@ public void Update(GameTime gameTime)
public void Draw()
{
-
+
if (state != null)
{
TrackEntry entry = state.GetCurrent(0);
- float speed = (float)App.globalValues.Speed / 30f;
+ float speed = App.globalValues.Speed / 30f;
if (entry != null)
{
if (App.globalValues.IsRecoding && (App.globalValues.GifList != null || App.recordImageCount > 0) && !entry.IsComplete)
@@ -208,7 +205,7 @@ public void Draw()
App.globalValues.Lock = entry.AnimationTime / entry.AnimationEnd;
entry.TimeScale = App.globalValues.TimeScale;
}
- App.globalValues.LoadingProcess = $"{ Math.Round(entry.AnimationTime / entry.AnimationEnd * 100, 2)}%";
+ App.globalValues.LoadingProcess = $"{Math.Round(entry.AnimationTime / entry.AnimationEnd * 100, 2)}%";
}
}
diff --git a/SpineViewerWPF/PublicFunction/Player/Player_3_6_39.cs b/SpineViewerWPF/PublicFunction/Player/Player_3_6_39.cs
index ccd2536..bfdc8de 100644
--- a/SpineViewerWPF/PublicFunction/Player/Player_3_6_39.cs
+++ b/SpineViewerWPF/PublicFunction/Player/Player_3_6_39.cs
@@ -1,13 +1,10 @@
using System;
-using System.Collections.Generic;
using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Spine3_6_39;
-using SpineViewerWPF;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
+using Spine3_6_39;
+using SpineViewerWPF;
public class Player_3_6_39 : IPlayer
{
@@ -101,7 +98,7 @@ public void Update(GameTime gameTime)
App.graphicsDevice.Clear(Color.Transparent);
Player.DrawBG(ref App.spriteBatch);
- App.globalValues.TimeScale = (float)App.globalValues.Speed / 30f;
+ App.globalValues.TimeScale = App.globalValues.Speed / 30f;
state.Update((float)gameTime.ElapsedGameTime.TotalMilliseconds / 1000f);
@@ -152,12 +149,12 @@ public void Update(GameTime gameTime)
public void Draw()
{
-
+
if (state != null)
{
TrackEntry entry = state.GetCurrent(0);
- float speed = (float)App.globalValues.Speed / 30f;
+ float speed = App.globalValues.Speed / 30f;
if (entry != null)
{
if (App.globalValues.IsRecoding && (App.globalValues.GifList != null || App.recordImageCount > 0) && !entry.IsComplete)
@@ -193,7 +190,7 @@ public void Draw()
App.globalValues.Lock = entry.AnimationTime / entry.AnimationEnd;
entry.TimeScale = App.globalValues.TimeScale;
}
- App.globalValues.LoadingProcess = $"{ Math.Round(entry.AnimationTime / entry.AnimationEnd * 100, 2)}%";
+ App.globalValues.LoadingProcess = $"{Math.Round(entry.AnimationTime / entry.AnimationEnd * 100, 2)}%";
}
}
diff --git a/SpineViewerWPF/PublicFunction/Player/Player_3_6_53.cs b/SpineViewerWPF/PublicFunction/Player/Player_3_6_53.cs
index da310eb..862b602 100644
--- a/SpineViewerWPF/PublicFunction/Player/Player_3_6_53.cs
+++ b/SpineViewerWPF/PublicFunction/Player/Player_3_6_53.cs
@@ -1,13 +1,10 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Spine3_6_53;
-using SpineViewerWPF;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
+using Spine3_6_53;
+using SpineViewerWPF;
public class Player_3_6_53 : IPlayer
{
@@ -116,7 +113,7 @@ public void Update(GameTime gameTime)
App.graphicsDevice.Clear(Color.Transparent);
Player.DrawBG(ref App.spriteBatch);
- App.globalValues.TimeScale = (float)((float)(App.globalValues.Speed) / 30f);
+ App.globalValues.TimeScale = (float)(App.globalValues.Speed / 30f);
state.Update((float)gameTime.ElapsedGameTime.TotalMilliseconds / 1000f);
@@ -167,12 +164,12 @@ public void Update(GameTime gameTime)
public void Draw()
{
-
+
if (state != null)
{
TrackEntry entry = state.GetCurrent(0);
- float speed = (float)App.globalValues.Speed / 30f;
+ float speed = App.globalValues.Speed / 30f;
if (entry != null)
{
if (App.globalValues.IsRecoding && (App.globalValues.GifList != null || App.recordImageCount > 0) && !entry.IsComplete)
@@ -208,7 +205,7 @@ public void Draw()
App.globalValues.Lock = entry.AnimationTime / entry.AnimationEnd;
entry.TimeScale = App.globalValues.TimeScale;
}
- App.globalValues.LoadingProcess = $"{ Math.Round(entry.AnimationTime / entry.AnimationEnd * 100, 2)}%";
+ App.globalValues.LoadingProcess = $"{Math.Round(entry.AnimationTime / entry.AnimationEnd * 100, 2)}%";
}
}
diff --git a/SpineViewerWPF/PublicFunction/Player/Player_3_7_94.cs b/SpineViewerWPF/PublicFunction/Player/Player_3_7_94.cs
index 75c9364..6e22af0 100644
--- a/SpineViewerWPF/PublicFunction/Player/Player_3_7_94.cs
+++ b/SpineViewerWPF/PublicFunction/Player/Player_3_7_94.cs
@@ -1,13 +1,10 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Spine3_7_94;
-using SpineViewerWPF;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
+using Spine3_7_94;
+using SpineViewerWPF;
public class Player_3_7_94 : IPlayer
{
@@ -25,7 +22,7 @@ public class Player_3_7_94 : IPlayer
public void Initialize()
{
Player.Initialize(ref App.graphicsDevice, ref App.spriteBatch);
-
+
}
public void LoadContent(ContentManager contentManager)
@@ -117,15 +114,15 @@ public void Update(GameTime gameTime)
App.graphicsDevice.Clear(Color.Transparent);
Player.DrawBG(ref App.spriteBatch);
- App.globalValues.TimeScale = (float)App.globalValues.Speed / 30f;
+ App.globalValues.TimeScale = App.globalValues.Speed / 30f;
- state.Update((float)gameTime.ElapsedGameTime.TotalMilliseconds/1000f);
+ state.Update((float)gameTime.ElapsedGameTime.TotalMilliseconds / 1000f);
state.Apply(skeleton);
skeleton.X = App.globalValues.PosX;
skeleton.Y = App.globalValues.PosY;
- skeleton.ScaleX = (App.globalValues.FilpX ? -1 : 1)* App.globalValues.Scale;
- skeleton.ScaleY = (App.globalValues.FilpY ? 1 : -1)* App.globalValues.Scale;
+ skeleton.ScaleX = (App.globalValues.FilpX ? -1 : 1) * App.globalValues.Scale;
+ skeleton.ScaleY = (App.globalValues.FilpY ? 1 : -1) * App.globalValues.Scale;
skeleton.RootBone.Rotation = App.globalValues.Rotation;
@@ -143,7 +140,7 @@ public void Update(GameTime gameTime)
skeletonRenderer.Draw(skeleton);
skeletonRenderer.End();
-
+
@@ -156,7 +153,7 @@ public void Draw()
{
TrackEntry entry = state.GetCurrent(0);
- float speed = (float)App.globalValues.Speed / 30f;
+ float speed = App.globalValues.Speed / 30f;
if (entry != null)
{
if (App.globalValues.IsRecoding && (App.globalValues.GifList != null || App.recordImageCount > 0) && !entry.IsComplete)
@@ -193,7 +190,7 @@ public void Draw()
App.globalValues.Lock = entry.AnimationTime / entry.AnimationEnd;
entry.TimeScale = App.globalValues.TimeScale;
}
- App.globalValues.LoadingProcess = $"{ Math.Round(entry.AnimationTime / entry.AnimationEnd * 100, 2)}%";
+ App.globalValues.LoadingProcess = $"{Math.Round(entry.AnimationTime / entry.AnimationEnd * 100, 2)}%";
}
}
@@ -209,7 +206,7 @@ public void ChangeSet()
public void SizeChange()
{
- if(App.graphicsDevice != null)
+ if (App.graphicsDevice != null)
Player.UserControl_SizeChanged(ref App.graphicsDevice);
}
diff --git a/SpineViewerWPF/PublicFunction/Player/Player_3_8_95.cs b/SpineViewerWPF/PublicFunction/Player/Player_3_8_95.cs
index 66029e9..63e09ba 100644
--- a/SpineViewerWPF/PublicFunction/Player/Player_3_8_95.cs
+++ b/SpineViewerWPF/PublicFunction/Player/Player_3_8_95.cs
@@ -1,13 +1,10 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using SpineViewerWPF;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Spine3_8_95;
+using SpineViewerWPF;
public class Player_3_8_95 : IPlayer
{
@@ -32,15 +29,15 @@ public void LoadContent(ContentManager contentManager)
skeletonRenderer = new SkeletonRenderer(App.graphicsDevice);
skeletonRenderer.PremultipliedAlpha = App.globalValues.Alpha;
- if(App.mulitTexture != null && App.mulitTexture.Length == 0)
+ if (App.mulitTexture != null && App.mulitTexture.Length == 0)
{
atlas = new Atlas(App.globalValues.SelectAtlasFile, new XnaTextureLoader(App.graphicsDevice));
}
else
{
- atlas = new Atlas(App.globalValues.SelectAtlasFile,new XnaTextureLoader(App.graphicsDevice,true,App.mulitTexture));
+ atlas = new Atlas(App.globalValues.SelectAtlasFile, new XnaTextureLoader(App.graphicsDevice, true, App.mulitTexture));
}
-
+
if (Common.IsBinaryData(App.globalValues.SelectSpineFile))
{
@@ -58,7 +55,7 @@ public void LoadContent(ContentManager contentManager)
skeleton = new Skeleton(skeletonData);
-
+
Common.SetInitLocation(skeleton.Data.Height);
App.globalValues.FileHash = skeleton.Data.Hash;
@@ -94,8 +91,8 @@ public void LoadContent(ContentManager contentManager)
if (App.isNew)
{
- App.globalValues.PosX = (float)App.canvasWidth/2;
- App.globalValues.PosY = (float)App.canvasHeight/2;
+ App.globalValues.PosX = (float)App.canvasWidth / 2;
+ App.globalValues.PosY = (float)App.canvasHeight / 2;
MainWindow.SetCBAnimeName();
}
App.isNew = false;
@@ -136,7 +133,7 @@ public void Draw()
Player.DrawBG(ref App.spriteBatch);
-
+
state.Update(App.globalValues.Speed / 1000f);
state.Apply(skeleton);
state.TimeScale = App.globalValues.TimeScale;
@@ -161,8 +158,8 @@ public void Draw()
skeleton.X = App.globalValues.PosX;
skeleton.Y = App.globalValues.PosY;
- skeleton.ScaleX = (App.globalValues.FilpX ? -1 : 1) ;
- skeleton.ScaleY = (App.globalValues.FilpY ? -1 : 1) ;
+ skeleton.ScaleX = (App.globalValues.FilpX ? -1 : 1);
+ skeleton.ScaleY = (App.globalValues.FilpY ? -1 : 1);
skeleton.RootBone.Rotation = App.globalValues.Rotation;
@@ -185,7 +182,7 @@ public void Draw()
TrackEntry entry = state.GetCurrent(0);
if (entry != null)
{
- if (App.globalValues.IsRecoding && (App.globalValues.GifList != null || App.recordImageCount >0 ) && !entry.IsComplete)
+ if (App.globalValues.IsRecoding && (App.globalValues.GifList != null || App.recordImageCount > 0) && !entry.IsComplete)
{
if (App.recordImageCount == 1)
{
@@ -218,7 +215,7 @@ public void Draw()
App.globalValues.Lock = entry.AnimationTime / entry.AnimationEnd;
entry.TimeScale = 1;
}
- App.globalValues.LoadingProcess = $"{ Math.Round(entry.AnimationTime / entry.AnimationEnd * 100, 2)}%";
+ App.globalValues.LoadingProcess = $"{Math.Round(entry.AnimationTime / entry.AnimationEnd * 100, 2)}%";
}
}
diff --git a/SpineViewerWPF/PublicFunction/Player/Player_4_0_31.cs b/SpineViewerWPF/PublicFunction/Player/Player_4_0_31.cs
index 20cb2a7..05fdf7a 100644
--- a/SpineViewerWPF/PublicFunction/Player/Player_4_0_31.cs
+++ b/SpineViewerWPF/PublicFunction/Player/Player_4_0_31.cs
@@ -1,13 +1,10 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using SpineViewerWPF;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Spine4_0_31;
+using SpineViewerWPF;
public class Player_4_0_31 : IPlayer
{
@@ -57,7 +54,7 @@ public void LoadContent(ContentManager contentManager)
skeleton = new Skeleton(skeletonData);
-
+
Common.SetInitLocation(skeleton.Data.Height);
App.globalValues.FileHash = skeleton.Data.Hash;
@@ -93,8 +90,8 @@ public void LoadContent(ContentManager contentManager)
if (App.isNew)
{
- App.globalValues.PosX = (float)App.canvasWidth/2;
- App.globalValues.PosY = (float)App.canvasHeight/2;
+ App.globalValues.PosX = (float)App.canvasWidth / 2;
+ App.globalValues.PosY = (float)App.canvasHeight / 2;
MainWindow.SetCBAnimeName();
}
App.isNew = false;
@@ -135,7 +132,7 @@ public void Draw()
Player.DrawBG(ref App.spriteBatch);
-
+
state.Update(App.globalValues.Speed / 1000f);
state.Apply(skeleton);
state.TimeScale = App.globalValues.TimeScale;
@@ -160,8 +157,8 @@ public void Draw()
skeleton.X = App.globalValues.PosX;
skeleton.Y = App.globalValues.PosY;
- skeleton.ScaleX = (App.globalValues.FilpX ? -1 : 1) ;
- skeleton.ScaleY = (App.globalValues.FilpY ? -1 : 1) ;
+ skeleton.ScaleX = (App.globalValues.FilpX ? -1 : 1);
+ skeleton.ScaleY = (App.globalValues.FilpY ? -1 : 1);
skeleton.RootBone.Rotation = App.globalValues.Rotation;
@@ -184,7 +181,7 @@ public void Draw()
TrackEntry entry = state.GetCurrent(0);
if (entry != null)
{
- if (App.globalValues.IsRecoding && (App.globalValues.GifList != null || App.recordImageCount >0 ) && !entry.IsComplete)
+ if (App.globalValues.IsRecoding && (App.globalValues.GifList != null || App.recordImageCount > 0) && !entry.IsComplete)
{
if (App.recordImageCount == 1)
{
@@ -217,7 +214,7 @@ public void Draw()
App.globalValues.Lock = entry.AnimationTime / entry.AnimationEnd;
entry.TimeScale = 1;
}
- App.globalValues.LoadingProcess = $"{ Math.Round(entry.AnimationTime / entry.AnimationEnd * 100, 2)}%";
+ App.globalValues.LoadingProcess = $"{Math.Round(entry.AnimationTime / entry.AnimationEnd * 100, 2)}%";
}
}
diff --git a/SpineViewerWPF/PublicFunction/Player/Player_4_0_64.cs b/SpineViewerWPF/PublicFunction/Player/Player_4_0_64.cs
index c2c87ec..d0e27a5 100644
--- a/SpineViewerWPF/PublicFunction/Player/Player_4_0_64.cs
+++ b/SpineViewerWPF/PublicFunction/Player/Player_4_0_64.cs
@@ -1,13 +1,10 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using SpineViewerWPF;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Spine4_0_64;
+using SpineViewerWPF;
public class Player_4_0_64 : IPlayer
{
@@ -57,7 +54,7 @@ public void LoadContent(ContentManager contentManager)
skeleton = new Skeleton(skeletonData);
-
+
Common.SetInitLocation(skeleton.Data.Height);
App.globalValues.FileHash = skeleton.Data.Hash;
@@ -93,8 +90,8 @@ public void LoadContent(ContentManager contentManager)
if (App.isNew)
{
- App.globalValues.PosX = (float)App.canvasWidth/2;
- App.globalValues.PosY = (float)App.canvasHeight/2;
+ App.globalValues.PosX = (float)App.canvasWidth / 2;
+ App.globalValues.PosY = (float)App.canvasHeight / 2;
MainWindow.SetCBAnimeName();
}
App.isNew = false;
@@ -135,7 +132,7 @@ public void Draw()
Player.DrawBG(ref App.spriteBatch);
-
+
state.Update(App.globalValues.Speed / 1000f);
state.Apply(skeleton);
state.TimeScale = App.globalValues.TimeScale;
@@ -160,8 +157,8 @@ public void Draw()
skeleton.X = App.globalValues.PosX;
skeleton.Y = App.globalValues.PosY;
- skeleton.ScaleX = (App.globalValues.FilpX ? -1 : 1) ;
- skeleton.ScaleY = (App.globalValues.FilpY ? -1 : 1) ;
+ skeleton.ScaleX = (App.globalValues.FilpX ? -1 : 1);
+ skeleton.ScaleY = (App.globalValues.FilpY ? -1 : 1);
skeleton.RootBone.Rotation = App.globalValues.Rotation;
@@ -184,7 +181,7 @@ public void Draw()
TrackEntry entry = state.GetCurrent(0);
if (entry != null)
{
- if (App.globalValues.IsRecoding && (App.globalValues.GifList != null || App.recordImageCount >0 ) && !entry.IsComplete)
+ if (App.globalValues.IsRecoding && (App.globalValues.GifList != null || App.recordImageCount > 0) && !entry.IsComplete)
{
if (App.recordImageCount == 1)
{
@@ -217,7 +214,7 @@ public void Draw()
App.globalValues.Lock = entry.AnimationTime / entry.AnimationEnd;
entry.TimeScale = 1;
}
- App.globalValues.LoadingProcess = $"{ Math.Round(entry.AnimationTime / entry.AnimationEnd * 100, 2)}%";
+ App.globalValues.LoadingProcess = $"{Math.Round(entry.AnimationTime / entry.AnimationEnd * 100, 2)}%";
}
}
diff --git a/SpineViewerWPF/PublicFunction/Player/Player_4_1_00.cs b/SpineViewerWPF/PublicFunction/Player/Player_4_1_00.cs
index 2820c15..d510ce8 100644
--- a/SpineViewerWPF/PublicFunction/Player/Player_4_1_00.cs
+++ b/SpineViewerWPF/PublicFunction/Player/Player_4_1_00.cs
@@ -1,13 +1,10 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using SpineViewerWPF;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Spine4_1_00;
+using SpineViewerWPF;
public class Player_4_1_00 : IPlayer
{
@@ -57,7 +54,7 @@ public void LoadContent(ContentManager contentManager)
skeleton = new Skeleton(skeletonData);
-
+
Common.SetInitLocation(skeleton.Data.Height);
App.globalValues.FileHash = skeleton.Data.Hash;
@@ -93,8 +90,8 @@ public void LoadContent(ContentManager contentManager)
if (App.isNew)
{
- App.globalValues.PosX = (float)App.canvasWidth/2;
- App.globalValues.PosY = (float)App.canvasHeight/2;
+ App.globalValues.PosX = (float)App.canvasWidth / 2;
+ App.globalValues.PosY = (float)App.canvasHeight / 2;
MainWindow.SetCBAnimeName();
}
App.isNew = false;
@@ -135,7 +132,7 @@ public void Draw()
Player.DrawBG(ref App.spriteBatch);
-
+
state.Update(App.globalValues.Speed / 1000f);
state.Apply(skeleton);
state.TimeScale = App.globalValues.TimeScale;
@@ -160,8 +157,8 @@ public void Draw()
skeleton.X = App.globalValues.PosX;
skeleton.Y = App.globalValues.PosY;
- skeleton.ScaleX = (App.globalValues.FilpX ? -1 : 1) ;
- skeleton.ScaleY = (App.globalValues.FilpY ? -1 : 1) ;
+ skeleton.ScaleX = (App.globalValues.FilpX ? -1 : 1);
+ skeleton.ScaleY = (App.globalValues.FilpY ? -1 : 1);
skeleton.RootBone.Rotation = App.globalValues.Rotation;
@@ -184,7 +181,7 @@ public void Draw()
TrackEntry entry = state.GetCurrent(0);
if (entry != null)
{
- if (App.globalValues.IsRecoding && (App.globalValues.GifList != null || App.recordImageCount >0 ) && !entry.IsComplete)
+ if (App.globalValues.IsRecoding && (App.globalValues.GifList != null || App.recordImageCount > 0) && !entry.IsComplete)
{
if (App.recordImageCount == 1)
{
@@ -217,7 +214,7 @@ public void Draw()
App.globalValues.Lock = entry.AnimationTime / entry.AnimationEnd;
entry.TimeScale = 1;
}
- App.globalValues.LoadingProcess = $"{ Math.Round(entry.AnimationTime / entry.AnimationEnd * 100, 2)}%";
+ App.globalValues.LoadingProcess = $"{Math.Round(entry.AnimationTime / entry.AnimationEnd * 100, 2)}%";
}
}
diff --git a/SpineViewerWPF/PublicFunction/Player/Player_4_2_33.cs b/SpineViewerWPF/PublicFunction/Player/Player_4_2_33.cs
new file mode 100644
index 0000000..795e09b
--- /dev/null
+++ b/SpineViewerWPF/PublicFunction/Player/Player_4_2_33.cs
@@ -0,0 +1,249 @@
+using System;
+using System.Collections.Generic;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Content;
+using Microsoft.Xna.Framework.Graphics;
+using Spine4_2_33;
+using SpineViewerWPF;
+
+public class Player_4_2_33 : IPlayer
+{
+ private Skeleton skeleton;
+ private AnimationState state;
+ private SkeletonRenderer skeletonRenderer;
+ private ExposedList listAnimation;
+ private ExposedList listSkin;
+ private Atlas atlas;
+ private SkeletonData skeletonData;
+ private AnimationStateData stateData;
+ private SkeletonBinary binary;
+ private SkeletonJson json;
+
+ public void Initialize()
+ {
+ Player.Initialize(ref App.graphicsDevice, ref App.spriteBatch);
+ }
+
+ public void LoadContent(ContentManager contentManager)
+ {
+ skeletonRenderer = new SkeletonRenderer(App.graphicsDevice)
+ {
+ PremultipliedAlpha = App.globalValues.Alpha
+ };
+
+ if (App.mulitTexture != null && App.mulitTexture.Length == 0)
+ {
+ atlas = new Atlas(App.globalValues.SelectAtlasFile, new XnaTextureLoader(App.graphicsDevice));
+ }
+ else
+ {
+ atlas = new Atlas(App.globalValues.SelectAtlasFile, new XnaTextureLoader(App.graphicsDevice, true, App.mulitTexture));
+ }
+
+ if (Common.IsBinaryData(App.globalValues.SelectSpineFile))
+ {
+ binary = new SkeletonBinary(atlas)
+ {
+ Scale = App.globalValues.Scale
+ };
+ skeletonData = binary.ReadSkeletonData(App.globalValues.SelectSpineFile);
+ }
+ else
+ {
+ json = new SkeletonJson(atlas)
+ {
+ Scale = App.globalValues.Scale
+ };
+ skeletonData = json.ReadSkeletonData(App.globalValues.SelectSpineFile);
+ }
+ App.globalValues.SpineVersion = skeletonData.Version;
+ skeleton = new Skeleton(skeletonData);
+
+
+
+
+ Common.SetInitLocation(skeleton.Data.Height);
+ App.globalValues.FileHash = skeleton.Data.Hash;
+
+ stateData = new AnimationStateData(skeleton.Data);
+
+ state = new AnimationState(stateData);
+
+ List AnimationNames = [];
+ listAnimation = state.Data.skeletonData.Animations;
+ foreach (Animation An in listAnimation)
+ {
+ AnimationNames.Add(An.name);
+ }
+ App.globalValues.AnimeList = AnimationNames;
+
+ List SkinNames = [];
+ listSkin = state.Data.skeletonData.Skins;
+ foreach (Skin Sk in listSkin)
+ {
+ SkinNames.Add(Sk.name);
+ }
+ App.globalValues.SkinList = SkinNames;
+
+ if (App.globalValues.SelectAnimeName != "")
+ {
+ state.SetAnimation(0, App.globalValues.SelectAnimeName, App.globalValues.IsLoop);
+ }
+ else
+ {
+ state.SetAnimation(0, state.Data.skeletonData.animations.Items[0].name, App.globalValues.IsLoop);
+ }
+
+ if (App.isNew)
+ {
+ App.globalValues.PosX = (float)App.canvasWidth / 2;
+ App.globalValues.PosY = (float)App.canvasHeight / 2;
+ MainWindow.SetCBAnimeName();
+ }
+ App.isNew = false;
+
+ }
+
+
+
+ public void Update(GameTime gameTime)
+ {
+ if (App.globalValues.SelectAnimeName != "" && App.globalValues.SetAnime)
+ {
+ state.ClearTracks();
+ skeleton.SetToSetupPose();
+ state.SetAnimation(0, App.globalValues.SelectAnimeName, App.globalValues.IsLoop);
+ App.globalValues.SetAnime = false;
+ }
+
+ if (App.globalValues.SelectSkin != "" && App.globalValues.SetSkin)
+ {
+ skeleton.SetSkin(App.globalValues.SelectSkin);
+ skeleton.SetSlotsToSetupPose();
+ App.globalValues.SetSkin = false;
+ }
+
+
+ }
+
+ public void Draw()
+ {
+ if (App.globalValues.SelectSpineVersion != "4.2.33" || App.globalValues.FileHash != skeleton.Data.Hash)
+ {
+ state = null;
+ skeletonRenderer = null;
+ return;
+ }
+ App.graphicsDevice.Clear(Color.Transparent);
+
+ Player.DrawBG(ref App.spriteBatch);
+
+
+ state.Update(App.globalValues.Speed / 1000f);
+ state.Apply(skeleton);
+ state.TimeScale = App.globalValues.TimeScale;
+ if (binary != null)
+ {
+ if (App.globalValues.Scale != binary.Scale)
+ {
+ binary.Scale = App.globalValues.Scale;
+ skeletonData = binary.ReadSkeletonData(App.globalValues.SelectSpineFile);
+ skeleton = new Skeleton(skeletonData);
+ }
+ }
+ else if (json != null)
+ {
+ if (App.globalValues.Scale != json.Scale)
+ {
+ json.Scale = App.globalValues.Scale;
+ skeletonData = json.ReadSkeletonData(App.globalValues.SelectSpineFile);
+ skeleton = new Skeleton(skeletonData);
+ }
+ }
+
+ skeleton.X = App.globalValues.PosX;
+ skeleton.Y = App.globalValues.PosY;
+ skeleton.ScaleX = (App.globalValues.FilpX ? -1 : 1);
+ skeleton.ScaleY = (App.globalValues.FilpY ? -1 : 1);
+
+
+ skeleton.RootBone.Rotation = App.globalValues.Rotation;
+ skeleton.UpdateWorldTransform(Skeleton.Physics.Update);
+ skeletonRenderer.PremultipliedAlpha = App.globalValues.Alpha;
+ if (skeletonRenderer.Effect is BasicEffect basicEffect)
+ {
+ basicEffect.Projection = Matrix.CreateOrthographicOffCenter(0, App.graphicsDevice.Viewport.Width, App.graphicsDevice.Viewport.Height, 0, 1, 0);
+ }
+ else
+ {
+ skeletonRenderer.Effect.Parameters["Projection"].SetValue(Matrix.CreateOrthographicOffCenter(0, App.graphicsDevice.Viewport.Width, App.graphicsDevice.Viewport.Height, 0, 1, 0));
+ }
+ skeletonRenderer.Begin();
+ skeletonRenderer.Draw(skeleton);
+ skeletonRenderer.End();
+
+ if (state != null)
+ {
+ TrackEntry entry = state.GetCurrent(0);
+ if (entry != null)
+ {
+ if (App.globalValues.IsRecoding && (App.globalValues.GifList != null || App.recordImageCount > 0) && !entry.IsComplete)
+ {
+ if (App.recordImageCount == 1)
+ {
+ TrackEntry te = state.GetCurrent(0);
+ te.trackTime = 0;
+ App.globalValues.TimeScale = 1;
+ App.globalValues.Lock = 0;
+ }
+
+ Common.TakeRecodeScreenshot(App.graphicsDevice);
+ }
+
+ if (App.globalValues.IsRecoding && entry.IsComplete)
+ {
+ state.TimeScale = 0;
+ App.globalValues.IsRecoding = false;
+ Common.RecodingEnd(entry.AnimationEnd);
+
+ state.TimeScale = 1;
+ App.globalValues.TimeScale = 1;
+ }
+
+ if (App.globalValues.TimeScale == 0)
+ {
+ entry.TrackTime = entry.AnimationEnd * App.globalValues.Lock;
+ entry.TimeScale = 0;
+ }
+ else
+ {
+ App.globalValues.Lock = entry.AnimationTime / entry.AnimationEnd;
+ entry.TimeScale = 1;
+ }
+ App.globalValues.LoadingProcess = $"{Math.Round(entry.AnimationTime / entry.AnimationEnd * 100, 2)}%";
+ }
+ }
+
+
+ }
+
+ public void ChangeSet()
+ {
+ App.appXC.ContentManager.Dispose();
+ atlas.Dispose();
+ atlas = null;
+ App.appXC.LoadContent.Invoke(App.appXC.ContentManager);
+ }
+
+ public void SizeChange()
+ {
+ if (App.graphicsDevice != null)
+ Player.UserControl_SizeChanged(ref App.graphicsDevice);
+ }
+
+ public void Dispose()
+ {
+ ChangeSet();
+ }
+}
+
diff --git a/SpineViewerWPF/PublicFunction/XnaLoader/Util.cs b/SpineViewerWPF/PublicFunction/XnaLoader/Util.cs
index 63fdf5d..2880369 100644
--- a/SpineViewerWPF/PublicFunction/XnaLoader/Util.cs
+++ b/SpineViewerWPF/PublicFunction/XnaLoader/Util.cs
@@ -1,11 +1,11 @@
using System;
using System.IO;
-using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using SpineViewerWPF;
- public static class Util {
+public static class Util
+{
#if WINDOWS_STOREAPP
private static async Task LoadFile(GraphicsDevice device, String path) {
var folder = Windows.ApplicationModel.Package.Current.InstalledLocation;
@@ -21,27 +21,33 @@ static public Texture2D LoadTexture (GraphicsDevice device, String path) {
return LoadFile(device, path).Result;
}
#else
- static public Texture2D LoadTexture (GraphicsDevice device, String path) {
+ static public Texture2D LoadTexture(GraphicsDevice device, String path)
+ {
#if WINDOWS_PHONE
Stream stream = Microsoft.Xna.Framework.TitleContainer.OpenStream(path);
using (Stream input = stream)
{
#else
- using (Stream input = new FileStream(path, FileMode.Open, FileAccess.Read)) {
+ using (Stream input = new FileStream(path, FileMode.Open, FileAccess.Read))
+ {
#endif
- try {
- return Util.LoadTexture(device, input);
- } catch (Exception ex) {
- throw new Exception("Error reading texture file: " + path, ex);
- }
- }
- }
+ try
+ {
+ return Util.LoadTexture(device, input);
+ }
+ catch (Exception ex)
+ {
+ throw new Exception("Error reading texture file: " + path, ex);
+ }
+ }
+ }
#endif
- static public Texture2D LoadTexture (GraphicsDevice device, Stream input) {
- NewTextureLoader ntl = new NewTextureLoader(device);
- return ntl.FromStreamFast(input, App.globalValues.PreMultiplyAlpha);
- }
- }
+ static public Texture2D LoadTexture(GraphicsDevice device, Stream input)
+ {
+ NewTextureLoader ntl = new NewTextureLoader(device);
+ return ntl.FromStreamFast(input, App.globalValues.PreMultiplyAlpha);
+ }
+}
diff --git a/SpineViewerWPF/Resources/WpfXnaControl.dll b/SpineViewerWPF/Resources/WpfXnaControl.dll
new file mode 100644
index 0000000..b106933
Binary files /dev/null and b/SpineViewerWPF/Resources/WpfXnaControl.dll differ
diff --git a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Animation.cs b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Animation.cs
index 2716936..5bbff1e 100644
--- a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Animation.cs
+++ b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Animation.cs
@@ -31,690 +31,790 @@
using System;
using System.Collections.Generic;
-namespace Spine2_1_08 {
- public class Animation {
- internal List timelines;
- internal float duration;
- internal String name;
-
- public String Name { get { return name; } }
- public List Timelines { get { return timelines; } set { timelines = value; } }
- public float Duration { get { return duration; } set { duration = value; } }
-
- public Animation (String name, List timelines, float duration) {
- if (name == null) throw new ArgumentNullException("name cannot be null.");
- if (timelines == null) throw new ArgumentNullException("timelines cannot be null.");
- this.name = name;
- this.timelines = timelines;
- this.duration = duration;
- }
-
- /// Poses the skeleton at the specified time for this animation.
- /// The last time the animation was applied.
- /// Any triggered events are added.
- public void Apply (Skeleton skeleton, float lastTime, float time, bool loop, List events) {
- if (skeleton == null) throw new ArgumentNullException("skeleton cannot be null.");
-
- if (loop && duration != 0) {
- time %= duration;
- lastTime %= duration;
- }
-
- List timelines = this.timelines;
- for (int i = 0, n = timelines.Count; i < n; i++)
- timelines[i].Apply(skeleton, lastTime, time, events, 1);
- }
-
- /// Poses the skeleton at the specified time for this animation mixed with the current pose.
- /// The last time the animation was applied.
- /// Any triggered events are added.
- /// The amount of this animation that affects the current pose.
- public void Mix (Skeleton skeleton, float lastTime, float time, bool loop, List events, float alpha) {
- if (skeleton == null) throw new ArgumentNullException("skeleton cannot be null.");
-
- if (loop && duration != 0) {
- time %= duration;
- lastTime %= duration;
- }
-
- List timelines = this.timelines;
- for (int i = 0, n = timelines.Count; i < n; i++)
- timelines[i].Apply(skeleton, lastTime, time, events, alpha);
- }
-
- /// After the first and before the last entry.
- internal static int binarySearch (float[] values, float target, int step) {
- int low = 0;
- int high = values.Length / step - 2;
- if (high == 0) return step;
- int current = (int)((uint)high >> 1);
- while (true) {
- if (values[(current + 1) * step] <= target)
- low = current + 1;
- else
- high = current;
- if (low == high) return (low + 1) * step;
- current = (int)((uint)(low + high) >> 1);
- }
- }
-
- /// After the first and before the last entry.
- internal static int binarySearch (float[] values, float target) {
- int low = 0;
- int high = values.Length - 2;
- if (high == 0) return 1;
- int current = (int)((uint)high >> 1);
- while (true) {
- if (values[(current + 1)] <= target)
- low = current + 1;
- else
- high = current;
- if (low == high) return (low + 1);
- current = (int)((uint)(low + high) >> 1);
- }
- }
-
- internal static int linearSearch (float[] values, float target, int step) {
- for (int i = 0, last = values.Length - step; i <= last; i += step)
- if (values[i] > target) return i;
- return -1;
- }
- }
-
- public interface Timeline {
- /// Sets the value(s) for the specified time.
- /// May be null to not collect fired events.
- void Apply (Skeleton skeleton, float lastTime, float time, List events, float alpha);
- }
-
- /// Base class for frames that use an interpolation bezier curve.
- abstract public class CurveTimeline : Timeline {
- protected const float LINEAR = 0, STEPPED = 1, BEZIER = 2;
- protected const int BEZIER_SEGMENTS = 10, BEZIER_SIZE = BEZIER_SEGMENTS * 2 - 1;
-
- private float[] curves; // type, x, y, ...
- public int FrameCount { get { return curves.Length / BEZIER_SIZE + 1; } }
-
- public CurveTimeline (int frameCount) {
- curves = new float[(frameCount - 1) * BEZIER_SIZE];
- }
-
- abstract public void Apply (Skeleton skeleton, float lastTime, float time, List firedEvents, float alpha);
-
- public void SetLinear (int frameIndex) {
- curves[frameIndex * BEZIER_SIZE] = LINEAR;
- }
-
- public void SetStepped (int frameIndex) {
- curves[frameIndex * BEZIER_SIZE] = STEPPED;
- }
-
- /// Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next.
- /// cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of
- /// the difference between the keyframe's values.
- public void SetCurve (int frameIndex, float cx1, float cy1, float cx2, float cy2) {
- float subdiv1 = 1f / BEZIER_SEGMENTS, subdiv2 = subdiv1 * subdiv1, subdiv3 = subdiv2 * subdiv1;
- float pre1 = 3 * subdiv1, pre2 = 3 * subdiv2, pre4 = 6 * subdiv2, pre5 = 6 * subdiv3;
- float tmp1x = -cx1 * 2 + cx2, tmp1y = -cy1 * 2 + cy2, tmp2x = (cx1 - cx2) * 3 + 1, tmp2y = (cy1 - cy2) * 3 + 1;
- float dfx = cx1 * pre1 + tmp1x * pre2 + tmp2x * subdiv3, dfy = cy1 * pre1 + tmp1y * pre2 + tmp2y * subdiv3;
- float ddfx = tmp1x * pre4 + tmp2x * pre5, ddfy = tmp1y * pre4 + tmp2y * pre5;
- float dddfx = tmp2x * pre5, dddfy = tmp2y * pre5;
-
- int i = frameIndex * BEZIER_SIZE;
- float[] curves = this.curves;
- curves[i++] = BEZIER;
-
- float x = dfx, y = dfy;
- for (int n = i + BEZIER_SIZE - 1; i < n; i += 2) {
- curves[i] = x;
- curves[i + 1] = y;
- dfx += ddfx;
- dfy += ddfy;
- ddfx += dddfx;
- ddfy += dddfy;
- x += dfx;
- y += dfy;
- }
- }
-
- public float GetCurvePercent (int frameIndex, float percent) {
- float[] curves = this.curves;
- int i = frameIndex * BEZIER_SIZE;
- float type = curves[i];
- if (type == LINEAR) return percent;
- if (type == STEPPED) return 0;
- i++;
- float x = 0;
- for (int start = i, n = i + BEZIER_SIZE - 1; i < n; i += 2) {
- x = curves[i];
- if (x >= percent) {
- float prevX, prevY;
- if (i == start) {
- prevX = 0;
- prevY = 0;
- } else {
- prevX = curves[i - 2];
- prevY = curves[i - 1];
- }
- return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX);
- }
- }
- float y = curves[i - 1];
- return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1.
- }
- }
-
- public class RotateTimeline : CurveTimeline {
- protected const int PREV_FRAME_TIME = -2;
- protected const int FRAME_VALUE = 1;
-
- internal int boneIndex;
- internal float[] frames;
-
- public int BoneIndex { get { return boneIndex; } set { boneIndex = value; } }
- public float[] Frames { get { return frames; } set { frames = value; } } // time, value, ...
-
- public RotateTimeline (int frameCount)
- : base(frameCount) {
- frames = new float[frameCount << 1];
- }
-
- /// Sets the time and value of the specified keyframe.
- public void SetFrame (int frameIndex, float time, float angle) {
- frameIndex *= 2;
- frames[frameIndex] = time;
- frames[frameIndex + 1] = angle;
- }
-
- override public void Apply (Skeleton skeleton, float lastTime, float time, List firedEvents, float alpha) {
- float[] frames = this.frames;
- if (time < frames[0]) return; // Time is before first frame.
-
- Bone bone = skeleton.bones[boneIndex];
-
- float amount;
-
- if (time >= frames[frames.Length - 2]) { // Time is after last frame.
- amount = bone.data.rotation + frames[frames.Length - 1] - bone.rotation;
- while (amount > 180)
- amount -= 360;
- while (amount < -180)
- amount += 360;
- bone.rotation += amount * alpha;
- return;
- }
-
- // Interpolate between the previous frame and the current frame.
- int frameIndex = Animation.binarySearch(frames, time, 2);
- float prevFrameValue = frames[frameIndex - 1];
- float frameTime = frames[frameIndex];
- float percent = 1 - (time - frameTime) / (frames[frameIndex + PREV_FRAME_TIME] - frameTime);
- percent = GetCurvePercent((frameIndex >> 1) - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent));
-
- amount = frames[frameIndex + FRAME_VALUE] - prevFrameValue;
- while (amount > 180)
- amount -= 360;
- while (amount < -180)
- amount += 360;
- amount = bone.data.rotation + (prevFrameValue + amount * percent) - bone.rotation;
- while (amount > 180)
- amount -= 360;
- while (amount < -180)
- amount += 360;
- bone.rotation += amount * alpha;
- }
- }
-
- public class TranslateTimeline : CurveTimeline {
- protected const int PREV_FRAME_TIME = -3;
- protected const int FRAME_X = 1;
- protected const int FRAME_Y = 2;
-
- internal int boneIndex;
- internal float[] frames;
-
- public int BoneIndex { get { return boneIndex; } set { boneIndex = value; } }
- public float[] Frames { get { return frames; } set { frames = value; } } // time, value, value, ...
-
- public TranslateTimeline (int frameCount)
- : base(frameCount) {
- frames = new float[frameCount * 3];
- }
-
- /// Sets the time and value of the specified keyframe.
- public void SetFrame (int frameIndex, float time, float x, float y) {
- frameIndex *= 3;
- frames[frameIndex] = time;
- frames[frameIndex + 1] = x;
- frames[frameIndex + 2] = y;
- }
-
- override public void Apply (Skeleton skeleton, float lastTime, float time, List firedEvents, float alpha) {
- float[] frames = this.frames;
- if (time < frames[0]) return; // Time is before first frame.
-
- Bone bone = skeleton.bones[boneIndex];
-
- if (time >= frames[frames.Length - 3]) { // Time is after last frame.
- bone.x += (bone.data.x + frames[frames.Length - 2] - bone.x) * alpha;
- bone.y += (bone.data.y + frames[frames.Length - 1] - bone.y) * alpha;
- return;
- }
-
- // Interpolate between the previous frame and the current frame.
- int frameIndex = Animation.binarySearch(frames, time, 3);
- float prevFrameX = frames[frameIndex - 2];
- float prevFrameY = frames[frameIndex - 1];
- float frameTime = frames[frameIndex];
- float percent = 1 - (time - frameTime) / (frames[frameIndex + PREV_FRAME_TIME] - frameTime);
- percent = GetCurvePercent(frameIndex / 3 - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent));
-
- bone.x += (bone.data.x + prevFrameX + (frames[frameIndex + FRAME_X] - prevFrameX) * percent - bone.x) * alpha;
- bone.y += (bone.data.y + prevFrameY + (frames[frameIndex + FRAME_Y] - prevFrameY) * percent - bone.y) * alpha;
- }
- }
-
- public class ScaleTimeline : TranslateTimeline {
- public ScaleTimeline (int frameCount)
- : base(frameCount) {
- }
-
- override public void Apply (Skeleton skeleton, float lastTime, float time, List firedEvents, float alpha) {
- float[] frames = this.frames;
- if (time < frames[0]) return; // Time is before first frame.
-
- Bone bone = skeleton.bones[boneIndex];
- if (time >= frames[frames.Length - 3]) { // Time is after last frame.
- bone.scaleX += (bone.data.scaleX * frames[frames.Length - 2] - bone.scaleX) * alpha;
- bone.scaleY += (bone.data.scaleY * frames[frames.Length - 1] - bone.scaleY) * alpha;
- return;
- }
-
- // Interpolate between the previous frame and the current frame.
- int frameIndex = Animation.binarySearch(frames, time, 3);
- float prevFrameX = frames[frameIndex - 2];
- float prevFrameY = frames[frameIndex - 1];
- float frameTime = frames[frameIndex];
- float percent = 1 - (time - frameTime) / (frames[frameIndex + PREV_FRAME_TIME] - frameTime);
- percent = GetCurvePercent(frameIndex / 3 - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent));
-
- bone.scaleX += (bone.data.scaleX * (prevFrameX + (frames[frameIndex + FRAME_X] - prevFrameX) * percent) - bone.scaleX) * alpha;
- bone.scaleY += (bone.data.scaleY * (prevFrameY + (frames[frameIndex + FRAME_Y] - prevFrameY) * percent) - bone.scaleY) * alpha;
- }
- }
-
- public class ColorTimeline : CurveTimeline {
- protected const int PREV_FRAME_TIME = -5;
- protected const int FRAME_R = 1;
- protected const int FRAME_G = 2;
- protected const int FRAME_B = 3;
- protected const int FRAME_A = 4;
-
- internal int slotIndex;
- internal float[] frames;
-
- public int SlotIndex { get { return slotIndex; } set { slotIndex = value; } }
- public float[] Frames { get { return frames; } set { frames = value; } } // time, r, g, b, a, ...
-
- public ColorTimeline (int frameCount)
- : base(frameCount) {
- frames = new float[frameCount * 5];
- }
-
- /// Sets the time and value of the specified keyframe.
- public void setFrame (int frameIndex, float time, float r, float g, float b, float a) {
- frameIndex *= 5;
- frames[frameIndex] = time;
- frames[frameIndex + 1] = r;
- frames[frameIndex + 2] = g;
- frames[frameIndex + 3] = b;
- frames[frameIndex + 4] = a;
- }
-
- override public void Apply (Skeleton skeleton, float lastTime, float time, List firedEvents, float alpha) {
- float[] frames = this.frames;
- if (time < frames[0]) return; // Time is before first frame.
-
- float r, g, b, a;
- if (time >= frames[frames.Length - 5]) {
- // Time is after last frame.
- int i = frames.Length - 1;
- r = frames[i - 3];
- g = frames[i - 2];
- b = frames[i - 1];
- a = frames[i];
- } else {
- // Interpolate between the previous frame and the current frame.
- int frameIndex = Animation.binarySearch(frames, time, 5);
- float prevFrameR = frames[frameIndex - 4];
- float prevFrameG = frames[frameIndex - 3];
- float prevFrameB = frames[frameIndex - 2];
- float prevFrameA = frames[frameIndex - 1];
- float frameTime = frames[frameIndex];
- float percent = 1 - (time - frameTime) / (frames[frameIndex + PREV_FRAME_TIME] - frameTime);
- percent = GetCurvePercent(frameIndex / 5 - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent));
-
- r = prevFrameR + (frames[frameIndex + FRAME_R] - prevFrameR) * percent;
- g = prevFrameG + (frames[frameIndex + FRAME_G] - prevFrameG) * percent;
- b = prevFrameB + (frames[frameIndex + FRAME_B] - prevFrameB) * percent;
- a = prevFrameA + (frames[frameIndex + FRAME_A] - prevFrameA) * percent;
- }
- Slot slot = skeleton.slots[slotIndex];
- if (alpha < 1) {
- slot.r += (r - slot.r) * alpha;
- slot.g += (g - slot.g) * alpha;
- slot.b += (b - slot.b) * alpha;
- slot.a += (a - slot.a) * alpha;
- } else {
- slot.r = r;
- slot.g = g;
- slot.b = b;
- slot.a = a;
- }
- }
- }
-
- public class AttachmentTimeline : Timeline {
- internal int slotIndex;
- internal float[] frames;
- private String[] attachmentNames;
-
- public int SlotIndex { get { return slotIndex; } set { slotIndex = value; } }
- public float[] Frames { get { return frames; } set { frames = value; } } // time, ...
- public String[] AttachmentNames { get { return attachmentNames; } set { attachmentNames = value; } }
- public int FrameCount { get { return frames.Length; } }
-
- public AttachmentTimeline (int frameCount) {
- frames = new float[frameCount];
- attachmentNames = new String[frameCount];
- }
-
- /// Sets the time and value of the specified keyframe.
- public void setFrame (int frameIndex, float time, String attachmentName) {
- frames[frameIndex] = time;
- attachmentNames[frameIndex] = attachmentName;
- }
-
- public void Apply (Skeleton skeleton, float lastTime, float time, List firedEvents, float alpha) {
- float[] frames = this.frames;
- if (time < frames[0]) {
- if (lastTime > time) Apply(skeleton, lastTime, int.MaxValue, null, 0);
- return;
- } else if (lastTime > time) //
- lastTime = -1;
-
- int frameIndex = (time >= frames[frames.Length - 1] ? frames.Length : Animation.binarySearch(frames, time)) - 1;
- if (frames[frameIndex] < lastTime) return;
-
- String attachmentName = attachmentNames[frameIndex];
- skeleton.slots[slotIndex].Attachment =
- attachmentName == null ? null : skeleton.GetAttachment(slotIndex, attachmentName);
- }
- }
-
- public class EventTimeline : Timeline {
- internal float[] frames;
- private Event[] events;
-
- public float[] Frames { get { return frames; } set { frames = value; } } // time, ...
- public Event[] Events { get { return events; } set { events = value; } }
- public int FrameCount { get { return frames.Length; } }
-
- public EventTimeline (int frameCount) {
- frames = new float[frameCount];
- events = new Event[frameCount];
- }
-
- /// Sets the time and value of the specified keyframe.
- public void setFrame (int frameIndex, float time, Event e) {
- frames[frameIndex] = time;
- events[frameIndex] = e;
- }
-
- /// Fires events for frames > lastTime and <= time.
- public void Apply (Skeleton skeleton, float lastTime, float time, List firedEvents, float alpha) {
- if (firedEvents == null) return;
- float[] frames = this.frames;
- int frameCount = frames.Length;
-
- if (lastTime > time) { // Fire events after last time for looped animations.
- Apply(skeleton, lastTime, int.MaxValue, firedEvents, alpha);
- lastTime = -1f;
- } else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame.
- return;
- if (time < frames[0]) return; // Time is before first frame.
-
- int frameIndex;
- if (lastTime < frames[0])
- frameIndex = 0;
- else {
- frameIndex = Animation.binarySearch(frames, lastTime);
- float frame = frames[frameIndex];
- while (frameIndex > 0) { // Fire multiple events with the same frame.
- if (frames[frameIndex - 1] != frame) break;
- frameIndex--;
- }
- }
- for (; frameIndex < frameCount && time >= frames[frameIndex]; frameIndex++)
- firedEvents.Add(events[frameIndex]);
- }
- }
-
- public class DrawOrderTimeline : Timeline {
- internal float[] frames;
- private int[][] drawOrders;
-
- public float[] Frames { get { return frames; } set { frames = value; } } // time, ...
- public int[][] DrawOrders { get { return drawOrders; } set { drawOrders = value; } }
- public int FrameCount { get { return frames.Length; } }
-
- public DrawOrderTimeline (int frameCount) {
- frames = new float[frameCount];
- drawOrders = new int[frameCount][];
- }
-
- /// Sets the time and value of the specified keyframe.
- /// May be null to use bind pose draw order.
- public void setFrame (int frameIndex, float time, int[] drawOrder) {
- frames[frameIndex] = time;
- drawOrders[frameIndex] = drawOrder;
- }
-
- public void Apply (Skeleton skeleton, float lastTime, float time, List firedEvents, float alpha) {
- float[] frames = this.frames;
- if (time < frames[0]) return; // Time is before first frame.
-
- int frameIndex;
- if (time >= frames[frames.Length - 1]) // Time is after last frame.
- frameIndex = frames.Length - 1;
- else
- frameIndex = Animation.binarySearch(frames, time) - 1;
-
- List drawOrder = skeleton.drawOrder;
- List slots = skeleton.slots;
- int[] drawOrderToSetupIndex = drawOrders[frameIndex];
- if (drawOrderToSetupIndex == null) {
- drawOrder.Clear();
- drawOrder.AddRange(slots);
- } else {
- for (int i = 0, n = drawOrderToSetupIndex.Length; i < n; i++)
- drawOrder[i] = slots[drawOrderToSetupIndex[i]];
- }
- }
- }
-
- public class FFDTimeline : CurveTimeline {
- internal int slotIndex;
- internal float[] frames;
- private float[][] frameVertices;
- internal Attachment attachment;
-
- public int SlotIndex { get { return slotIndex; } set { slotIndex = value; } }
- public float[] Frames { get { return frames; } set { frames = value; } } // time, ...
- public float[][] Vertices { get { return frameVertices; } set { frameVertices = value; } }
- public Attachment Attachment { get { return attachment; } set { attachment = value; } }
-
- public FFDTimeline (int frameCount)
- : base(frameCount) {
- frames = new float[frameCount];
- frameVertices = new float[frameCount][];
- }
-
- /// Sets the time and value of the specified keyframe.
- public void setFrame (int frameIndex, float time, float[] vertices) {
- frames[frameIndex] = time;
- frameVertices[frameIndex] = vertices;
- }
-
- override public void Apply (Skeleton skeleton, float lastTime, float time, List firedEvents, float alpha) {
- Slot slot = skeleton.slots[slotIndex];
- if (slot.attachment != attachment) return;
-
- float[] frames = this.frames;
- if (time < frames[0]) return; // Time is before first frame.
-
- float[][] frameVertices = this.frameVertices;
- int vertexCount = frameVertices[0].Length;
-
- float[] vertices = slot.attachmentVertices;
- if (vertices.Length < vertexCount) {
- vertices = new float[vertexCount];
- slot.attachmentVertices = vertices;
- } else if (vertices.Length > vertexCount)
- alpha = 1; // Don't mix from uninitialized slot vertices.
- slot.attachmentVerticesCount = vertexCount;
-
- if (time >= frames[frames.Length - 1]) { // Time is after last frame.
- float[] lastVertices = frameVertices[frames.Length - 1];
- if (alpha < 1) {
- for (int i = 0; i < vertexCount; i++) {
- float vertex = vertices[i];
- vertices[i] = vertex + (lastVertices[i] - vertex) * alpha;
- }
- } else
- Array.Copy(lastVertices, 0, vertices, 0, vertexCount);
- return;
- }
-
- // Interpolate between the previous frame and the current frame.
- int frameIndex = Animation.binarySearch(frames, time);
- float frameTime = frames[frameIndex];
- float percent = 1 - (time - frameTime) / (frames[frameIndex - 1] - frameTime);
- percent = GetCurvePercent(frameIndex - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent));
-
- float[] prevVertices = frameVertices[frameIndex - 1];
- float[] nextVertices = frameVertices[frameIndex];
-
- if (alpha < 1) {
- for (int i = 0; i < vertexCount; i++) {
- float prev = prevVertices[i];
- float vertex = vertices[i];
- vertices[i] = vertex + (prev + (nextVertices[i] - prev) * percent - vertex) * alpha;
- }
- } else {
- for (int i = 0; i < vertexCount; i++) {
- float prev = prevVertices[i];
- vertices[i] = prev + (nextVertices[i] - prev) * percent;
- }
- }
- }
- }
-
- public class IkConstraintTimeline : CurveTimeline {
- private const int PREV_FRAME_TIME = -3;
- private const int PREV_FRAME_MIX = -2;
- private const int PREV_FRAME_BEND_DIRECTION = -1;
- private const int FRAME_MIX = 1;
-
- internal int ikConstraintIndex;
- internal float[] frames;
-
- public int IkConstraintIndex { get { return ikConstraintIndex; } set { ikConstraintIndex = value; } }
- public float[] Frames { get { return frames; } set { frames = value; } } // time, mix, bendDirection, ...
-
- public IkConstraintTimeline (int frameCount)
- : base(frameCount) {
- frames = new float[frameCount * 3];
- }
-
- /** Sets the time, mix and bend direction of the specified keyframe. */
- public void setFrame (int frameIndex, float time, float mix, int bendDirection) {
- frameIndex *= 3;
- frames[frameIndex] = time;
- frames[frameIndex + 1] = mix;
- frames[frameIndex + 2] = bendDirection;
- }
-
- override public void Apply (Skeleton skeleton, float lastTime, float time, List firedEvents, float alpha) {
- float[] frames = this.frames;
- if (time < frames[0]) return; // Time is before first frame.
-
- IkConstraint ikConstraint = skeleton.ikConstraints[ikConstraintIndex];
-
- if (time >= frames[frames.Length - 3]) { // Time is after last frame.
- ikConstraint.mix += (frames[frames.Length - 2] - ikConstraint.mix) * alpha;
- ikConstraint.bendDirection = (int)frames[frames.Length - 1];
- return;
- }
-
- // Interpolate between the previous frame and the current frame.
- int frameIndex = Animation.binarySearch(frames, time, 3);
- float prevFrameMix = frames[frameIndex + PREV_FRAME_MIX];
- float frameTime = frames[frameIndex];
- float percent = 1 - (time - frameTime) / (frames[frameIndex + PREV_FRAME_TIME] - frameTime);
- percent = GetCurvePercent(frameIndex / 3 - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent));
-
- float mix = prevFrameMix + (frames[frameIndex + FRAME_MIX] - prevFrameMix) * percent;
- ikConstraint.mix += (mix - ikConstraint.mix) * alpha;
- ikConstraint.bendDirection = (int)frames[frameIndex + PREV_FRAME_BEND_DIRECTION];
- }
- }
-
- public class FlipXTimeline : Timeline {
- internal int boneIndex;
- internal float[] frames;
-
- public int BoneIndex { get { return boneIndex; } set { boneIndex = value; } }
- public float[] Frames { get { return frames; } set { frames = value; } } // time, flip, ...
- public int FrameCount { get { return frames.Length >> 1; } }
-
- public FlipXTimeline (int frameCount) {
- frames = new float[frameCount << 1];
- }
-
- /// Sets the time and value of the specified keyframe.
- public void SetFrame (int frameIndex, float time, bool flip) {
- frameIndex *= 2;
- frames[frameIndex] = time;
- frames[frameIndex + 1] = flip ? 1 : 0;
- }
-
- public void Apply (Skeleton skeleton, float lastTime, float time, List firedEvents, float alpha) {
- float[] frames = this.frames;
- if (time < frames[0]) {
- if (lastTime > time) Apply(skeleton, lastTime, int.MaxValue, null, 0);
- return;
- } else if (lastTime > time) //
- lastTime = -1;
-
- int frameIndex = (time >= frames[frames.Length - 2] ? frames.Length : Animation.binarySearch(frames, time, 2)) - 2;
- if (frames[frameIndex] < lastTime) return;
-
- SetFlip(skeleton.bones[boneIndex], frames[frameIndex + 1] != 0);
- }
-
- virtual protected void SetFlip (Bone bone, bool flip) {
- bone.flipX = flip;
- }
- }
-
- public class FlipYTimeline : FlipXTimeline {
- public FlipYTimeline (int frameCount)
- : base(frameCount) {
- }
-
- override protected void SetFlip (Bone bone, bool flip) {
- bone.flipY = flip;
- }
- }
+namespace Spine2_1_08
+{
+ public class Animation
+ {
+ internal List timelines;
+ internal float duration;
+ internal String name;
+
+ public String Name { get { return name; } }
+ public List Timelines { get { return timelines; } set { timelines = value; } }
+ public float Duration { get { return duration; } set { duration = value; } }
+
+ public Animation(String name, List timelines, float duration)
+ {
+ if (name == null) throw new ArgumentNullException("name cannot be null.");
+ if (timelines == null) throw new ArgumentNullException("timelines cannot be null.");
+ this.name = name;
+ this.timelines = timelines;
+ this.duration = duration;
+ }
+
+ /// Poses the skeleton at the specified time for this animation.
+ /// The last time the animation was applied.
+ /// Any triggered events are added.
+ public void Apply(Skeleton skeleton, float lastTime, float time, bool loop, List events)
+ {
+ if (skeleton == null) throw new ArgumentNullException("skeleton cannot be null.");
+
+ if (loop && duration != 0)
+ {
+ time %= duration;
+ lastTime %= duration;
+ }
+
+ List timelines = this.timelines;
+ for (int i = 0, n = timelines.Count; i < n; i++)
+ timelines[i].Apply(skeleton, lastTime, time, events, 1);
+ }
+
+ /// Poses the skeleton at the specified time for this animation mixed with the current pose.
+ /// The last time the animation was applied.
+ /// Any triggered events are added.
+ /// The amount of this animation that affects the current pose.
+ public void Mix(Skeleton skeleton, float lastTime, float time, bool loop, List events, float alpha)
+ {
+ if (skeleton == null) throw new ArgumentNullException("skeleton cannot be null.");
+
+ if (loop && duration != 0)
+ {
+ time %= duration;
+ lastTime %= duration;
+ }
+
+ List timelines = this.timelines;
+ for (int i = 0, n = timelines.Count; i < n; i++)
+ timelines[i].Apply(skeleton, lastTime, time, events, alpha);
+ }
+
+ /// After the first and before the last entry.
+ internal static int binarySearch(float[] values, float target, int step)
+ {
+ int low = 0;
+ int high = values.Length / step - 2;
+ if (high == 0) return step;
+ int current = (int)((uint)high >> 1);
+ while (true)
+ {
+ if (values[(current + 1) * step] <= target)
+ low = current + 1;
+ else
+ high = current;
+ if (low == high) return (low + 1) * step;
+ current = (int)((uint)(low + high) >> 1);
+ }
+ }
+
+ /// After the first and before the last entry.
+ internal static int binarySearch(float[] values, float target)
+ {
+ int low = 0;
+ int high = values.Length - 2;
+ if (high == 0) return 1;
+ int current = (int)((uint)high >> 1);
+ while (true)
+ {
+ if (values[(current + 1)] <= target)
+ low = current + 1;
+ else
+ high = current;
+ if (low == high) return (low + 1);
+ current = (int)((uint)(low + high) >> 1);
+ }
+ }
+
+ internal static int linearSearch(float[] values, float target, int step)
+ {
+ for (int i = 0, last = values.Length - step; i <= last; i += step)
+ if (values[i] > target) return i;
+ return -1;
+ }
+ }
+
+ public interface Timeline
+ {
+ /// Sets the value(s) for the specified time.
+ /// May be null to not collect fired events.
+ void Apply(Skeleton skeleton, float lastTime, float time, List events, float alpha);
+ }
+
+ /// Base class for frames that use an interpolation bezier curve.
+ abstract public class CurveTimeline : Timeline
+ {
+ protected const float LINEAR = 0, STEPPED = 1, BEZIER = 2;
+ protected const int BEZIER_SEGMENTS = 10, BEZIER_SIZE = BEZIER_SEGMENTS * 2 - 1;
+
+ private float[] curves; // type, x, y, ...
+ public int FrameCount { get { return curves.Length / BEZIER_SIZE + 1; } }
+
+ public CurveTimeline(int frameCount)
+ {
+ curves = new float[(frameCount - 1) * BEZIER_SIZE];
+ }
+
+ abstract public void Apply(Skeleton skeleton, float lastTime, float time, List firedEvents, float alpha);
+
+ public void SetLinear(int frameIndex)
+ {
+ curves[frameIndex * BEZIER_SIZE] = LINEAR;
+ }
+
+ public void SetStepped(int frameIndex)
+ {
+ curves[frameIndex * BEZIER_SIZE] = STEPPED;
+ }
+
+ /// Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next.
+ /// cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of
+ /// the difference between the keyframe's values.
+ public void SetCurve(int frameIndex, float cx1, float cy1, float cx2, float cy2)
+ {
+ float subdiv1 = 1f / BEZIER_SEGMENTS, subdiv2 = subdiv1 * subdiv1, subdiv3 = subdiv2 * subdiv1;
+ float pre1 = 3 * subdiv1, pre2 = 3 * subdiv2, pre4 = 6 * subdiv2, pre5 = 6 * subdiv3;
+ float tmp1x = -cx1 * 2 + cx2, tmp1y = -cy1 * 2 + cy2, tmp2x = (cx1 - cx2) * 3 + 1, tmp2y = (cy1 - cy2) * 3 + 1;
+ float dfx = cx1 * pre1 + tmp1x * pre2 + tmp2x * subdiv3, dfy = cy1 * pre1 + tmp1y * pre2 + tmp2y * subdiv3;
+ float ddfx = tmp1x * pre4 + tmp2x * pre5, ddfy = tmp1y * pre4 + tmp2y * pre5;
+ float dddfx = tmp2x * pre5, dddfy = tmp2y * pre5;
+
+ int i = frameIndex * BEZIER_SIZE;
+ float[] curves = this.curves;
+ curves[i++] = BEZIER;
+
+ float x = dfx, y = dfy;
+ for (int n = i + BEZIER_SIZE - 1; i < n; i += 2)
+ {
+ curves[i] = x;
+ curves[i + 1] = y;
+ dfx += ddfx;
+ dfy += ddfy;
+ ddfx += dddfx;
+ ddfy += dddfy;
+ x += dfx;
+ y += dfy;
+ }
+ }
+
+ public float GetCurvePercent(int frameIndex, float percent)
+ {
+ float[] curves = this.curves;
+ int i = frameIndex * BEZIER_SIZE;
+ float type = curves[i];
+ if (type == LINEAR) return percent;
+ if (type == STEPPED) return 0;
+ i++;
+ float x = 0;
+ for (int start = i, n = i + BEZIER_SIZE - 1; i < n; i += 2)
+ {
+ x = curves[i];
+ if (x >= percent)
+ {
+ float prevX, prevY;
+ if (i == start)
+ {
+ prevX = 0;
+ prevY = 0;
+ }
+ else
+ {
+ prevX = curves[i - 2];
+ prevY = curves[i - 1];
+ }
+ return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX);
+ }
+ }
+ float y = curves[i - 1];
+ return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1.
+ }
+ }
+
+ public class RotateTimeline : CurveTimeline
+ {
+ protected const int PREV_FRAME_TIME = -2;
+ protected const int FRAME_VALUE = 1;
+
+ internal int boneIndex;
+ internal float[] frames;
+
+ public int BoneIndex { get { return boneIndex; } set { boneIndex = value; } }
+ public float[] Frames { get { return frames; } set { frames = value; } } // time, value, ...
+
+ public RotateTimeline(int frameCount)
+ : base(frameCount)
+ {
+ frames = new float[frameCount << 1];
+ }
+
+ /// Sets the time and value of the specified keyframe.
+ public void SetFrame(int frameIndex, float time, float angle)
+ {
+ frameIndex *= 2;
+ frames[frameIndex] = time;
+ frames[frameIndex + 1] = angle;
+ }
+
+ override public void Apply(Skeleton skeleton, float lastTime, float time, List firedEvents, float alpha)
+ {
+ float[] frames = this.frames;
+ if (time < frames[0]) return; // Time is before first frame.
+
+ Bone bone = skeleton.bones[boneIndex];
+
+ float amount;
+
+ if (time >= frames[frames.Length - 2])
+ { // Time is after last frame.
+ amount = bone.data.rotation + frames[frames.Length - 1] - bone.rotation;
+ while (amount > 180)
+ amount -= 360;
+ while (amount < -180)
+ amount += 360;
+ bone.rotation += amount * alpha;
+ return;
+ }
+
+ // Interpolate between the previous frame and the current frame.
+ int frameIndex = Animation.binarySearch(frames, time, 2);
+ float prevFrameValue = frames[frameIndex - 1];
+ float frameTime = frames[frameIndex];
+ float percent = 1 - (time - frameTime) / (frames[frameIndex + PREV_FRAME_TIME] - frameTime);
+ percent = GetCurvePercent((frameIndex >> 1) - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent));
+
+ amount = frames[frameIndex + FRAME_VALUE] - prevFrameValue;
+ while (amount > 180)
+ amount -= 360;
+ while (amount < -180)
+ amount += 360;
+ amount = bone.data.rotation + (prevFrameValue + amount * percent) - bone.rotation;
+ while (amount > 180)
+ amount -= 360;
+ while (amount < -180)
+ amount += 360;
+ bone.rotation += amount * alpha;
+ }
+ }
+
+ public class TranslateTimeline : CurveTimeline
+ {
+ protected const int PREV_FRAME_TIME = -3;
+ protected const int FRAME_X = 1;
+ protected const int FRAME_Y = 2;
+
+ internal int boneIndex;
+ internal float[] frames;
+
+ public int BoneIndex { get { return boneIndex; } set { boneIndex = value; } }
+ public float[] Frames { get { return frames; } set { frames = value; } } // time, value, value, ...
+
+ public TranslateTimeline(int frameCount)
+ : base(frameCount)
+ {
+ frames = new float[frameCount * 3];
+ }
+
+ /// Sets the time and value of the specified keyframe.
+ public void SetFrame(int frameIndex, float time, float x, float y)
+ {
+ frameIndex *= 3;
+ frames[frameIndex] = time;
+ frames[frameIndex + 1] = x;
+ frames[frameIndex + 2] = y;
+ }
+
+ override public void Apply(Skeleton skeleton, float lastTime, float time, List firedEvents, float alpha)
+ {
+ float[] frames = this.frames;
+ if (time < frames[0]) return; // Time is before first frame.
+
+ Bone bone = skeleton.bones[boneIndex];
+
+ if (time >= frames[frames.Length - 3])
+ { // Time is after last frame.
+ bone.x += (bone.data.x + frames[frames.Length - 2] - bone.x) * alpha;
+ bone.y += (bone.data.y + frames[frames.Length - 1] - bone.y) * alpha;
+ return;
+ }
+
+ // Interpolate between the previous frame and the current frame.
+ int frameIndex = Animation.binarySearch(frames, time, 3);
+ float prevFrameX = frames[frameIndex - 2];
+ float prevFrameY = frames[frameIndex - 1];
+ float frameTime = frames[frameIndex];
+ float percent = 1 - (time - frameTime) / (frames[frameIndex + PREV_FRAME_TIME] - frameTime);
+ percent = GetCurvePercent(frameIndex / 3 - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent));
+
+ bone.x += (bone.data.x + prevFrameX + (frames[frameIndex + FRAME_X] - prevFrameX) * percent - bone.x) * alpha;
+ bone.y += (bone.data.y + prevFrameY + (frames[frameIndex + FRAME_Y] - prevFrameY) * percent - bone.y) * alpha;
+ }
+ }
+
+ public class ScaleTimeline : TranslateTimeline
+ {
+ public ScaleTimeline(int frameCount)
+ : base(frameCount)
+ {
+ }
+
+ override public void Apply(Skeleton skeleton, float lastTime, float time, List firedEvents, float alpha)
+ {
+ float[] frames = this.frames;
+ if (time < frames[0]) return; // Time is before first frame.
+
+ Bone bone = skeleton.bones[boneIndex];
+ if (time >= frames[frames.Length - 3])
+ { // Time is after last frame.
+ bone.scaleX += (bone.data.scaleX * frames[frames.Length - 2] - bone.scaleX) * alpha;
+ bone.scaleY += (bone.data.scaleY * frames[frames.Length - 1] - bone.scaleY) * alpha;
+ return;
+ }
+
+ // Interpolate between the previous frame and the current frame.
+ int frameIndex = Animation.binarySearch(frames, time, 3);
+ float prevFrameX = frames[frameIndex - 2];
+ float prevFrameY = frames[frameIndex - 1];
+ float frameTime = frames[frameIndex];
+ float percent = 1 - (time - frameTime) / (frames[frameIndex + PREV_FRAME_TIME] - frameTime);
+ percent = GetCurvePercent(frameIndex / 3 - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent));
+
+ bone.scaleX += (bone.data.scaleX * (prevFrameX + (frames[frameIndex + FRAME_X] - prevFrameX) * percent) - bone.scaleX) * alpha;
+ bone.scaleY += (bone.data.scaleY * (prevFrameY + (frames[frameIndex + FRAME_Y] - prevFrameY) * percent) - bone.scaleY) * alpha;
+ }
+ }
+
+ public class ColorTimeline : CurveTimeline
+ {
+ protected const int PREV_FRAME_TIME = -5;
+ protected const int FRAME_R = 1;
+ protected const int FRAME_G = 2;
+ protected const int FRAME_B = 3;
+ protected const int FRAME_A = 4;
+
+ internal int slotIndex;
+ internal float[] frames;
+
+ public int SlotIndex { get { return slotIndex; } set { slotIndex = value; } }
+ public float[] Frames { get { return frames; } set { frames = value; } } // time, r, g, b, a, ...
+
+ public ColorTimeline(int frameCount)
+ : base(frameCount)
+ {
+ frames = new float[frameCount * 5];
+ }
+
+ /// Sets the time and value of the specified keyframe.
+ public void setFrame(int frameIndex, float time, float r, float g, float b, float a)
+ {
+ frameIndex *= 5;
+ frames[frameIndex] = time;
+ frames[frameIndex + 1] = r;
+ frames[frameIndex + 2] = g;
+ frames[frameIndex + 3] = b;
+ frames[frameIndex + 4] = a;
+ }
+
+ override public void Apply(Skeleton skeleton, float lastTime, float time, List firedEvents, float alpha)
+ {
+ float[] frames = this.frames;
+ if (time < frames[0]) return; // Time is before first frame.
+
+ float r, g, b, a;
+ if (time >= frames[frames.Length - 5])
+ {
+ // Time is after last frame.
+ int i = frames.Length - 1;
+ r = frames[i - 3];
+ g = frames[i - 2];
+ b = frames[i - 1];
+ a = frames[i];
+ }
+ else
+ {
+ // Interpolate between the previous frame and the current frame.
+ int frameIndex = Animation.binarySearch(frames, time, 5);
+ float prevFrameR = frames[frameIndex - 4];
+ float prevFrameG = frames[frameIndex - 3];
+ float prevFrameB = frames[frameIndex - 2];
+ float prevFrameA = frames[frameIndex - 1];
+ float frameTime = frames[frameIndex];
+ float percent = 1 - (time - frameTime) / (frames[frameIndex + PREV_FRAME_TIME] - frameTime);
+ percent = GetCurvePercent(frameIndex / 5 - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent));
+
+ r = prevFrameR + (frames[frameIndex + FRAME_R] - prevFrameR) * percent;
+ g = prevFrameG + (frames[frameIndex + FRAME_G] - prevFrameG) * percent;
+ b = prevFrameB + (frames[frameIndex + FRAME_B] - prevFrameB) * percent;
+ a = prevFrameA + (frames[frameIndex + FRAME_A] - prevFrameA) * percent;
+ }
+ Slot slot = skeleton.slots[slotIndex];
+ if (alpha < 1)
+ {
+ slot.r += (r - slot.r) * alpha;
+ slot.g += (g - slot.g) * alpha;
+ slot.b += (b - slot.b) * alpha;
+ slot.a += (a - slot.a) * alpha;
+ }
+ else
+ {
+ slot.r = r;
+ slot.g = g;
+ slot.b = b;
+ slot.a = a;
+ }
+ }
+ }
+
+ public class AttachmentTimeline : Timeline
+ {
+ internal int slotIndex;
+ internal float[] frames;
+ private String[] attachmentNames;
+
+ public int SlotIndex { get { return slotIndex; } set { slotIndex = value; } }
+ public float[] Frames { get { return frames; } set { frames = value; } } // time, ...
+ public String[] AttachmentNames { get { return attachmentNames; } set { attachmentNames = value; } }
+ public int FrameCount { get { return frames.Length; } }
+
+ public AttachmentTimeline(int frameCount)
+ {
+ frames = new float[frameCount];
+ attachmentNames = new String[frameCount];
+ }
+
+ /// Sets the time and value of the specified keyframe.
+ public void setFrame(int frameIndex, float time, String attachmentName)
+ {
+ frames[frameIndex] = time;
+ attachmentNames[frameIndex] = attachmentName;
+ }
+
+ public void Apply(Skeleton skeleton, float lastTime, float time, List firedEvents, float alpha)
+ {
+ float[] frames = this.frames;
+ if (time < frames[0])
+ {
+ if (lastTime > time) Apply(skeleton, lastTime, int.MaxValue, null, 0);
+ return;
+ }
+ else if (lastTime > time) //
+ lastTime = -1;
+
+ int frameIndex = (time >= frames[frames.Length - 1] ? frames.Length : Animation.binarySearch(frames, time)) - 1;
+ if (frames[frameIndex] < lastTime) return;
+
+ String attachmentName = attachmentNames[frameIndex];
+ skeleton.slots[slotIndex].Attachment =
+ attachmentName == null ? null : skeleton.GetAttachment(slotIndex, attachmentName);
+ }
+ }
+
+ public class EventTimeline : Timeline
+ {
+ internal float[] frames;
+ private Event[] events;
+
+ public float[] Frames { get { return frames; } set { frames = value; } } // time, ...
+ public Event[] Events { get { return events; } set { events = value; } }
+ public int FrameCount { get { return frames.Length; } }
+
+ public EventTimeline(int frameCount)
+ {
+ frames = new float[frameCount];
+ events = new Event[frameCount];
+ }
+
+ /// Sets the time and value of the specified keyframe.
+ public void setFrame(int frameIndex, float time, Event e)
+ {
+ frames[frameIndex] = time;
+ events[frameIndex] = e;
+ }
+
+ /// Fires events for frames > lastTime and <= time.
+ public void Apply(Skeleton skeleton, float lastTime, float time, List firedEvents, float alpha)
+ {
+ if (firedEvents == null) return;
+ float[] frames = this.frames;
+ int frameCount = frames.Length;
+
+ if (lastTime > time)
+ { // Fire events after last time for looped animations.
+ Apply(skeleton, lastTime, int.MaxValue, firedEvents, alpha);
+ lastTime = -1f;
+ }
+ else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame.
+ return;
+ if (time < frames[0]) return; // Time is before first frame.
+
+ int frameIndex;
+ if (lastTime < frames[0])
+ frameIndex = 0;
+ else
+ {
+ frameIndex = Animation.binarySearch(frames, lastTime);
+ float frame = frames[frameIndex];
+ while (frameIndex > 0)
+ { // Fire multiple events with the same frame.
+ if (frames[frameIndex - 1] != frame) break;
+ frameIndex--;
+ }
+ }
+ for (; frameIndex < frameCount && time >= frames[frameIndex]; frameIndex++)
+ firedEvents.Add(events[frameIndex]);
+ }
+ }
+
+ public class DrawOrderTimeline : Timeline
+ {
+ internal float[] frames;
+ private int[][] drawOrders;
+
+ public float[] Frames { get { return frames; } set { frames = value; } } // time, ...
+ public int[][] DrawOrders { get { return drawOrders; } set { drawOrders = value; } }
+ public int FrameCount { get { return frames.Length; } }
+
+ public DrawOrderTimeline(int frameCount)
+ {
+ frames = new float[frameCount];
+ drawOrders = new int[frameCount][];
+ }
+
+ /// Sets the time and value of the specified keyframe.
+ /// May be null to use bind pose draw order.
+ public void setFrame(int frameIndex, float time, int[] drawOrder)
+ {
+ frames[frameIndex] = time;
+ drawOrders[frameIndex] = drawOrder;
+ }
+
+ public void Apply(Skeleton skeleton, float lastTime, float time, List firedEvents, float alpha)
+ {
+ float[] frames = this.frames;
+ if (time < frames[0]) return; // Time is before first frame.
+
+ int frameIndex;
+ if (time >= frames[frames.Length - 1]) // Time is after last frame.
+ frameIndex = frames.Length - 1;
+ else
+ frameIndex = Animation.binarySearch(frames, time) - 1;
+
+ List drawOrder = skeleton.drawOrder;
+ List slots = skeleton.slots;
+ int[] drawOrderToSetupIndex = drawOrders[frameIndex];
+ if (drawOrderToSetupIndex == null)
+ {
+ drawOrder.Clear();
+ drawOrder.AddRange(slots);
+ }
+ else
+ {
+ for (int i = 0, n = drawOrderToSetupIndex.Length; i < n; i++)
+ drawOrder[i] = slots[drawOrderToSetupIndex[i]];
+ }
+ }
+ }
+
+ public class FFDTimeline : CurveTimeline
+ {
+ internal int slotIndex;
+ internal float[] frames;
+ private float[][] frameVertices;
+ internal Attachment attachment;
+
+ public int SlotIndex { get { return slotIndex; } set { slotIndex = value; } }
+ public float[] Frames { get { return frames; } set { frames = value; } } // time, ...
+ public float[][] Vertices { get { return frameVertices; } set { frameVertices = value; } }
+ public Attachment Attachment { get { return attachment; } set { attachment = value; } }
+
+ public FFDTimeline(int frameCount)
+ : base(frameCount)
+ {
+ frames = new float[frameCount];
+ frameVertices = new float[frameCount][];
+ }
+
+ /// Sets the time and value of the specified keyframe.
+ public void setFrame(int frameIndex, float time, float[] vertices)
+ {
+ frames[frameIndex] = time;
+ frameVertices[frameIndex] = vertices;
+ }
+
+ override public void Apply(Skeleton skeleton, float lastTime, float time, List firedEvents, float alpha)
+ {
+ Slot slot = skeleton.slots[slotIndex];
+ if (slot.attachment != attachment) return;
+
+ float[] frames = this.frames;
+ if (time < frames[0]) return; // Time is before first frame.
+
+ float[][] frameVertices = this.frameVertices;
+ int vertexCount = frameVertices[0].Length;
+
+ float[] vertices = slot.attachmentVertices;
+ if (vertices.Length < vertexCount)
+ {
+ vertices = new float[vertexCount];
+ slot.attachmentVertices = vertices;
+ }
+ else if (vertices.Length > vertexCount)
+ alpha = 1; // Don't mix from uninitialized slot vertices.
+ slot.attachmentVerticesCount = vertexCount;
+
+ if (time >= frames[frames.Length - 1])
+ { // Time is after last frame.
+ float[] lastVertices = frameVertices[frames.Length - 1];
+ if (alpha < 1)
+ {
+ for (int i = 0; i < vertexCount; i++)
+ {
+ float vertex = vertices[i];
+ vertices[i] = vertex + (lastVertices[i] - vertex) * alpha;
+ }
+ }
+ else
+ Array.Copy(lastVertices, 0, vertices, 0, vertexCount);
+ return;
+ }
+
+ // Interpolate between the previous frame and the current frame.
+ int frameIndex = Animation.binarySearch(frames, time);
+ float frameTime = frames[frameIndex];
+ float percent = 1 - (time - frameTime) / (frames[frameIndex - 1] - frameTime);
+ percent = GetCurvePercent(frameIndex - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent));
+
+ float[] prevVertices = frameVertices[frameIndex - 1];
+ float[] nextVertices = frameVertices[frameIndex];
+
+ if (alpha < 1)
+ {
+ for (int i = 0; i < vertexCount; i++)
+ {
+ float prev = prevVertices[i];
+ float vertex = vertices[i];
+ vertices[i] = vertex + (prev + (nextVertices[i] - prev) * percent - vertex) * alpha;
+ }
+ }
+ else
+ {
+ for (int i = 0; i < vertexCount; i++)
+ {
+ float prev = prevVertices[i];
+ vertices[i] = prev + (nextVertices[i] - prev) * percent;
+ }
+ }
+ }
+ }
+
+ public class IkConstraintTimeline : CurveTimeline
+ {
+ private const int PREV_FRAME_TIME = -3;
+ private const int PREV_FRAME_MIX = -2;
+ private const int PREV_FRAME_BEND_DIRECTION = -1;
+ private const int FRAME_MIX = 1;
+
+ internal int ikConstraintIndex;
+ internal float[] frames;
+
+ public int IkConstraintIndex { get { return ikConstraintIndex; } set { ikConstraintIndex = value; } }
+ public float[] Frames { get { return frames; } set { frames = value; } } // time, mix, bendDirection, ...
+
+ public IkConstraintTimeline(int frameCount)
+ : base(frameCount)
+ {
+ frames = new float[frameCount * 3];
+ }
+
+ /** Sets the time, mix and bend direction of the specified keyframe. */
+ public void setFrame(int frameIndex, float time, float mix, int bendDirection)
+ {
+ frameIndex *= 3;
+ frames[frameIndex] = time;
+ frames[frameIndex + 1] = mix;
+ frames[frameIndex + 2] = bendDirection;
+ }
+
+ override public void Apply(Skeleton skeleton, float lastTime, float time, List firedEvents, float alpha)
+ {
+ float[] frames = this.frames;
+ if (time < frames[0]) return; // Time is before first frame.
+
+ IkConstraint ikConstraint = skeleton.ikConstraints[ikConstraintIndex];
+
+ if (time >= frames[frames.Length - 3])
+ { // Time is after last frame.
+ ikConstraint.mix += (frames[frames.Length - 2] - ikConstraint.mix) * alpha;
+ ikConstraint.bendDirection = (int)frames[frames.Length - 1];
+ return;
+ }
+
+ // Interpolate between the previous frame and the current frame.
+ int frameIndex = Animation.binarySearch(frames, time, 3);
+ float prevFrameMix = frames[frameIndex + PREV_FRAME_MIX];
+ float frameTime = frames[frameIndex];
+ float percent = 1 - (time - frameTime) / (frames[frameIndex + PREV_FRAME_TIME] - frameTime);
+ percent = GetCurvePercent(frameIndex / 3 - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent));
+
+ float mix = prevFrameMix + (frames[frameIndex + FRAME_MIX] - prevFrameMix) * percent;
+ ikConstraint.mix += (mix - ikConstraint.mix) * alpha;
+ ikConstraint.bendDirection = (int)frames[frameIndex + PREV_FRAME_BEND_DIRECTION];
+ }
+ }
+
+ public class FlipXTimeline : Timeline
+ {
+ internal int boneIndex;
+ internal float[] frames;
+
+ public int BoneIndex { get { return boneIndex; } set { boneIndex = value; } }
+ public float[] Frames { get { return frames; } set { frames = value; } } // time, flip, ...
+ public int FrameCount { get { return frames.Length >> 1; } }
+
+ public FlipXTimeline(int frameCount)
+ {
+ frames = new float[frameCount << 1];
+ }
+
+ /// Sets the time and value of the specified keyframe.
+ public void SetFrame(int frameIndex, float time, bool flip)
+ {
+ frameIndex *= 2;
+ frames[frameIndex] = time;
+ frames[frameIndex + 1] = flip ? 1 : 0;
+ }
+
+ public void Apply(Skeleton skeleton, float lastTime, float time, List firedEvents, float alpha)
+ {
+ float[] frames = this.frames;
+ if (time < frames[0])
+ {
+ if (lastTime > time) Apply(skeleton, lastTime, int.MaxValue, null, 0);
+ return;
+ }
+ else if (lastTime > time) //
+ lastTime = -1;
+
+ int frameIndex = (time >= frames[frames.Length - 2] ? frames.Length : Animation.binarySearch(frames, time, 2)) - 2;
+ if (frames[frameIndex] < lastTime) return;
+
+ SetFlip(skeleton.bones[boneIndex], frames[frameIndex + 1] != 0);
+ }
+
+ virtual protected void SetFlip(Bone bone, bool flip)
+ {
+ bone.flipX = flip;
+ }
+ }
+
+ public class FlipYTimeline : FlipXTimeline
+ {
+ public FlipYTimeline(int frameCount)
+ : base(frameCount)
+ {
+ }
+
+ override protected void SetFlip(Bone bone, bool flip)
+ {
+ bone.flipY = flip;
+ }
+ }
}
diff --git a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/AnimationState.cs b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/AnimationState.cs
index 0d11eb5..b24ffa7 100644
--- a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/AnimationState.cs
+++ b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/AnimationState.cs
@@ -32,268 +32,307 @@
using System.Collections.Generic;
using System.Text;
-namespace Spine2_1_08 {
- public class AnimationState {
- private AnimationStateData data;
- private List tracks = new List();
- private List events = new List();
- private float timeScale = 1;
-
- public AnimationStateData Data { get { return data; } }
- public float TimeScale { get { return timeScale; } set { timeScale = value; } }
-
- public delegate void StartEndDelegate(AnimationState state, int trackIndex);
- public event StartEndDelegate Start;
- public event StartEndDelegate End;
-
- public delegate void EventDelegate(AnimationState state, int trackIndex, Event e);
- public event EventDelegate Event;
-
- public delegate void CompleteDelegate(AnimationState state, int trackIndex, int loopCount);
- public event CompleteDelegate Complete;
-
- public AnimationState (AnimationStateData data) {
- if (data == null) throw new ArgumentNullException("data cannot be null.");
- this.data = data;
- }
-
- public void Update (float delta) {
- delta *= timeScale;
- for (int i = 0; i < tracks.Count; i++) {
- TrackEntry current = tracks[i];
- if (current == null) continue;
-
- float trackDelta = delta * current.timeScale;
- float time = current.time + trackDelta;
- float endTime = current.endTime;
-
- current.time = time;
- if (current.previous != null) {
- current.previous.time += trackDelta;
- current.mixTime += trackDelta;
- }
-
- // Check if completed the animation or a loop iteration.
- if (current.loop ? (current.lastTime % endTime > time % endTime) : (current.lastTime < endTime && time >= endTime)) {
- int count = (int)(time / endTime);
- current.OnComplete(this, i, count);
- if (Complete != null) Complete(this, i, count);
- }
-
- TrackEntry next = current.next;
- if (next != null) {
- next.time = current.lastTime - next.delay;
- if (next.time >= 0) SetCurrent(i, next);
- } else {
- // End non-looping animation when it reaches its end time and there is no next entry.
- if (!current.loop && current.lastTime >= current.endTime) ClearTrack(i);
- }
- }
- }
-
- public void Apply (Skeleton skeleton) {
- List events = this.events;
-
- for (int i = 0; i < tracks.Count; i++) {
- TrackEntry current = tracks[i];
- if (current == null) continue;
-
- events.Clear();
-
- float time = current.time;
- bool loop = current.loop;
- if (!loop && time > current.endTime) time = current.endTime;
-
- TrackEntry previous = current.previous;
- if (previous == null) {
- if (current.mix == 1)
- current.animation.Apply(skeleton, current.lastTime, time, loop, events);
- else
- current.animation.Mix(skeleton, current.lastTime, time, loop, events, current.mix);
- } else {
- float previousTime = previous.time;
- if (!previous.loop && previousTime > previous.endTime) previousTime = previous.endTime;
- previous.animation.Apply(skeleton, previousTime, previousTime, previous.loop, null);
-
- float alpha = current.mixTime / current.mixDuration * current.mix;
- if (alpha >= 1) {
- alpha = 1;
- current.previous = null;
- }
- current.animation.Mix(skeleton, current.lastTime, time, loop, events, alpha);
- }
-
- for (int ii = 0, nn = events.Count; ii < nn; ii++) {
- Event e = events[ii];
- current.OnEvent(this, i, e);
- if (Event != null) Event(this, i, e);
- }
-
- current.lastTime = current.time;
- }
- }
-
- public void ClearTracks () {
- for (int i = 0, n = tracks.Count; i < n; i++)
- ClearTrack(i);
- tracks.Clear();
- }
-
- public void ClearTrack (int trackIndex) {
- if (trackIndex >= tracks.Count) return;
- TrackEntry current = tracks[trackIndex];
- if (current == null) return;
-
- current.OnEnd(this, trackIndex);
- if (End != null) End(this, trackIndex);
-
- tracks[trackIndex] = null;
- }
-
- private TrackEntry ExpandToIndex (int index) {
- if (index < tracks.Count) return tracks[index];
- while (index >= tracks.Count)
- tracks.Add(null);
- return null;
- }
-
- private void SetCurrent (int index, TrackEntry entry) {
- TrackEntry current = ExpandToIndex(index);
- if (current != null) {
- TrackEntry previous = current.previous;
- current.previous = null;
-
- current.OnEnd(this, index);
- if (End != null) End(this, index);
-
- entry.mixDuration = data.GetMix(current.animation, entry.animation);
- if (entry.mixDuration > 0) {
- entry.mixTime = 0;
- // If a mix is in progress, mix from the closest animation.
- if (previous != null && current.mixTime / current.mixDuration < 0.5f)
- entry.previous = previous;
- else
- entry.previous = current;
- }
- }
-
- tracks[index] = entry;
-
- entry.OnStart(this, index);
- if (Start != null) Start(this, index);
- }
-
- public TrackEntry SetAnimation (int trackIndex, String animationName, bool loop) {
- Animation animation = data.skeletonData.FindAnimation(animationName);
- if (animation == null) throw new ArgumentException("Animation not found: " + animationName);
- return SetAnimation(trackIndex, animation, loop);
- }
-
- /// Set the current animation. Any queued animations are cleared.
- public TrackEntry SetAnimation (int trackIndex, Animation animation, bool loop) {
- if (animation == null) throw new ArgumentException("animation cannot be null.");
- TrackEntry entry = new TrackEntry();
- entry.animation = animation;
- entry.loop = loop;
- entry.time = 0;
- entry.endTime = animation.Duration;
- SetCurrent(trackIndex, entry);
- return entry;
- }
-
- public TrackEntry AddAnimation (int trackIndex, String animationName, bool loop, float delay) {
- Animation animation = data.skeletonData.FindAnimation(animationName);
- if (animation == null) throw new ArgumentException("Animation not found: " + animationName);
- return AddAnimation(trackIndex, animation, loop, delay);
- }
-
- /// Adds an animation to be played delay seconds after the current or last queued animation.
- /// May be <= 0 to use duration of previous animation minus any mix duration plus the negative delay.
- public TrackEntry AddAnimation (int trackIndex, Animation animation, bool loop, float delay) {
- if (animation == null) throw new ArgumentException("animation cannot be null.");
- TrackEntry entry = new TrackEntry();
- entry.animation = animation;
- entry.loop = loop;
- entry.time = 0;
- entry.endTime = animation.Duration;
-
- TrackEntry last = ExpandToIndex(trackIndex);
- if (last != null) {
- while (last.next != null)
- last = last.next;
- last.next = entry;
- } else
- tracks[trackIndex] = entry;
-
- if (delay <= 0) {
- if (last != null)
- delay += last.endTime - data.GetMix(last.animation, animation);
- else
- delay = 0;
- }
- entry.delay = delay;
-
- return entry;
- }
-
- /// May be null.
- public TrackEntry GetCurrent (int trackIndex) {
- if (trackIndex >= tracks.Count) return null;
- return tracks[trackIndex];
- }
-
- override public String ToString () {
- StringBuilder buffer = new StringBuilder();
- for (int i = 0, n = tracks.Count; i < n; i++) {
- TrackEntry entry = tracks[i];
- if (entry == null) continue;
- if (buffer.Length > 0) buffer.Append(", ");
- buffer.Append(entry.ToString());
- }
- if (buffer.Length == 0) return "";
- return buffer.ToString();
- }
- }
-
- public class TrackEntry {
- internal TrackEntry next, previous;
- internal Animation animation;
- internal bool loop;
- internal float delay, time, lastTime = -1, endTime, timeScale = 1;
- internal float mixTime, mixDuration, mix = 1;
-
- public Animation Animation { get { return animation; } }
- public float Delay { get { return delay; } set { delay = value; } }
- public float Time { get { return time; } set { time = value; } }
- public float LastTime { get { return lastTime; } set { lastTime = value; } }
- public float EndTime { get { return endTime; } set { endTime = value; } }
- public float TimeScale { get { return timeScale; } set { timeScale = value; } }
- public float Mix { get { return mix; } set { mix = value; } }
- public bool Loop { get { return loop; } set { loop = value; } }
-
- public event AnimationState.StartEndDelegate Start;
- public event AnimationState.StartEndDelegate End;
- public event AnimationState.EventDelegate Event;
- public event AnimationState.CompleteDelegate Complete;
-
- internal void OnStart (AnimationState state, int index) {
- if (Start != null) Start(state, index);
- }
-
- internal void OnEnd (AnimationState state, int index) {
- if (End != null) End(state, index);
- }
-
- internal void OnEvent (AnimationState state, int index, Event e) {
- if (Event != null) Event(state, index, e);
- }
-
- internal void OnComplete (AnimationState state, int index, int loopCount) {
- if (Complete != null) Complete(state, index, loopCount);
- }
-
- override public String ToString () {
- return animation == null ? "" : animation.name;
- }
- }
+namespace Spine2_1_08
+{
+ public class AnimationState
+ {
+ private AnimationStateData data;
+ private List tracks = new List();
+ private List events = new List();
+ private float timeScale = 1;
+
+ public AnimationStateData Data { get { return data; } }
+ public float TimeScale { get { return timeScale; } set { timeScale = value; } }
+
+ public delegate void StartEndDelegate(AnimationState state, int trackIndex);
+ public event StartEndDelegate Start;
+ public event StartEndDelegate End;
+
+ public delegate void EventDelegate(AnimationState state, int trackIndex, Event e);
+ public event EventDelegate Event;
+
+ public delegate void CompleteDelegate(AnimationState state, int trackIndex, int loopCount);
+ public event CompleteDelegate Complete;
+
+ public AnimationState(AnimationStateData data)
+ {
+ if (data == null) throw new ArgumentNullException("data cannot be null.");
+ this.data = data;
+ }
+
+ public void Update(float delta)
+ {
+ delta *= timeScale;
+ for (int i = 0; i < tracks.Count; i++)
+ {
+ TrackEntry current = tracks[i];
+ if (current == null) continue;
+
+ float trackDelta = delta * current.timeScale;
+ float time = current.time + trackDelta;
+ float endTime = current.endTime;
+
+ current.time = time;
+ if (current.previous != null)
+ {
+ current.previous.time += trackDelta;
+ current.mixTime += trackDelta;
+ }
+
+ // Check if completed the animation or a loop iteration.
+ if (current.loop ? (current.lastTime % endTime > time % endTime) : (current.lastTime < endTime && time >= endTime))
+ {
+ int count = (int)(time / endTime);
+ current.OnComplete(this, i, count);
+ if (Complete != null) Complete(this, i, count);
+ }
+
+ TrackEntry next = current.next;
+ if (next != null)
+ {
+ next.time = current.lastTime - next.delay;
+ if (next.time >= 0) SetCurrent(i, next);
+ }
+ else
+ {
+ // End non-looping animation when it reaches its end time and there is no next entry.
+ if (!current.loop && current.lastTime >= current.endTime) ClearTrack(i);
+ }
+ }
+ }
+
+ public void Apply(Skeleton skeleton)
+ {
+ List events = this.events;
+
+ for (int i = 0; i < tracks.Count; i++)
+ {
+ TrackEntry current = tracks[i];
+ if (current == null) continue;
+
+ events.Clear();
+
+ float time = current.time;
+ bool loop = current.loop;
+ if (!loop && time > current.endTime) time = current.endTime;
+
+ TrackEntry previous = current.previous;
+ if (previous == null)
+ {
+ if (current.mix == 1)
+ current.animation.Apply(skeleton, current.lastTime, time, loop, events);
+ else
+ current.animation.Mix(skeleton, current.lastTime, time, loop, events, current.mix);
+ }
+ else
+ {
+ float previousTime = previous.time;
+ if (!previous.loop && previousTime > previous.endTime) previousTime = previous.endTime;
+ previous.animation.Apply(skeleton, previousTime, previousTime, previous.loop, null);
+
+ float alpha = current.mixTime / current.mixDuration * current.mix;
+ if (alpha >= 1)
+ {
+ alpha = 1;
+ current.previous = null;
+ }
+ current.animation.Mix(skeleton, current.lastTime, time, loop, events, alpha);
+ }
+
+ for (int ii = 0, nn = events.Count; ii < nn; ii++)
+ {
+ Event e = events[ii];
+ current.OnEvent(this, i, e);
+ if (Event != null) Event(this, i, e);
+ }
+
+ current.lastTime = current.time;
+ }
+ }
+
+ public void ClearTracks()
+ {
+ for (int i = 0, n = tracks.Count; i < n; i++)
+ ClearTrack(i);
+ tracks.Clear();
+ }
+
+ public void ClearTrack(int trackIndex)
+ {
+ if (trackIndex >= tracks.Count) return;
+ TrackEntry current = tracks[trackIndex];
+ if (current == null) return;
+
+ current.OnEnd(this, trackIndex);
+ if (End != null) End(this, trackIndex);
+
+ tracks[trackIndex] = null;
+ }
+
+ private TrackEntry ExpandToIndex(int index)
+ {
+ if (index < tracks.Count) return tracks[index];
+ while (index >= tracks.Count)
+ tracks.Add(null);
+ return null;
+ }
+
+ private void SetCurrent(int index, TrackEntry entry)
+ {
+ TrackEntry current = ExpandToIndex(index);
+ if (current != null)
+ {
+ TrackEntry previous = current.previous;
+ current.previous = null;
+
+ current.OnEnd(this, index);
+ if (End != null) End(this, index);
+
+ entry.mixDuration = data.GetMix(current.animation, entry.animation);
+ if (entry.mixDuration > 0)
+ {
+ entry.mixTime = 0;
+ // If a mix is in progress, mix from the closest animation.
+ if (previous != null && current.mixTime / current.mixDuration < 0.5f)
+ entry.previous = previous;
+ else
+ entry.previous = current;
+ }
+ }
+
+ tracks[index] = entry;
+
+ entry.OnStart(this, index);
+ if (Start != null) Start(this, index);
+ }
+
+ public TrackEntry SetAnimation(int trackIndex, String animationName, bool loop)
+ {
+ Animation animation = data.skeletonData.FindAnimation(animationName);
+ if (animation == null) throw new ArgumentException("Animation not found: " + animationName);
+ return SetAnimation(trackIndex, animation, loop);
+ }
+
+ /// Set the current animation. Any queued animations are cleared.
+ public TrackEntry SetAnimation(int trackIndex, Animation animation, bool loop)
+ {
+ if (animation == null) throw new ArgumentException("animation cannot be null.");
+ TrackEntry entry = new TrackEntry();
+ entry.animation = animation;
+ entry.loop = loop;
+ entry.time = 0;
+ entry.endTime = animation.Duration;
+ SetCurrent(trackIndex, entry);
+ return entry;
+ }
+
+ public TrackEntry AddAnimation(int trackIndex, String animationName, bool loop, float delay)
+ {
+ Animation animation = data.skeletonData.FindAnimation(animationName);
+ if (animation == null) throw new ArgumentException("Animation not found: " + animationName);
+ return AddAnimation(trackIndex, animation, loop, delay);
+ }
+
+ /// Adds an animation to be played delay seconds after the current or last queued animation.
+ /// May be <= 0 to use duration of previous animation minus any mix duration plus the negative delay.
+ public TrackEntry AddAnimation(int trackIndex, Animation animation, bool loop, float delay)
+ {
+ if (animation == null) throw new ArgumentException("animation cannot be null.");
+ TrackEntry entry = new TrackEntry();
+ entry.animation = animation;
+ entry.loop = loop;
+ entry.time = 0;
+ entry.endTime = animation.Duration;
+
+ TrackEntry last = ExpandToIndex(trackIndex);
+ if (last != null)
+ {
+ while (last.next != null)
+ last = last.next;
+ last.next = entry;
+ }
+ else
+ tracks[trackIndex] = entry;
+
+ if (delay <= 0)
+ {
+ if (last != null)
+ delay += last.endTime - data.GetMix(last.animation, animation);
+ else
+ delay = 0;
+ }
+ entry.delay = delay;
+
+ return entry;
+ }
+
+ /// May be null.
+ public TrackEntry GetCurrent(int trackIndex)
+ {
+ if (trackIndex >= tracks.Count) return null;
+ return tracks[trackIndex];
+ }
+
+ override public String ToString()
+ {
+ StringBuilder buffer = new StringBuilder();
+ for (int i = 0, n = tracks.Count; i < n; i++)
+ {
+ TrackEntry entry = tracks[i];
+ if (entry == null) continue;
+ if (buffer.Length > 0) buffer.Append(", ");
+ buffer.Append(entry.ToString());
+ }
+ if (buffer.Length == 0) return "";
+ return buffer.ToString();
+ }
+ }
+
+ public class TrackEntry
+ {
+ internal TrackEntry next, previous;
+ internal Animation animation;
+ internal bool loop;
+ internal float delay, time, lastTime = -1, endTime, timeScale = 1;
+ internal float mixTime, mixDuration, mix = 1;
+
+ public Animation Animation { get { return animation; } }
+ public float Delay { get { return delay; } set { delay = value; } }
+ public float Time { get { return time; } set { time = value; } }
+ public float LastTime { get { return lastTime; } set { lastTime = value; } }
+ public float EndTime { get { return endTime; } set { endTime = value; } }
+ public float TimeScale { get { return timeScale; } set { timeScale = value; } }
+ public float Mix { get { return mix; } set { mix = value; } }
+ public bool Loop { get { return loop; } set { loop = value; } }
+
+ public event AnimationState.StartEndDelegate Start;
+ public event AnimationState.StartEndDelegate End;
+ public event AnimationState.EventDelegate Event;
+ public event AnimationState.CompleteDelegate Complete;
+
+ internal void OnStart(AnimationState state, int index)
+ {
+ if (Start != null) Start(state, index);
+ }
+
+ internal void OnEnd(AnimationState state, int index)
+ {
+ if (End != null) End(state, index);
+ }
+
+ internal void OnEvent(AnimationState state, int index, Event e)
+ {
+ if (Event != null) Event(state, index, e);
+ }
+
+ internal void OnComplete(AnimationState state, int index, int loopCount)
+ {
+ if (Complete != null) Complete(state, index, loopCount);
+ }
+
+ override public String ToString()
+ {
+ return animation == null ? "" : animation.name;
+ }
+ }
}
diff --git a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/AnimationStateData.cs b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/AnimationStateData.cs
index c157c0a..6b47b0c 100644
--- a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/AnimationStateData.cs
+++ b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/AnimationStateData.cs
@@ -31,40 +31,46 @@
using System;
using System.Collections.Generic;
-namespace Spine2_1_08 {
- public class AnimationStateData {
- internal SkeletonData skeletonData;
- private Dictionary, float> animationToMixTime = new Dictionary, float>();
- internal float defaultMix;
+namespace Spine2_1_08
+{
+ public class AnimationStateData
+ {
+ internal SkeletonData skeletonData;
+ private Dictionary, float> animationToMixTime = new Dictionary, float>();
+ internal float defaultMix;
- public SkeletonData SkeletonData { get { return skeletonData; } }
- public float DefaultMix { get { return defaultMix; } set { defaultMix = value; } }
+ public SkeletonData SkeletonData { get { return skeletonData; } }
+ public float DefaultMix { get { return defaultMix; } set { defaultMix = value; } }
- public AnimationStateData (SkeletonData skeletonData) {
- this.skeletonData = skeletonData;
- }
+ public AnimationStateData(SkeletonData skeletonData)
+ {
+ this.skeletonData = skeletonData;
+ }
- public void SetMix (String fromName, String toName, float duration) {
- Animation from = skeletonData.FindAnimation(fromName);
- if (from == null) throw new ArgumentException("Animation not found: " + fromName);
- Animation to = skeletonData.FindAnimation(toName);
- if (to == null) throw new ArgumentException("Animation not found: " + toName);
- SetMix(from, to, duration);
- }
+ public void SetMix(String fromName, String toName, float duration)
+ {
+ Animation from = skeletonData.FindAnimation(fromName);
+ if (from == null) throw new ArgumentException("Animation not found: " + fromName);
+ Animation to = skeletonData.FindAnimation(toName);
+ if (to == null) throw new ArgumentException("Animation not found: " + toName);
+ SetMix(from, to, duration);
+ }
- public void SetMix (Animation from, Animation to, float duration) {
- if (from == null) throw new ArgumentNullException("from cannot be null.");
- if (to == null) throw new ArgumentNullException("to cannot be null.");
- KeyValuePair key = new KeyValuePair(from, to);
- animationToMixTime.Remove(key);
- animationToMixTime.Add(key, duration);
- }
+ public void SetMix(Animation from, Animation to, float duration)
+ {
+ if (from == null) throw new ArgumentNullException("from cannot be null.");
+ if (to == null) throw new ArgumentNullException("to cannot be null.");
+ KeyValuePair key = new KeyValuePair(from, to);
+ animationToMixTime.Remove(key);
+ animationToMixTime.Add(key, duration);
+ }
- public float GetMix (Animation from, Animation to) {
- KeyValuePair key = new KeyValuePair(from, to);
- float duration;
- if (animationToMixTime.TryGetValue(key, out duration)) return duration;
- return defaultMix;
- }
- }
+ public float GetMix(Animation from, Animation to)
+ {
+ KeyValuePair key = new KeyValuePair(from, to);
+ float duration;
+ if (animationToMixTime.TryGetValue(key, out duration)) return duration;
+ return defaultMix;
+ }
+ }
}
diff --git a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Atlas.cs b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Atlas.cs
index 72549e0..484fd94 100644
--- a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Atlas.cs
+++ b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Atlas.cs
@@ -31,18 +31,19 @@
using System;
using System.Collections.Generic;
using System.IO;
-using System.Reflection;
#if WINDOWS_STOREAPP
using System.Threading.Tasks;
using Windows.Storage;
#endif
-namespace Spine2_1_08 {
- public class Atlas {
- List pages = new List();
- List regions = new List();
- TextureLoader textureLoader;
+namespace Spine2_1_08
+{
+ public class Atlas
+ {
+ List pages = new List();
+ List regions = new List();
+ TextureLoader textureLoader;
#if WINDOWS_STOREAPP
private async Task ReadFile(string path, TextureLoader textureLoader) {
@@ -61,228 +62,259 @@ public Atlas(String path, TextureLoader textureLoader) {
this.ReadFile(path, textureLoader).Wait();
}
#else
- public Atlas (String path, TextureLoader textureLoader) {
+ public Atlas(String path, TextureLoader textureLoader)
+ {
#if WINDOWS_PHONE
Stream stream = Microsoft.Xna.Framework.TitleContainer.OpenStream(path);
using (StreamReader reader = new StreamReader(stream))
{
#else
- using (StreamReader reader = new StreamReader(path)) {
+ using (StreamReader reader = new StreamReader(path))
+ {
#endif
- try {
- Load(reader, Path.GetDirectoryName(path), textureLoader);
- } catch (Exception ex) {
- throw new Exception("Error reading atlas file: " + path, ex);
- }
- }
- }
+ try
+ {
+ Load(reader, Path.GetDirectoryName(path), textureLoader);
+ }
+ catch (Exception ex)
+ {
+ throw new Exception("Error reading atlas file: " + path, ex);
+ }
+ }
+ }
#endif
- public Atlas (TextReader reader, String dir, TextureLoader textureLoader) {
- Load(reader, dir, textureLoader);
- }
-
- public Atlas (List pages, List regions) {
- this.pages = pages;
- this.regions = regions;
- this.textureLoader = null;
- }
-
- private void Load (TextReader reader, String imagesDir, TextureLoader textureLoader) {
- if (textureLoader == null) throw new ArgumentNullException("textureLoader cannot be null.");
- this.textureLoader = textureLoader;
-
- String[] tuple = new String[4];
- AtlasPage page = null;
- while (true) {
- String line = reader.ReadLine();
- if (line == null) break;
- if (line.Trim().Length == 0)
- page = null;
- else if (page == null) {
- page = new AtlasPage();
- page.name = line;
-
- if (readTuple(reader, tuple) == 2) { // size is only optional for an atlas packed with an old TexturePacker.
- page.width = int.Parse(tuple[0]);
- page.height = int.Parse(tuple[1]);
- readTuple(reader, tuple);
- }
- page.format = (Format)Enum.Parse(typeof(Format), tuple[0], false);
-
- readTuple(reader, tuple);
- page.minFilter = (TextureFilter)Enum.Parse(typeof(TextureFilter), tuple[0], false);
- page.magFilter = (TextureFilter)Enum.Parse(typeof(TextureFilter), tuple[1], false);
-
- String direction = readValue(reader);
- page.uWrap = TextureWrap.ClampToEdge;
- page.vWrap = TextureWrap.ClampToEdge;
- if (direction == "x")
- page.uWrap = TextureWrap.Repeat;
- else if (direction == "y")
- page.vWrap = TextureWrap.Repeat;
- else if (direction == "xy")
- page.uWrap = page.vWrap = TextureWrap.Repeat;
-
- textureLoader.Load(page, Path.Combine(imagesDir, line));
-
- pages.Add(page);
-
- } else {
- AtlasRegion region = new AtlasRegion();
- region.name = line;
- region.page = page;
-
- region.rotate = Boolean.Parse(readValue(reader));
-
- readTuple(reader, tuple);
- int x = int.Parse(tuple[0]);
- int y = int.Parse(tuple[1]);
-
- readTuple(reader, tuple);
- int width = int.Parse(tuple[0]);
- int height = int.Parse(tuple[1]);
-
- region.u = x / (float)page.width;
- region.v = y / (float)page.height;
- if (region.rotate) {
- region.u2 = (x + height) / (float)page.width;
- region.v2 = (y + width) / (float)page.height;
- } else {
- region.u2 = (x + width) / (float)page.width;
- region.v2 = (y + height) / (float)page.height;
- }
- region.x = x;
- region.y = y;
- region.width = Math.Abs(width);
- region.height = Math.Abs(height);
-
- if (readTuple(reader, tuple) == 4) { // split is optional
- region.splits = new int[] {int.Parse(tuple[0]), int.Parse(tuple[1]),
- int.Parse(tuple[2]), int.Parse(tuple[3])};
-
- if (readTuple(reader, tuple) == 4) { // pad is optional, but only present with splits
- region.pads = new int[] {int.Parse(tuple[0]), int.Parse(tuple[1]),
- int.Parse(tuple[2]), int.Parse(tuple[3])};
-
- readTuple(reader, tuple);
- }
- }
-
- region.originalWidth = int.Parse(tuple[0]);
- region.originalHeight = int.Parse(tuple[1]);
-
- readTuple(reader, tuple);
- region.offsetX = int.Parse(tuple[0]);
- region.offsetY = int.Parse(tuple[1]);
-
- region.index = int.Parse(readValue(reader));
-
- regions.Add(region);
- }
- }
- }
-
- static String readValue (TextReader reader) {
- String line = reader.ReadLine();
- int colon = line.IndexOf(':');
- if (colon == -1) throw new Exception("Invalid line: " + line);
- return line.Substring(colon + 1).Trim();
- }
-
- /// Returns the number of tuple values read (1, 2 or 4).
- static int readTuple (TextReader reader, String[] tuple) {
- String line = reader.ReadLine();
- int colon = line.IndexOf(':');
- if (colon == -1) throw new Exception("Invalid line: " + line);
- int i = 0, lastMatch = colon + 1;
- for (; i < 3; i++) {
- int comma = line.IndexOf(',', lastMatch);
- if (comma == -1) break;
- tuple[i] = line.Substring(lastMatch, comma - lastMatch).Trim();
- lastMatch = comma + 1;
- }
- tuple[i] = line.Substring(lastMatch).Trim();
- return i + 1;
- }
-
- public void FlipV () {
- for (int i = 0, n = regions.Count; i < n; i++) {
- AtlasRegion region = regions[i];
- region.v = 1 - region.v;
- region.v2 = 1 - region.v2;
- }
- }
-
- /// Returns the first region found with the specified name. This method uses string comparison to find the region, so the result
- /// should be cached rather than calling this method multiple times.
- /// The region, or null.
- public AtlasRegion FindRegion (String name) {
- for (int i = 0, n = regions.Count; i < n; i++)
- if (regions[i].name == name) return regions[i];
- return null;
- }
-
- public void Dispose () {
- if (textureLoader == null) return;
- for (int i = 0, n = pages.Count; i < n; i++)
- textureLoader.Unload(pages[i].rendererObject);
- }
- }
-
- public enum Format {
- Alpha,
- Intensity,
- LuminanceAlpha,
- RGB565,
- RGBA4444,
- RGB888,
- RGBA8888
- }
-
- public enum TextureFilter {
- Nearest,
- Linear,
- MipMap,
- MipMapNearestNearest,
- MipMapLinearNearest,
- MipMapNearestLinear,
- MipMapLinearLinear
- }
-
- public enum TextureWrap {
- MirroredRepeat,
- ClampToEdge,
- Repeat
- }
-
- public class AtlasPage {
- public String name;
- public Format format;
- public TextureFilter minFilter;
- public TextureFilter magFilter;
- public TextureWrap uWrap;
- public TextureWrap vWrap;
- public Object rendererObject;
- public int width, height;
- }
-
- public class AtlasRegion {
- public AtlasPage page;
- public String name;
- public int x, y, width, height;
- public float u, v, u2, v2;
- public float offsetX, offsetY;
- public int originalWidth, originalHeight;
- public int index;
- public bool rotate;
- public int[] splits;
- public int[] pads;
- }
-
- public interface TextureLoader {
- void Load (AtlasPage page, String path);
- void Unload (Object texture);
- }
+ public Atlas(TextReader reader, String dir, TextureLoader textureLoader)
+ {
+ Load(reader, dir, textureLoader);
+ }
+
+ public Atlas(List pages, List regions)
+ {
+ this.pages = pages;
+ this.regions = regions;
+ this.textureLoader = null;
+ }
+
+ private void Load(TextReader reader, String imagesDir, TextureLoader textureLoader)
+ {
+ if (textureLoader == null) throw new ArgumentNullException("textureLoader cannot be null.");
+ this.textureLoader = textureLoader;
+
+ String[] tuple = new String[4];
+ AtlasPage page = null;
+ while (true)
+ {
+ String line = reader.ReadLine();
+ if (line == null) break;
+ if (line.Trim().Length == 0)
+ page = null;
+ else if (page == null)
+ {
+ page = new AtlasPage();
+ page.name = line;
+
+ if (readTuple(reader, tuple) == 2)
+ { // size is only optional for an atlas packed with an old TexturePacker.
+ page.width = int.Parse(tuple[0]);
+ page.height = int.Parse(tuple[1]);
+ readTuple(reader, tuple);
+ }
+ page.format = (Format)Enum.Parse(typeof(Format), tuple[0], false);
+
+ readTuple(reader, tuple);
+ page.minFilter = (TextureFilter)Enum.Parse(typeof(TextureFilter), tuple[0], false);
+ page.magFilter = (TextureFilter)Enum.Parse(typeof(TextureFilter), tuple[1], false);
+
+ String direction = readValue(reader);
+ page.uWrap = TextureWrap.ClampToEdge;
+ page.vWrap = TextureWrap.ClampToEdge;
+ if (direction == "x")
+ page.uWrap = TextureWrap.Repeat;
+ else if (direction == "y")
+ page.vWrap = TextureWrap.Repeat;
+ else if (direction == "xy")
+ page.uWrap = page.vWrap = TextureWrap.Repeat;
+
+ textureLoader.Load(page, Path.Combine(imagesDir, line));
+
+ pages.Add(page);
+
+ }
+ else
+ {
+ AtlasRegion region = new AtlasRegion();
+ region.name = line;
+ region.page = page;
+
+ region.rotate = Boolean.Parse(readValue(reader));
+
+ readTuple(reader, tuple);
+ int x = int.Parse(tuple[0]);
+ int y = int.Parse(tuple[1]);
+
+ readTuple(reader, tuple);
+ int width = int.Parse(tuple[0]);
+ int height = int.Parse(tuple[1]);
+
+ region.u = x / (float)page.width;
+ region.v = y / (float)page.height;
+ if (region.rotate)
+ {
+ region.u2 = (x + height) / (float)page.width;
+ region.v2 = (y + width) / (float)page.height;
+ }
+ else
+ {
+ region.u2 = (x + width) / (float)page.width;
+ region.v2 = (y + height) / (float)page.height;
+ }
+ region.x = x;
+ region.y = y;
+ region.width = Math.Abs(width);
+ region.height = Math.Abs(height);
+
+ if (readTuple(reader, tuple) == 4)
+ { // split is optional
+ region.splits = new int[] {int.Parse(tuple[0]), int.Parse(tuple[1]),
+ int.Parse(tuple[2]), int.Parse(tuple[3])};
+
+ if (readTuple(reader, tuple) == 4)
+ { // pad is optional, but only present with splits
+ region.pads = new int[] {int.Parse(tuple[0]), int.Parse(tuple[1]),
+ int.Parse(tuple[2]), int.Parse(tuple[3])};
+
+ readTuple(reader, tuple);
+ }
+ }
+
+ region.originalWidth = int.Parse(tuple[0]);
+ region.originalHeight = int.Parse(tuple[1]);
+
+ readTuple(reader, tuple);
+ region.offsetX = int.Parse(tuple[0]);
+ region.offsetY = int.Parse(tuple[1]);
+
+ region.index = int.Parse(readValue(reader));
+
+ regions.Add(region);
+ }
+ }
+ }
+
+ static String readValue(TextReader reader)
+ {
+ String line = reader.ReadLine();
+ int colon = line.IndexOf(':');
+ if (colon == -1) throw new Exception("Invalid line: " + line);
+ return line.Substring(colon + 1).Trim();
+ }
+
+ /// Returns the number of tuple values read (1, 2 or 4).
+ static int readTuple(TextReader reader, String[] tuple)
+ {
+ String line = reader.ReadLine();
+ int colon = line.IndexOf(':');
+ if (colon == -1) throw new Exception("Invalid line: " + line);
+ int i = 0, lastMatch = colon + 1;
+ for (; i < 3; i++)
+ {
+ int comma = line.IndexOf(',', lastMatch);
+ if (comma == -1) break;
+ tuple[i] = line.Substring(lastMatch, comma - lastMatch).Trim();
+ lastMatch = comma + 1;
+ }
+ tuple[i] = line.Substring(lastMatch).Trim();
+ return i + 1;
+ }
+
+ public void FlipV()
+ {
+ for (int i = 0, n = regions.Count; i < n; i++)
+ {
+ AtlasRegion region = regions[i];
+ region.v = 1 - region.v;
+ region.v2 = 1 - region.v2;
+ }
+ }
+
+ /// Returns the first region found with the specified name. This method uses string comparison to find the region, so the result
+ /// should be cached rather than calling this method multiple times.
+ /// The region, or null.
+ public AtlasRegion FindRegion(String name)
+ {
+ for (int i = 0, n = regions.Count; i < n; i++)
+ if (regions[i].name == name) return regions[i];
+ return null;
+ }
+
+ public void Dispose()
+ {
+ if (textureLoader == null) return;
+ for (int i = 0, n = pages.Count; i < n; i++)
+ textureLoader.Unload(pages[i].rendererObject);
+ }
+ }
+
+ public enum Format
+ {
+ Alpha,
+ Intensity,
+ LuminanceAlpha,
+ RGB565,
+ RGBA4444,
+ RGB888,
+ RGBA8888
+ }
+
+ public enum TextureFilter
+ {
+ Nearest,
+ Linear,
+ MipMap,
+ MipMapNearestNearest,
+ MipMapLinearNearest,
+ MipMapNearestLinear,
+ MipMapLinearLinear
+ }
+
+ public enum TextureWrap
+ {
+ MirroredRepeat,
+ ClampToEdge,
+ Repeat
+ }
+
+ public class AtlasPage
+ {
+ public String name;
+ public Format format;
+ public TextureFilter minFilter;
+ public TextureFilter magFilter;
+ public TextureWrap uWrap;
+ public TextureWrap vWrap;
+ public Object rendererObject;
+ public int width, height;
+ }
+
+ public class AtlasRegion
+ {
+ public AtlasPage page;
+ public String name;
+ public int x, y, width, height;
+ public float u, v, u2, v2;
+ public float offsetX, offsetY;
+ public int originalWidth, originalHeight;
+ public int index;
+ public bool rotate;
+ public int[] splits;
+ public int[] pads;
+ }
+
+ public interface TextureLoader
+ {
+ void Load(AtlasPage page, String path);
+ void Unload(Object texture);
+ }
}
diff --git a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/AtlasAttachmentLoader.cs b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/AtlasAttachmentLoader.cs
index bcc0fc2..9e6ee73 100644
--- a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/AtlasAttachmentLoader.cs
+++ b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/AtlasAttachmentLoader.cs
@@ -30,70 +30,77 @@
using System;
-namespace Spine2_1_08 {
- public class AtlasAttachmentLoader : AttachmentLoader {
- private Atlas atlas;
+namespace Spine2_1_08
+{
+ public class AtlasAttachmentLoader : AttachmentLoader
+ {
+ private Atlas atlas;
- public AtlasAttachmentLoader (Atlas atlas) {
- if (atlas == null) throw new ArgumentNullException("atlas cannot be null.");
- this.atlas = atlas;
- }
+ public AtlasAttachmentLoader(Atlas atlas)
+ {
+ if (atlas == null) throw new ArgumentNullException("atlas cannot be null.");
+ this.atlas = atlas;
+ }
- public RegionAttachment NewRegionAttachment (Skin skin, String name, String path) {
- AtlasRegion region = atlas.FindRegion(path);
- if (region == null) throw new Exception("Region not found in atlas: " + path + " (region attachment: " + name + ")");
- RegionAttachment attachment = new RegionAttachment(name);
- attachment.RendererObject = region;
- attachment.SetUVs(region.u, region.v, region.u2, region.v2, region.rotate);
- attachment.regionOffsetX = region.offsetX;
- attachment.regionOffsetY = region.offsetY;
- attachment.regionWidth = region.width;
- attachment.regionHeight = region.height;
- attachment.regionOriginalWidth = region.originalWidth;
- attachment.regionOriginalHeight = region.originalHeight;
- return attachment;
- }
+ public RegionAttachment NewRegionAttachment(Skin skin, String name, String path)
+ {
+ AtlasRegion region = atlas.FindRegion(path);
+ if (region == null) throw new Exception("Region not found in atlas: " + path + " (region attachment: " + name + ")");
+ RegionAttachment attachment = new RegionAttachment(name);
+ attachment.RendererObject = region;
+ attachment.SetUVs(region.u, region.v, region.u2, region.v2, region.rotate);
+ attachment.regionOffsetX = region.offsetX;
+ attachment.regionOffsetY = region.offsetY;
+ attachment.regionWidth = region.width;
+ attachment.regionHeight = region.height;
+ attachment.regionOriginalWidth = region.originalWidth;
+ attachment.regionOriginalHeight = region.originalHeight;
+ return attachment;
+ }
- public MeshAttachment NewMeshAttachment (Skin skin, String name, String path) {
- AtlasRegion region = atlas.FindRegion(path);
- if (region == null) throw new Exception("Region not found in atlas: " + path + " (mesh attachment: " + name + ")");
- MeshAttachment attachment = new MeshAttachment(name);
- attachment.RendererObject = region;
- attachment.RegionU = region.u;
- attachment.RegionV = region.v;
- attachment.RegionU2 = region.u2;
- attachment.RegionV2 = region.v2;
- attachment.RegionRotate = region.rotate;
- attachment.regionOffsetX = region.offsetX;
- attachment.regionOffsetY = region.offsetY;
- attachment.regionWidth = region.width;
- attachment.regionHeight = region.height;
- attachment.regionOriginalWidth = region.originalWidth;
- attachment.regionOriginalHeight = region.originalHeight;
- return attachment;
- }
+ public MeshAttachment NewMeshAttachment(Skin skin, String name, String path)
+ {
+ AtlasRegion region = atlas.FindRegion(path);
+ if (region == null) throw new Exception("Region not found in atlas: " + path + " (mesh attachment: " + name + ")");
+ MeshAttachment attachment = new MeshAttachment(name);
+ attachment.RendererObject = region;
+ attachment.RegionU = region.u;
+ attachment.RegionV = region.v;
+ attachment.RegionU2 = region.u2;
+ attachment.RegionV2 = region.v2;
+ attachment.RegionRotate = region.rotate;
+ attachment.regionOffsetX = region.offsetX;
+ attachment.regionOffsetY = region.offsetY;
+ attachment.regionWidth = region.width;
+ attachment.regionHeight = region.height;
+ attachment.regionOriginalWidth = region.originalWidth;
+ attachment.regionOriginalHeight = region.originalHeight;
+ return attachment;
+ }
- public SkinnedMeshAttachment NewSkinnedMeshAttachment (Skin skin, String name, String path) {
- AtlasRegion region = atlas.FindRegion(path);
- if (region == null) throw new Exception("Region not found in atlas: " + path + " (skinned mesh attachment: " + name + ")");
- SkinnedMeshAttachment attachment = new SkinnedMeshAttachment(name);
- attachment.RendererObject = region;
- attachment.RegionU = region.u;
- attachment.RegionV = region.v;
- attachment.RegionU2 = region.u2;
- attachment.RegionV2 = region.v2;
- attachment.RegionRotate = region.rotate;
- attachment.regionOffsetX = region.offsetX;
- attachment.regionOffsetY = region.offsetY;
- attachment.regionWidth = region.width;
- attachment.regionHeight = region.height;
- attachment.regionOriginalWidth = region.originalWidth;
- attachment.regionOriginalHeight = region.originalHeight;
- return attachment;
- }
+ public SkinnedMeshAttachment NewSkinnedMeshAttachment(Skin skin, String name, String path)
+ {
+ AtlasRegion region = atlas.FindRegion(path);
+ if (region == null) throw new Exception("Region not found in atlas: " + path + " (skinned mesh attachment: " + name + ")");
+ SkinnedMeshAttachment attachment = new SkinnedMeshAttachment(name);
+ attachment.RendererObject = region;
+ attachment.RegionU = region.u;
+ attachment.RegionV = region.v;
+ attachment.RegionU2 = region.u2;
+ attachment.RegionV2 = region.v2;
+ attachment.RegionRotate = region.rotate;
+ attachment.regionOffsetX = region.offsetX;
+ attachment.regionOffsetY = region.offsetY;
+ attachment.regionWidth = region.width;
+ attachment.regionHeight = region.height;
+ attachment.regionOriginalWidth = region.originalWidth;
+ attachment.regionOriginalHeight = region.originalHeight;
+ return attachment;
+ }
- public BoundingBoxAttachment NewBoundingBoxAttachment (Skin skin, String name) {
- return new BoundingBoxAttachment(name);
- }
- }
+ public BoundingBoxAttachment NewBoundingBoxAttachment(Skin skin, String name)
+ {
+ return new BoundingBoxAttachment(name);
+ }
+ }
}
diff --git a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/Attachment.cs b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/Attachment.cs
index f5deec5..9f719da 100644
--- a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/Attachment.cs
+++ b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/Attachment.cs
@@ -30,17 +30,21 @@
using System;
-namespace Spine2_1_08 {
- abstract public class Attachment {
- public String Name { get; private set; }
+namespace Spine2_1_08
+{
+ abstract public class Attachment
+ {
+ public String Name { get; private set; }
- public Attachment (String name) {
- if (name == null) throw new ArgumentNullException("name cannot be null.");
- Name = name;
- }
+ public Attachment(String name)
+ {
+ if (name == null) throw new ArgumentNullException("name cannot be null.");
+ Name = name;
+ }
- override public String ToString () {
- return Name;
- }
- }
+ override public String ToString()
+ {
+ return Name;
+ }
+ }
}
diff --git a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/AttachmentLoader.cs b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/AttachmentLoader.cs
index 73e6c5c..db83f10 100644
--- a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/AttachmentLoader.cs
+++ b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/AttachmentLoader.cs
@@ -30,18 +30,20 @@
using System;
-namespace Spine2_1_08 {
- public interface AttachmentLoader {
- /// May be null to not load any attachment.
- RegionAttachment NewRegionAttachment (Skin skin, String name, String path);
+namespace Spine2_1_08
+{
+ public interface AttachmentLoader
+ {
+ /// May be null to not load any attachment.
+ RegionAttachment NewRegionAttachment(Skin skin, String name, String path);
- /// May be null to not load any attachment.
- MeshAttachment NewMeshAttachment (Skin skin, String name, String path);
+ /// May be null to not load any attachment.
+ MeshAttachment NewMeshAttachment(Skin skin, String name, String path);
- /// May be null to not load any attachment.
- SkinnedMeshAttachment NewSkinnedMeshAttachment (Skin skin, String name, String path);
+ /// May be null to not load any attachment.
+ SkinnedMeshAttachment NewSkinnedMeshAttachment(Skin skin, String name, String path);
- /// May be null to not load any attachment.
- BoundingBoxAttachment NewBoundingBoxAttachment (Skin skin, String name);
- }
+ /// May be null to not load any attachment.
+ BoundingBoxAttachment NewBoundingBoxAttachment(Skin skin, String name);
+ }
}
diff --git a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/AttachmentType.cs b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/AttachmentType.cs
index e240b72..c84ea86 100644
--- a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/AttachmentType.cs
+++ b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/AttachmentType.cs
@@ -28,8 +28,10 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
-namespace Spine2_1_08 {
- public enum AttachmentType {
- region, boundingbox, mesh, skinnedmesh
- }
+namespace Spine2_1_08
+{
+ public enum AttachmentType
+ {
+ region, boundingbox, mesh, skinnedmesh
+ }
}
diff --git a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/BoundingBoxAttachment.cs b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/BoundingBoxAttachment.cs
index 3edfd2f..f4cebf0 100644
--- a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/BoundingBoxAttachment.cs
+++ b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/BoundingBoxAttachment.cs
@@ -28,33 +28,36 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
-using System;
+namespace Spine2_1_08
+{
+ /// Attachment that has a polygon for bounds checking.
+ public class BoundingBoxAttachment : Attachment
+ {
+ internal float[] vertices;
-namespace Spine2_1_08 {
- /// Attachment that has a polygon for bounds checking.
- public class BoundingBoxAttachment : Attachment {
- internal float[] vertices;
+ public float[] Vertices { get { return vertices; } set { vertices = value; } }
- public float[] Vertices { get { return vertices; } set { vertices = value; } }
+ public BoundingBoxAttachment(string name)
+ : base(name)
+ {
+ }
- public BoundingBoxAttachment (string name)
- : base(name) {
- }
-
- /// Must have at least the same length as this attachment's vertices.
- public void ComputeWorldVertices (Bone bone, float[] worldVertices) {
- float x = bone.skeleton.x + bone.worldX, y = bone.skeleton.y + bone.worldY;
- float m00 = bone.m00;
- float m01 = bone.m01;
- float m10 = bone.m10;
- float m11 = bone.m11;
- float[] vertices = this.vertices;
- for (int i = 0, n = vertices.Length; i < n; i += 2) {
- float px = vertices[i];
- float py = vertices[i + 1];
- worldVertices[i] = px * m00 + py * m01 + x;
- worldVertices[i + 1] = px * m10 + py * m11 + y;
- }
- }
- }
+ /// Must have at least the same length as this attachment's vertices.
+ public void ComputeWorldVertices(Bone bone, float[] worldVertices)
+ {
+ float x = bone.skeleton.x + bone.worldX, y = bone.skeleton.y + bone.worldY;
+ float m00 = bone.m00;
+ float m01 = bone.m01;
+ float m10 = bone.m10;
+ float m11 = bone.m11;
+ float[] vertices = this.vertices;
+ for (int i = 0, n = vertices.Length; i < n; i += 2)
+ {
+ float px = vertices[i];
+ float py = vertices[i + 1];
+ worldVertices[i] = px * m00 + py * m01 + x;
+ worldVertices[i + 1] = px * m10 + py * m11 + y;
+ }
+ }
+ }
}
diff --git a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/MeshAttachment.cs b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/MeshAttachment.cs
index 349999d..96c8671 100644
--- a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/MeshAttachment.cs
+++ b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/MeshAttachment.cs
@@ -30,79 +30,90 @@
using System;
-namespace Spine2_1_08 {
- /// Attachment that displays a texture region.
- public class MeshAttachment : Attachment {
- internal float[] vertices, uvs, regionUVs;
- internal int[] triangles;
- internal float regionOffsetX, regionOffsetY, regionWidth, regionHeight, regionOriginalWidth, regionOriginalHeight;
- internal float r = 1, g = 1, b = 1, a = 1;
+namespace Spine2_1_08
+{
+ /// Attachment that displays a texture region.
+ public class MeshAttachment : Attachment
+ {
+ internal float[] vertices, uvs, regionUVs;
+ internal int[] triangles;
+ internal float regionOffsetX, regionOffsetY, regionWidth, regionHeight, regionOriginalWidth, regionOriginalHeight;
+ internal float r = 1, g = 1, b = 1, a = 1;
- public int HullLength { get; set; }
- public float[] Vertices { get { return vertices; } set { vertices = value; } }
- public float[] RegionUVs { get { return regionUVs; } set { regionUVs = value; } }
- public float[] UVs { get { return uvs; } set { uvs = value; } }
- public int[] Triangles { get { return triangles; } set { triangles = value; } }
+ public int HullLength { get; set; }
+ public float[] Vertices { get { return vertices; } set { vertices = value; } }
+ public float[] RegionUVs { get { return regionUVs; } set { regionUVs = value; } }
+ public float[] UVs { get { return uvs; } set { uvs = value; } }
+ public int[] Triangles { get { return triangles; } set { triangles = value; } }
- public float R { get { return r; } set { r = value; } }
- public float G { get { return g; } set { g = value; } }
- public float B { get { return b; } set { b = value; } }
- public float A { get { return a; } set { a = value; } }
+ public float R { get { return r; } set { r = value; } }
+ public float G { get { return g; } set { g = value; } }
+ public float B { get { return b; } set { b = value; } }
+ public float A { get { return a; } set { a = value; } }
- public String Path { get; set; }
- public Object RendererObject { get; set; }
- public float RegionU { get; set; }
- public float RegionV { get; set; }
- public float RegionU2 { get; set; }
- public float RegionV2 { get; set; }
- public bool RegionRotate { get; set; }
- public float RegionOffsetX { get { return regionOffsetX; } set { regionOffsetX = value; } }
- public float RegionOffsetY { get { return regionOffsetY; } set { regionOffsetY = value; } } // Pixels stripped from the bottom left, unrotated.
- public float RegionWidth { get { return regionWidth; } set { regionWidth = value; } }
- public float RegionHeight { get { return regionHeight; } set { regionHeight = value; } } // Unrotated, stripped size.
- public float RegionOriginalWidth { get { return regionOriginalWidth; } set { regionOriginalWidth = value; } }
- public float RegionOriginalHeight { get { return regionOriginalHeight; } set { regionOriginalHeight = value; } } // Unrotated, unstripped size.
+ public String Path { get; set; }
+ public Object RendererObject { get; set; }
+ public float RegionU { get; set; }
+ public float RegionV { get; set; }
+ public float RegionU2 { get; set; }
+ public float RegionV2 { get; set; }
+ public bool RegionRotate { get; set; }
+ public float RegionOffsetX { get { return regionOffsetX; } set { regionOffsetX = value; } }
+ public float RegionOffsetY { get { return regionOffsetY; } set { regionOffsetY = value; } } // Pixels stripped from the bottom left, unrotated.
+ public float RegionWidth { get { return regionWidth; } set { regionWidth = value; } }
+ public float RegionHeight { get { return regionHeight; } set { regionHeight = value; } } // Unrotated, stripped size.
+ public float RegionOriginalWidth { get { return regionOriginalWidth; } set { regionOriginalWidth = value; } }
+ public float RegionOriginalHeight { get { return regionOriginalHeight; } set { regionOriginalHeight = value; } } // Unrotated, unstripped size.
- // Nonessential.
- public int[] Edges { get; set; }
- public float Width { get; set; }
- public float Height { get; set; }
+ // Nonessential.
+ public int[] Edges { get; set; }
+ public float Width { get; set; }
+ public float Height { get; set; }
- public MeshAttachment (string name)
- : base(name) {
- }
+ public MeshAttachment(string name)
+ : base(name)
+ {
+ }
- public void UpdateUVs () {
- float u = RegionU, v = RegionV, width = RegionU2 - RegionU, height = RegionV2 - RegionV;
- float[] regionUVs = this.regionUVs;
- if (this.uvs == null || this.uvs.Length != regionUVs.Length) this.uvs = new float[regionUVs.Length];
- float[] uvs = this.uvs;
- if (RegionRotate) {
- for (int i = 0, n = uvs.Length; i < n; i += 2) {
- uvs[i] = u + regionUVs[i + 1] * width;
- uvs[i + 1] = v + height - regionUVs[i] * height;
- }
- } else {
- for (int i = 0, n = uvs.Length; i < n; i += 2) {
- uvs[i] = u + regionUVs[i] * width;
- uvs[i + 1] = v + regionUVs[i + 1] * height;
- }
- }
- }
+ public void UpdateUVs()
+ {
+ float u = RegionU, v = RegionV, width = RegionU2 - RegionU, height = RegionV2 - RegionV;
+ float[] regionUVs = this.regionUVs;
+ if (this.uvs == null || this.uvs.Length != regionUVs.Length) this.uvs = new float[regionUVs.Length];
+ float[] uvs = this.uvs;
+ if (RegionRotate)
+ {
+ for (int i = 0, n = uvs.Length; i < n; i += 2)
+ {
+ uvs[i] = u + regionUVs[i + 1] * width;
+ uvs[i + 1] = v + height - regionUVs[i] * height;
+ }
+ }
+ else
+ {
+ for (int i = 0, n = uvs.Length; i < n; i += 2)
+ {
+ uvs[i] = u + regionUVs[i] * width;
+ uvs[i + 1] = v + regionUVs[i + 1] * height;
+ }
+ }
+ }
- public void ComputeWorldVertices (Slot slot, float[] worldVertices) {
- Bone bone = slot.bone;
- float x = bone.skeleton.x + bone.worldX, y = bone.skeleton.y + bone.worldY;
- float m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11;
- float[] vertices = this.vertices;
- int verticesCount = vertices.Length;
- if (slot.attachmentVerticesCount == verticesCount) vertices = slot.AttachmentVertices;
- for (int i = 0; i < verticesCount; i += 2) {
- float vx = vertices[i];
- float vy = vertices[i + 1];
- worldVertices[i] = vx * m00 + vy * m01 + x;
- worldVertices[i + 1] = vx * m10 + vy * m11 + y;
- }
- }
- }
+ public void ComputeWorldVertices(Slot slot, float[] worldVertices)
+ {
+ Bone bone = slot.bone;
+ float x = bone.skeleton.x + bone.worldX, y = bone.skeleton.y + bone.worldY;
+ float m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11;
+ float[] vertices = this.vertices;
+ int verticesCount = vertices.Length;
+ if (slot.attachmentVerticesCount == verticesCount) vertices = slot.AttachmentVertices;
+ for (int i = 0; i < verticesCount; i += 2)
+ {
+ float vx = vertices[i];
+ float vy = vertices[i + 1];
+ worldVertices[i] = vx * m00 + vy * m01 + x;
+ worldVertices[i + 1] = vx * m10 + vy * m11 + y;
+ }
+ }
+ }
}
diff --git a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/RegionAttachment.cs b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/RegionAttachment.cs
index a7678d6..8be3914 100644
--- a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/RegionAttachment.cs
+++ b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/RegionAttachment.cs
@@ -30,122 +30,131 @@
using System;
-namespace Spine2_1_08 {
- /// Attachment that displays a texture region.
- public class RegionAttachment : Attachment {
- public const int X1 = 0;
- public const int Y1 = 1;
- public const int X2 = 2;
- public const int Y2 = 3;
- public const int X3 = 4;
- public const int Y3 = 5;
- public const int X4 = 6;
- public const int Y4 = 7;
+namespace Spine2_1_08
+{
+ /// Attachment that displays a texture region.
+ public class RegionAttachment : Attachment
+ {
+ public const int X1 = 0;
+ public const int Y1 = 1;
+ public const int X2 = 2;
+ public const int Y2 = 3;
+ public const int X3 = 4;
+ public const int Y3 = 5;
+ public const int X4 = 6;
+ public const int Y4 = 7;
- internal float x, y, rotation, scaleX = 1, scaleY = 1, width, height;
- internal float regionOffsetX, regionOffsetY, regionWidth, regionHeight, regionOriginalWidth, regionOriginalHeight;
- internal float[] offset = new float[8], uvs = new float[8];
- internal float r = 1, g = 1, b = 1, a = 1;
+ internal float x, y, rotation, scaleX = 1, scaleY = 1, width, height;
+ internal float regionOffsetX, regionOffsetY, regionWidth, regionHeight, regionOriginalWidth, regionOriginalHeight;
+ internal float[] offset = new float[8], uvs = new float[8];
+ internal float r = 1, g = 1, b = 1, a = 1;
- public float X { get { return x; } set { x = value; } }
- public float Y { get { return y; } set { y = value; } }
- public float Rotation { get { return rotation; } set { rotation = value; } }
- public float ScaleX { get { return scaleX; } set { scaleX = value; } }
- public float ScaleY { get { return scaleY; } set { scaleY = value; } }
- public float Width { get { return width; } set { width = value; } }
- public float Height { get { return height; } set { height = value; } }
+ public float X { get { return x; } set { x = value; } }
+ public float Y { get { return y; } set { y = value; } }
+ public float Rotation { get { return rotation; } set { rotation = value; } }
+ public float ScaleX { get { return scaleX; } set { scaleX = value; } }
+ public float ScaleY { get { return scaleY; } set { scaleY = value; } }
+ public float Width { get { return width; } set { width = value; } }
+ public float Height { get { return height; } set { height = value; } }
- public float R { get { return r; } set { r = value; } }
- public float G { get { return g; } set { g = value; } }
- public float B { get { return b; } set { b = value; } }
- public float A { get { return a; } set { a = value; } }
+ public float R { get { return r; } set { r = value; } }
+ public float G { get { return g; } set { g = value; } }
+ public float B { get { return b; } set { b = value; } }
+ public float A { get { return a; } set { a = value; } }
- public String Path { get; set; }
- public Object RendererObject { get; set; }
- public float RegionOffsetX { get { return regionOffsetX; } set { regionOffsetX = value; } }
- public float RegionOffsetY { get { return regionOffsetY; } set { regionOffsetY = value; } } // Pixels stripped from the bottom left, unrotated.
- public float RegionWidth { get { return regionWidth; } set { regionWidth = value; } }
- public float RegionHeight { get { return regionHeight; } set { regionHeight = value; } } // Unrotated, stripped size.
- public float RegionOriginalWidth { get { return regionOriginalWidth; } set { regionOriginalWidth = value; } }
- public float RegionOriginalHeight { get { return regionOriginalHeight; } set { regionOriginalHeight = value; } } // Unrotated, unstripped size.
+ public String Path { get; set; }
+ public Object RendererObject { get; set; }
+ public float RegionOffsetX { get { return regionOffsetX; } set { regionOffsetX = value; } }
+ public float RegionOffsetY { get { return regionOffsetY; } set { regionOffsetY = value; } } // Pixels stripped from the bottom left, unrotated.
+ public float RegionWidth { get { return regionWidth; } set { regionWidth = value; } }
+ public float RegionHeight { get { return regionHeight; } set { regionHeight = value; } } // Unrotated, stripped size.
+ public float RegionOriginalWidth { get { return regionOriginalWidth; } set { regionOriginalWidth = value; } }
+ public float RegionOriginalHeight { get { return regionOriginalHeight; } set { regionOriginalHeight = value; } } // Unrotated, unstripped size.
- public float[] Offset { get { return offset; } }
- public float[] UVs { get { return uvs; } }
+ public float[] Offset { get { return offset; } }
+ public float[] UVs { get { return uvs; } }
- public RegionAttachment (string name)
- : base(name) {
- }
+ public RegionAttachment(string name)
+ : base(name)
+ {
+ }
- public void SetUVs (float u, float v, float u2, float v2, bool rotate) {
- float[] uvs = this.uvs;
- if (rotate) {
- uvs[X2] = u;
- uvs[Y2] = v2;
- uvs[X3] = u;
- uvs[Y3] = v;
- uvs[X4] = u2;
- uvs[Y4] = v;
- uvs[X1] = u2;
- uvs[Y1] = v2;
- } else {
- uvs[X1] = u;
- uvs[Y1] = v2;
- uvs[X2] = u;
- uvs[Y2] = v;
- uvs[X3] = u2;
- uvs[Y3] = v;
- uvs[X4] = u2;
- uvs[Y4] = v2;
- }
- }
+ public void SetUVs(float u, float v, float u2, float v2, bool rotate)
+ {
+ float[] uvs = this.uvs;
+ if (rotate)
+ {
+ uvs[X2] = u;
+ uvs[Y2] = v2;
+ uvs[X3] = u;
+ uvs[Y3] = v;
+ uvs[X4] = u2;
+ uvs[Y4] = v;
+ uvs[X1] = u2;
+ uvs[Y1] = v2;
+ }
+ else
+ {
+ uvs[X1] = u;
+ uvs[Y1] = v2;
+ uvs[X2] = u;
+ uvs[Y2] = v;
+ uvs[X3] = u2;
+ uvs[Y3] = v;
+ uvs[X4] = u2;
+ uvs[Y4] = v2;
+ }
+ }
- public void UpdateOffset () {
- float width = this.width;
- float height = this.height;
- float scaleX = this.scaleX;
- float scaleY = this.scaleY;
- float regionScaleX = width / regionOriginalWidth * scaleX;
- float regionScaleY = height / regionOriginalHeight * scaleY;
- float localX = -width / 2 * scaleX + regionOffsetX * regionScaleX;
- float localY = -height / 2 * scaleY + regionOffsetY * regionScaleY;
- float localX2 = localX + regionWidth * regionScaleX;
- float localY2 = localY + regionHeight * regionScaleY;
- float radians = rotation * (float)Math.PI / 180;
- float cos = (float)Math.Cos(radians);
- float sin = (float)Math.Sin(radians);
- float x = this.x;
- float y = this.y;
- float localXCos = localX * cos + x;
- float localXSin = localX * sin;
- float localYCos = localY * cos + y;
- float localYSin = localY * sin;
- float localX2Cos = localX2 * cos + x;
- float localX2Sin = localX2 * sin;
- float localY2Cos = localY2 * cos + y;
- float localY2Sin = localY2 * sin;
- float[] offset = this.offset;
- offset[X1] = localXCos - localYSin;
- offset[Y1] = localYCos + localXSin;
- offset[X2] = localXCos - localY2Sin;
- offset[Y2] = localY2Cos + localXSin;
- offset[X3] = localX2Cos - localY2Sin;
- offset[Y3] = localY2Cos + localX2Sin;
- offset[X4] = localX2Cos - localYSin;
- offset[Y4] = localYCos + localX2Sin;
- }
+ public void UpdateOffset()
+ {
+ float width = this.width;
+ float height = this.height;
+ float scaleX = this.scaleX;
+ float scaleY = this.scaleY;
+ float regionScaleX = width / regionOriginalWidth * scaleX;
+ float regionScaleY = height / regionOriginalHeight * scaleY;
+ float localX = -width / 2 * scaleX + regionOffsetX * regionScaleX;
+ float localY = -height / 2 * scaleY + regionOffsetY * regionScaleY;
+ float localX2 = localX + regionWidth * regionScaleX;
+ float localY2 = localY + regionHeight * regionScaleY;
+ float radians = rotation * (float)Math.PI / 180;
+ float cos = (float)Math.Cos(radians);
+ float sin = (float)Math.Sin(radians);
+ float x = this.x;
+ float y = this.y;
+ float localXCos = localX * cos + x;
+ float localXSin = localX * sin;
+ float localYCos = localY * cos + y;
+ float localYSin = localY * sin;
+ float localX2Cos = localX2 * cos + x;
+ float localX2Sin = localX2 * sin;
+ float localY2Cos = localY2 * cos + y;
+ float localY2Sin = localY2 * sin;
+ float[] offset = this.offset;
+ offset[X1] = localXCos - localYSin;
+ offset[Y1] = localYCos + localXSin;
+ offset[X2] = localXCos - localY2Sin;
+ offset[Y2] = localY2Cos + localXSin;
+ offset[X3] = localX2Cos - localY2Sin;
+ offset[Y3] = localY2Cos + localX2Sin;
+ offset[X4] = localX2Cos - localYSin;
+ offset[Y4] = localYCos + localX2Sin;
+ }
- public void ComputeWorldVertices (Bone bone, float[] worldVertices) {
- float x = bone.skeleton.x + bone.worldX, y = bone.skeleton.y + bone.worldY;
- float m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11;
- float[] offset = this.offset;
- worldVertices[X1] = offset[X1] * m00 + offset[Y1] * m01 + x;
- worldVertices[Y1] = offset[X1] * m10 + offset[Y1] * m11 + y;
- worldVertices[X2] = offset[X2] * m00 + offset[Y2] * m01 + x;
- worldVertices[Y2] = offset[X2] * m10 + offset[Y2] * m11 + y;
- worldVertices[X3] = offset[X3] * m00 + offset[Y3] * m01 + x;
- worldVertices[Y3] = offset[X3] * m10 + offset[Y3] * m11 + y;
- worldVertices[X4] = offset[X4] * m00 + offset[Y4] * m01 + x;
- worldVertices[Y4] = offset[X4] * m10 + offset[Y4] * m11 + y;
- }
- }
+ public void ComputeWorldVertices(Bone bone, float[] worldVertices)
+ {
+ float x = bone.skeleton.x + bone.worldX, y = bone.skeleton.y + bone.worldY;
+ float m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11;
+ float[] offset = this.offset;
+ worldVertices[X1] = offset[X1] * m00 + offset[Y1] * m01 + x;
+ worldVertices[Y1] = offset[X1] * m10 + offset[Y1] * m11 + y;
+ worldVertices[X2] = offset[X2] * m00 + offset[Y2] * m01 + x;
+ worldVertices[Y2] = offset[X2] * m10 + offset[Y2] * m11 + y;
+ worldVertices[X3] = offset[X3] * m00 + offset[Y3] * m01 + x;
+ worldVertices[Y3] = offset[X3] * m10 + offset[Y3] * m11 + y;
+ worldVertices[X4] = offset[X4] * m00 + offset[Y4] * m01 + x;
+ worldVertices[Y4] = offset[X4] * m10 + offset[Y4] * m11 + y;
+ }
+ }
}
diff --git a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/SkinnedMeshAttachment.cs b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/SkinnedMeshAttachment.cs
index 3343bce..5c61d77 100644
--- a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/SkinnedMeshAttachment.cs
+++ b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Attachments/SkinnedMeshAttachment.cs
@@ -31,102 +31,119 @@
using System;
using System.Collections.Generic;
-namespace Spine2_1_08 {
- /// Attachment that displays a texture region.
- public class SkinnedMeshAttachment : Attachment {
- internal int[] bones;
- internal float[] weights, uvs, regionUVs;
- internal int[] triangles;
- internal float regionOffsetX, regionOffsetY, regionWidth, regionHeight, regionOriginalWidth, regionOriginalHeight;
- internal float r = 1, g = 1, b = 1, a = 1;
+namespace Spine2_1_08
+{
+ /// Attachment that displays a texture region.
+ public class SkinnedMeshAttachment : Attachment
+ {
+ internal int[] bones;
+ internal float[] weights, uvs, regionUVs;
+ internal int[] triangles;
+ internal float regionOffsetX, regionOffsetY, regionWidth, regionHeight, regionOriginalWidth, regionOriginalHeight;
+ internal float r = 1, g = 1, b = 1, a = 1;
- public int HullLength { get; set; }
- public int[] Bones { get { return bones; } set { bones = value; } }
- public float[] Weights { get { return weights; } set { weights = value; } }
- public float[] RegionUVs { get { return regionUVs; } set { regionUVs = value; } }
- public float[] UVs { get { return uvs; } set { uvs = value; } }
- public int[] Triangles { get { return triangles; } set { triangles = value; } }
+ public int HullLength { get; set; }
+ public int[] Bones { get { return bones; } set { bones = value; } }
+ public float[] Weights { get { return weights; } set { weights = value; } }
+ public float[] RegionUVs { get { return regionUVs; } set { regionUVs = value; } }
+ public float[] UVs { get { return uvs; } set { uvs = value; } }
+ public int[] Triangles { get { return triangles; } set { triangles = value; } }
- public float R { get { return r; } set { r = value; } }
- public float G { get { return g; } set { g = value; } }
- public float B { get { return b; } set { b = value; } }
- public float A { get { return a; } set { a = value; } }
+ public float R { get { return r; } set { r = value; } }
+ public float G { get { return g; } set { g = value; } }
+ public float B { get { return b; } set { b = value; } }
+ public float A { get { return a; } set { a = value; } }
- public String Path { get; set; }
- public Object RendererObject { get; set; }
- public float RegionU { get; set; }
- public float RegionV { get; set; }
- public float RegionU2 { get; set; }
- public float RegionV2 { get; set; }
- public bool RegionRotate { get; set; }
- public float RegionOffsetX { get { return regionOffsetX; } set { regionOffsetX = value; } }
- public float RegionOffsetY { get { return regionOffsetY; } set { regionOffsetY = value; } } // Pixels stripped from the bottom left, unrotated.
- public float RegionWidth { get { return regionWidth; } set { regionWidth = value; } }
- public float RegionHeight { get { return regionHeight; } set { regionHeight = value; } } // Unrotated, stripped size.
- public float RegionOriginalWidth { get { return regionOriginalWidth; } set { regionOriginalWidth = value; } }
- public float RegionOriginalHeight { get { return regionOriginalHeight; } set { regionOriginalHeight = value; } } // Unrotated, unstripped size.
+ public String Path { get; set; }
+ public Object RendererObject { get; set; }
+ public float RegionU { get; set; }
+ public float RegionV { get; set; }
+ public float RegionU2 { get; set; }
+ public float RegionV2 { get; set; }
+ public bool RegionRotate { get; set; }
+ public float RegionOffsetX { get { return regionOffsetX; } set { regionOffsetX = value; } }
+ public float RegionOffsetY { get { return regionOffsetY; } set { regionOffsetY = value; } } // Pixels stripped from the bottom left, unrotated.
+ public float RegionWidth { get { return regionWidth; } set { regionWidth = value; } }
+ public float RegionHeight { get { return regionHeight; } set { regionHeight = value; } } // Unrotated, stripped size.
+ public float RegionOriginalWidth { get { return regionOriginalWidth; } set { regionOriginalWidth = value; } }
+ public float RegionOriginalHeight { get { return regionOriginalHeight; } set { regionOriginalHeight = value; } } // Unrotated, unstripped size.
- // Nonessential.
- public int[] Edges { get; set; }
- public float Width { get; set; }
- public float Height { get; set; }
+ // Nonessential.
+ public int[] Edges { get; set; }
+ public float Width { get; set; }
+ public float Height { get; set; }
- public SkinnedMeshAttachment (string name)
- : base(name) {
- }
+ public SkinnedMeshAttachment(string name)
+ : base(name)
+ {
+ }
- public void UpdateUVs () {
- float u = RegionU, v = RegionV, width = RegionU2 - RegionU, height = RegionV2 - RegionV;
- float[] regionUVs = this.regionUVs;
- if (this.uvs == null || this.uvs.Length != regionUVs.Length) this.uvs = new float[regionUVs.Length];
- float[] uvs = this.uvs;
- if (RegionRotate) {
- for (int i = 0, n = uvs.Length; i < n; i += 2) {
- uvs[i] = u + regionUVs[i + 1] * width;
- uvs[i + 1] = v + height - regionUVs[i] * height;
- }
- } else {
- for (int i = 0, n = uvs.Length; i < n; i += 2) {
- uvs[i] = u + regionUVs[i] * width;
- uvs[i + 1] = v + regionUVs[i + 1] * height;
- }
- }
- }
+ public void UpdateUVs()
+ {
+ float u = RegionU, v = RegionV, width = RegionU2 - RegionU, height = RegionV2 - RegionV;
+ float[] regionUVs = this.regionUVs;
+ if (this.uvs == null || this.uvs.Length != regionUVs.Length) this.uvs = new float[regionUVs.Length];
+ float[] uvs = this.uvs;
+ if (RegionRotate)
+ {
+ for (int i = 0, n = uvs.Length; i < n; i += 2)
+ {
+ uvs[i] = u + regionUVs[i + 1] * width;
+ uvs[i + 1] = v + height - regionUVs[i] * height;
+ }
+ }
+ else
+ {
+ for (int i = 0, n = uvs.Length; i < n; i += 2)
+ {
+ uvs[i] = u + regionUVs[i] * width;
+ uvs[i + 1] = v + regionUVs[i + 1] * height;
+ }
+ }
+ }
- public void ComputeWorldVertices (Slot slot, float[] worldVertices) {
- Skeleton skeleton = slot.bone.skeleton;
- List skeletonBones = skeleton.bones;
- float x = skeleton.x, y = skeleton.y;
- float[] weights = this.weights;
- int[] bones = this.bones;
- if (slot.attachmentVerticesCount == 0) {
- for (int w = 0, v = 0, b = 0, n = bones.Length; v < n; w += 2) {
- float wx = 0, wy = 0;
- int nn = bones[v++] + v;
- for (; v < nn; v++, b += 3) {
- Bone bone = skeletonBones[bones[v]];
- float vx = weights[b], vy = weights[b + 1], weight = weights[b + 2];
- wx += (vx * bone.m00 + vy * bone.m01 + bone.worldX) * weight;
- wy += (vx * bone.m10 + vy * bone.m11 + bone.worldY) * weight;
- }
- worldVertices[w] = wx + x;
- worldVertices[w + 1] = wy + y;
- }
- } else {
- float[] ffd = slot.AttachmentVertices;
- for (int w = 0, v = 0, b = 0, f = 0, n = bones.Length; v < n; w += 2) {
- float wx = 0, wy = 0;
- int nn = bones[v++] + v;
- for (; v < nn; v++, b += 3, f += 2) {
- Bone bone = skeletonBones[bones[v]];
- float vx = weights[b] + ffd[f], vy = weights[b + 1] + ffd[f + 1], weight = weights[b + 2];
- wx += (vx * bone.m00 + vy * bone.m01 + bone.worldX) * weight;
- wy += (vx * bone.m10 + vy * bone.m11 + bone.worldY) * weight;
- }
- worldVertices[w] = wx + x;
- worldVertices[w + 1] = wy + y;
- }
- }
- }
- }
+ public void ComputeWorldVertices(Slot slot, float[] worldVertices)
+ {
+ Skeleton skeleton = slot.bone.skeleton;
+ List skeletonBones = skeleton.bones;
+ float x = skeleton.x, y = skeleton.y;
+ float[] weights = this.weights;
+ int[] bones = this.bones;
+ if (slot.attachmentVerticesCount == 0)
+ {
+ for (int w = 0, v = 0, b = 0, n = bones.Length; v < n; w += 2)
+ {
+ float wx = 0, wy = 0;
+ int nn = bones[v++] + v;
+ for (; v < nn; v++, b += 3)
+ {
+ Bone bone = skeletonBones[bones[v]];
+ float vx = weights[b], vy = weights[b + 1], weight = weights[b + 2];
+ wx += (vx * bone.m00 + vy * bone.m01 + bone.worldX) * weight;
+ wy += (vx * bone.m10 + vy * bone.m11 + bone.worldY) * weight;
+ }
+ worldVertices[w] = wx + x;
+ worldVertices[w + 1] = wy + y;
+ }
+ }
+ else
+ {
+ float[] ffd = slot.AttachmentVertices;
+ for (int w = 0, v = 0, b = 0, f = 0, n = bones.Length; v < n; w += 2)
+ {
+ float wx = 0, wy = 0;
+ int nn = bones[v++] + v;
+ for (; v < nn; v++, b += 3, f += 2)
+ {
+ Bone bone = skeletonBones[bones[v]];
+ float vx = weights[b] + ffd[f], vy = weights[b + 1] + ffd[f + 1], weight = weights[b + 2];
+ wx += (vx * bone.m00 + vy * bone.m01 + bone.worldX) * weight;
+ wy += (vx * bone.m10 + vy * bone.m11 + bone.worldY) * weight;
+ }
+ worldVertices[w] = wx + x;
+ worldVertices[w + 1] = wy + y;
+ }
+ }
+ }
+ }
}
diff --git a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Bone.cs b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Bone.cs
index 27564b2..50a40b7 100644
--- a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Bone.cs
+++ b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Bone.cs
@@ -31,135 +31,156 @@
using System;
using System.Collections.Generic;
-namespace Spine2_1_08 {
- public class Bone{
- static public bool yDown;
+namespace Spine2_1_08
+{
+ public class Bone
+ {
+ static public bool yDown;
- internal BoneData data;
- internal Skeleton skeleton;
- internal Bone parent;
- internal List children = new List();
- internal float x, y, rotation, rotationIK, scaleX, scaleY;
- internal bool flipX, flipY;
- internal float m00, m01, m10, m11;
- internal float worldX, worldY, worldRotation, worldScaleX, worldScaleY;
- internal bool worldFlipX, worldFlipY;
+ internal BoneData data;
+ internal Skeleton skeleton;
+ internal Bone parent;
+ internal List children = new List();
+ internal float x, y, rotation, rotationIK, scaleX, scaleY;
+ internal bool flipX, flipY;
+ internal float m00, m01, m10, m11;
+ internal float worldX, worldY, worldRotation, worldScaleX, worldScaleY;
+ internal bool worldFlipX, worldFlipY;
- public BoneData Data { get { return data; } }
- public Skeleton Skeleton { get { return skeleton; } }
- public Bone Parent { get { return parent; } }
- public List Children { get { return children; } }
- public float X { get { return x; } set { x = value; } }
- public float Y { get { return y; } set { y = value; } }
- /// The forward kinetics rotation.
- public float Rotation { get { return rotation; } set { rotation = value; } }
- /// The inverse kinetics rotation, as calculated by any IK constraints.
- public float RotationIK { get { return rotationIK; } set { rotationIK = value; } }
- public float ScaleX { get { return scaleX; } set { scaleX = value; } }
- public float ScaleY { get { return scaleY; } set { scaleY = value; } }
- public bool FlipX { get { return flipX; } set { flipX = value; } }
- public bool FlipY { get { return flipY; } set { flipY = value; } }
+ public BoneData Data { get { return data; } }
+ public Skeleton Skeleton { get { return skeleton; } }
+ public Bone Parent { get { return parent; } }
+ public List Children { get { return children; } }
+ public float X { get { return x; } set { x = value; } }
+ public float Y { get { return y; } set { y = value; } }
+ /// The forward kinetics rotation.
+ public float Rotation { get { return rotation; } set { rotation = value; } }
+ /// The inverse kinetics rotation, as calculated by any IK constraints.
+ public float RotationIK { get { return rotationIK; } set { rotationIK = value; } }
+ public float ScaleX { get { return scaleX; } set { scaleX = value; } }
+ public float ScaleY { get { return scaleY; } set { scaleY = value; } }
+ public bool FlipX { get { return flipX; } set { flipX = value; } }
+ public bool FlipY { get { return flipY; } set { flipY = value; } }
- public float M00 { get { return m00; } }
- public float M01 { get { return m01; } }
- public float M10 { get { return m10; } }
- public float M11 { get { return m11; } }
- public float WorldX { get { return worldX; } }
- public float WorldY { get { return worldY; } }
- public float WorldRotation { get { return worldRotation; } }
- public float WorldScaleX { get { return worldScaleX; } }
- public float WorldScaleY { get { return worldScaleY; } }
- public bool WorldFlipX { get { return worldFlipX; } set { worldFlipX = value; } }
- public bool WorldFlipY { get { return worldFlipY; } set { worldFlipY = value; } }
+ public float M00 { get { return m00; } }
+ public float M01 { get { return m01; } }
+ public float M10 { get { return m10; } }
+ public float M11 { get { return m11; } }
+ public float WorldX { get { return worldX; } }
+ public float WorldY { get { return worldY; } }
+ public float WorldRotation { get { return worldRotation; } }
+ public float WorldScaleX { get { return worldScaleX; } }
+ public float WorldScaleY { get { return worldScaleY; } }
+ public bool WorldFlipX { get { return worldFlipX; } set { worldFlipX = value; } }
+ public bool WorldFlipY { get { return worldFlipY; } set { worldFlipY = value; } }
- /// May be null.
- public Bone (BoneData data, Skeleton skeleton, Bone parent) {
- if (data == null) throw new ArgumentNullException("data cannot be null.");
- if (skeleton == null) throw new ArgumentNullException("skeleton cannot be null.");
- this.data = data;
- this.skeleton = skeleton;
- this.parent = parent;
- SetToSetupPose();
- }
+ /// May be null.
+ public Bone(BoneData data, Skeleton skeleton, Bone parent)
+ {
+ if (data == null) throw new ArgumentNullException("data cannot be null.");
+ if (skeleton == null) throw new ArgumentNullException("skeleton cannot be null.");
+ this.data = data;
+ this.skeleton = skeleton;
+ this.parent = parent;
+ SetToSetupPose();
+ }
- /// Computes the world SRT using the parent bone and the local SRT.
- public void UpdateWorldTransform () {
- Bone parent = this.parent;
- float x = this.x, y = this.y;
- if (parent != null) {
- worldX = x * parent.m00 + y * parent.m01 + parent.worldX;
- worldY = x * parent.m10 + y * parent.m11 + parent.worldY;
- if (data.inheritScale) {
- worldScaleX = parent.worldScaleX * scaleX;
- worldScaleY = parent.worldScaleY * scaleY;
- } else {
- worldScaleX = scaleX;
- worldScaleY = scaleY;
- }
- worldRotation = data.inheritRotation ? parent.worldRotation + rotationIK : rotationIK;
- worldFlipX = parent.worldFlipX != flipX;
- worldFlipY = parent.worldFlipY != flipY;
- } else {
- Skeleton skeleton = this.skeleton;
- bool skeletonFlipX = skeleton.flipX, skeletonFlipY = skeleton.flipY;
- worldX = skeletonFlipX ? -x : x;
- worldY = skeletonFlipY != yDown ? -y : y;
- worldScaleX = scaleX;
- worldScaleY = scaleY;
- worldRotation = rotationIK;
- worldFlipX = skeletonFlipX != flipX;
- worldFlipY = skeletonFlipY != flipY;
- }
- float radians = worldRotation * (float)Math.PI / 180;
- float cos = (float)Math.Cos(radians);
- float sin = (float)Math.Sin(radians);
- if (worldFlipX) {
- m00 = -cos * worldScaleX;
- m01 = sin * worldScaleY;
- } else {
- m00 = cos * worldScaleX;
- m01 = -sin * worldScaleY;
- }
- if (worldFlipY != yDown) {
- m10 = -sin * worldScaleX;
- m11 = -cos * worldScaleY;
- } else {
- m10 = sin * worldScaleX;
- m11 = cos * worldScaleY;
- }
- }
+ /// Computes the world SRT using the parent bone and the local SRT.
+ public void UpdateWorldTransform()
+ {
+ Bone parent = this.parent;
+ float x = this.x, y = this.y;
+ if (parent != null)
+ {
+ worldX = x * parent.m00 + y * parent.m01 + parent.worldX;
+ worldY = x * parent.m10 + y * parent.m11 + parent.worldY;
+ if (data.inheritScale)
+ {
+ worldScaleX = parent.worldScaleX * scaleX;
+ worldScaleY = parent.worldScaleY * scaleY;
+ }
+ else
+ {
+ worldScaleX = scaleX;
+ worldScaleY = scaleY;
+ }
+ worldRotation = data.inheritRotation ? parent.worldRotation + rotationIK : rotationIK;
+ worldFlipX = parent.worldFlipX != flipX;
+ worldFlipY = parent.worldFlipY != flipY;
+ }
+ else
+ {
+ Skeleton skeleton = this.skeleton;
+ bool skeletonFlipX = skeleton.flipX, skeletonFlipY = skeleton.flipY;
+ worldX = skeletonFlipX ? -x : x;
+ worldY = skeletonFlipY != yDown ? -y : y;
+ worldScaleX = scaleX;
+ worldScaleY = scaleY;
+ worldRotation = rotationIK;
+ worldFlipX = skeletonFlipX != flipX;
+ worldFlipY = skeletonFlipY != flipY;
+ }
+ float radians = worldRotation * (float)Math.PI / 180;
+ float cos = (float)Math.Cos(radians);
+ float sin = (float)Math.Sin(radians);
+ if (worldFlipX)
+ {
+ m00 = -cos * worldScaleX;
+ m01 = sin * worldScaleY;
+ }
+ else
+ {
+ m00 = cos * worldScaleX;
+ m01 = -sin * worldScaleY;
+ }
+ if (worldFlipY != yDown)
+ {
+ m10 = -sin * worldScaleX;
+ m11 = -cos * worldScaleY;
+ }
+ else
+ {
+ m10 = sin * worldScaleX;
+ m11 = cos * worldScaleY;
+ }
+ }
- public void SetToSetupPose () {
- BoneData data = this.data;
- x = data.x;
- y = data.y;
- rotation = data.rotation;
- rotationIK = rotation;
- scaleX = data.scaleX;
- scaleY = data.scaleY;
- flipX = data.flipX;
- flipY = data.flipY;
- }
+ public void SetToSetupPose()
+ {
+ BoneData data = this.data;
+ x = data.x;
+ y = data.y;
+ rotation = data.rotation;
+ rotationIK = rotation;
+ scaleX = data.scaleX;
+ scaleY = data.scaleY;
+ flipX = data.flipX;
+ flipY = data.flipY;
+ }
- public void worldToLocal (float worldX, float worldY, out float localX, out float localY) {
- float dx = worldX - this.worldX, dy = worldY - this.worldY;
- float m00 = this.m00, m10 = this.m10, m01 = this.m01, m11 = this.m11;
- if (worldFlipX != (worldFlipY != yDown)) {
- m00 = -m00;
- m11 = -m11;
- }
- float invDet = 1 / (m00 * m11 - m01 * m10);
- localX = (dx * m00 * invDet - dy * m01 * invDet);
- localY = (dy * m11 * invDet - dx * m10 * invDet);
- }
+ public void worldToLocal(float worldX, float worldY, out float localX, out float localY)
+ {
+ float dx = worldX - this.worldX, dy = worldY - this.worldY;
+ float m00 = this.m00, m10 = this.m10, m01 = this.m01, m11 = this.m11;
+ if (worldFlipX != (worldFlipY != yDown))
+ {
+ m00 = -m00;
+ m11 = -m11;
+ }
+ float invDet = 1 / (m00 * m11 - m01 * m10);
+ localX = (dx * m00 * invDet - dy * m01 * invDet);
+ localY = (dy * m11 * invDet - dx * m10 * invDet);
+ }
- public void localToWorld (float localX, float localY, out float worldX, out float worldY) {
- worldX = localX * m00 + localY * m01 + this.worldX;
- worldY = localX * m10 + localY * m11 + this.worldY;
- }
+ public void localToWorld(float localX, float localY, out float worldX, out float worldY)
+ {
+ worldX = localX * m00 + localY * m01 + this.worldX;
+ worldY = localX * m10 + localY * m11 + this.worldY;
+ }
- override public String ToString () {
- return data.name;
- }
- }
+ override public String ToString()
+ {
+ return data.name;
+ }
+ }
}
diff --git a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/BoneData.cs b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/BoneData.cs
index 907198c..3bd452d 100644
--- a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/BoneData.cs
+++ b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/BoneData.cs
@@ -30,37 +30,41 @@
using System;
-namespace Spine2_1_08 {
- public class BoneData {
- internal BoneData parent;
- internal String name;
- internal float length, x, y, rotation, scaleX = 1, scaleY = 1;
- internal bool flipX, flipY;
- internal bool inheritScale = true, inheritRotation = true;
+namespace Spine2_1_08
+{
+ public class BoneData
+ {
+ internal BoneData parent;
+ internal String name;
+ internal float length, x, y, rotation, scaleX = 1, scaleY = 1;
+ internal bool flipX, flipY;
+ internal bool inheritScale = true, inheritRotation = true;
- /// May be null.
- public BoneData Parent { get { return parent; } }
- public String Name { get { return name; } }
- public float Length { get { return length; } set { length = value; } }
- public float X { get { return x; } set { x = value; } }
- public float Y { get { return y; } set { y = value; } }
- public float Rotation { get { return rotation; } set { rotation = value; } }
- public float ScaleX { get { return scaleX; } set { scaleX = value; } }
- public float ScaleY { get { return scaleY; } set { scaleY = value; } }
- public bool FlipX { get { return flipX; } set { flipX = value; } }
- public bool FlipY { get { return flipY; } set { flipY = value; } }
- public bool InheritScale { get { return inheritScale; } set { inheritScale = value; } }
- public bool InheritRotation { get { return inheritRotation; } set { inheritRotation = value; } }
+ /// May be null.
+ public BoneData Parent { get { return parent; } }
+ public String Name { get { return name; } }
+ public float Length { get { return length; } set { length = value; } }
+ public float X { get { return x; } set { x = value; } }
+ public float Y { get { return y; } set { y = value; } }
+ public float Rotation { get { return rotation; } set { rotation = value; } }
+ public float ScaleX { get { return scaleX; } set { scaleX = value; } }
+ public float ScaleY { get { return scaleY; } set { scaleY = value; } }
+ public bool FlipX { get { return flipX; } set { flipX = value; } }
+ public bool FlipY { get { return flipY; } set { flipY = value; } }
+ public bool InheritScale { get { return inheritScale; } set { inheritScale = value; } }
+ public bool InheritRotation { get { return inheritRotation; } set { inheritRotation = value; } }
- /// May be null.
- public BoneData (String name, BoneData parent) {
- if (name == null) throw new ArgumentNullException("name cannot be null.");
- this.name = name;
- this.parent = parent;
- }
+ /// May be null.
+ public BoneData(String name, BoneData parent)
+ {
+ if (name == null) throw new ArgumentNullException("name cannot be null.");
+ this.name = name;
+ this.parent = parent;
+ }
- override public String ToString () {
- return name;
- }
- }
+ override public String ToString()
+ {
+ return name;
+ }
+ }
}
diff --git a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Event.cs b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Event.cs
index ef56658..dd48732 100644
--- a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Event.cs
+++ b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Event.cs
@@ -30,19 +30,23 @@
using System;
-namespace Spine2_1_08 {
- public class Event {
- public EventData Data { get; private set; }
- public int Int { get; set; }
- public float Float { get; set; }
- public String String { get; set; }
+namespace Spine2_1_08
+{
+ public class Event
+ {
+ public EventData Data { get; private set; }
+ public int Int { get; set; }
+ public float Float { get; set; }
+ public String String { get; set; }
- public Event (EventData data) {
- Data = data;
- }
+ public Event(EventData data)
+ {
+ Data = data;
+ }
- override public String ToString () {
- return Data.Name;
- }
- }
+ override public String ToString()
+ {
+ return Data.Name;
+ }
+ }
}
diff --git a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/EventData.cs b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/EventData.cs
index a06df6a..437bd62 100644
--- a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/EventData.cs
+++ b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/EventData.cs
@@ -30,22 +30,26 @@
using System;
-namespace Spine2_1_08 {
- public class EventData {
- internal String name;
+namespace Spine2_1_08
+{
+ public class EventData
+ {
+ internal String name;
- public String Name { get { return name; } }
- public int Int { get; set; }
- public float Float { get; set; }
- public String String { get; set; }
+ public String Name { get { return name; } }
+ public int Int { get; set; }
+ public float Float { get; set; }
+ public String String { get; set; }
- public EventData (String name) {
- if (name == null) throw new ArgumentNullException("name cannot be null.");
- this.name = name;
- }
+ public EventData(String name)
+ {
+ if (name == null) throw new ArgumentNullException("name cannot be null.");
+ this.name = name;
+ }
- override public String ToString () {
- return Name;
- }
- }
+ override public String ToString()
+ {
+ return Name;
+ }
+ }
}
diff --git a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/IkConstraint.cs b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/IkConstraint.cs
index bb8cf40..2fc097a 100644
--- a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/IkConstraint.cs
+++ b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/IkConstraint.cs
@@ -31,118 +31,134 @@
using System;
using System.Collections.Generic;
-namespace Spine2_1_08 {
- public class IkConstraint {
- private const float radDeg = 180 / (float)Math.PI;
+namespace Spine2_1_08
+{
+ public class IkConstraint
+ {
+ private const float radDeg = 180 / (float)Math.PI;
- internal IkConstraintData data;
- internal List bones = new List();
- internal Bone target;
- internal int bendDirection;
- internal float mix;
+ internal IkConstraintData data;
+ internal List bones = new List();
+ internal Bone target;
+ internal int bendDirection;
+ internal float mix;
- public IkConstraintData Data { get { return data; } }
- public List Bones { get { return bones; } }
- public Bone Target { get { return target; } set { target = value; } }
- public int BendDirection { get { return bendDirection; } set { bendDirection = value; } }
- public float Mix { get { return mix; } set { mix = value; } }
+ public IkConstraintData Data { get { return data; } }
+ public List Bones { get { return bones; } }
+ public Bone Target { get { return target; } set { target = value; } }
+ public int BendDirection { get { return bendDirection; } set { bendDirection = value; } }
+ public float Mix { get { return mix; } set { mix = value; } }
- public IkConstraint (IkConstraintData data, Skeleton skeleton) {
- if (data == null) throw new ArgumentNullException("data cannot be null.");
- if (skeleton == null) throw new ArgumentNullException("skeleton cannot be null.");
- this.data = data;
- mix = data.mix;
- bendDirection = data.bendDirection;
+ public IkConstraint(IkConstraintData data, Skeleton skeleton)
+ {
+ if (data == null) throw new ArgumentNullException("data cannot be null.");
+ if (skeleton == null) throw new ArgumentNullException("skeleton cannot be null.");
+ this.data = data;
+ mix = data.mix;
+ bendDirection = data.bendDirection;
- bones = new List(data.bones.Count);
- foreach (BoneData boneData in data.bones)
- bones.Add(skeleton.FindBone(boneData.name));
- target = skeleton.FindBone(data.target.name);
- }
+ bones = new List(data.bones.Count);
+ foreach (BoneData boneData in data.bones)
+ bones.Add(skeleton.FindBone(boneData.name));
+ target = skeleton.FindBone(data.target.name);
+ }
- public void apply () {
- Bone target = this.target;
- List bones = this.bones;
- switch (bones.Count) {
- case 1:
- apply(bones[0], target.worldX, target.worldY, mix);
- break;
- case 2:
- apply(bones[0], bones[1], target.worldX, target.worldY, bendDirection, mix);
- break;
- }
- }
+ public void apply()
+ {
+ Bone target = this.target;
+ List bones = this.bones;
+ switch (bones.Count)
+ {
+ case 1:
+ apply(bones[0], target.worldX, target.worldY, mix);
+ break;
+ case 2:
+ apply(bones[0], bones[1], target.worldX, target.worldY, bendDirection, mix);
+ break;
+ }
+ }
- override public String ToString () {
- return data.name;
- }
+ override public String ToString()
+ {
+ return data.name;
+ }
- /// Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified
- /// in the world coordinate system.
- static public void apply (Bone bone, float targetX, float targetY, float alpha) {
- float parentRotation = (!bone.data.inheritRotation || bone.parent == null) ? 0 : bone.parent.worldRotation;
- float rotation = bone.rotation;
- float rotationIK = (float)Math.Atan2(targetY - bone.worldY, targetX - bone.worldX) * radDeg - parentRotation;
- bone.rotationIK = rotation + (rotationIK - rotation) * alpha;
- }
+ /// Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified
+ /// in the world coordinate system.
+ static public void apply(Bone bone, float targetX, float targetY, float alpha)
+ {
+ float parentRotation = (!bone.data.inheritRotation || bone.parent == null) ? 0 : bone.parent.worldRotation;
+ float rotation = bone.rotation;
+ float rotationIK = (float)Math.Atan2(targetY - bone.worldY, targetX - bone.worldX) * radDeg - parentRotation;
+ bone.rotationIK = rotation + (rotationIK - rotation) * alpha;
+ }
- /// Adjusts the parent and child bone rotations so the tip of the child is as close to the target position as
- /// possible. The target is specified in the world coordinate system.
- /// Any descendant bone of the parent.
- static public void apply (Bone parent, Bone child, float targetX, float targetY, int bendDirection, float alpha) {
- float childRotation = child.rotation, parentRotation = parent.rotation;
- if (alpha == 0) {
- child.rotationIK = childRotation;
- parent.rotationIK = parentRotation;
- return;
- }
- float positionX, positionY;
- Bone parentParent = parent.parent;
- if (parentParent != null) {
- parentParent.worldToLocal(targetX, targetY, out positionX, out positionY);
- targetX = (positionX - parent.x) * parentParent.worldScaleX;
- targetY = (positionY - parent.y) * parentParent.worldScaleY;
- } else {
- targetX -= parent.x;
- targetY -= parent.y;
- }
- if (child.parent == parent) {
- positionX = child.x;
- positionY = child.y;
- } else {
- child.parent.localToWorld(child.x, child.y, out positionX, out positionY);
- parent.worldToLocal(positionX, positionY, out positionX, out positionY);
- }
- float childX = positionX * parent.worldScaleX, childY = positionY * parent.worldScaleY;
- float offset = (float)Math.Atan2(childY, childX);
- float len1 = (float)Math.Sqrt(childX * childX + childY * childY), len2 = child.data.length * child.worldScaleX;
- // Based on code by Ryan Juckett with permission: Copyright (c) 2008-2009 Ryan Juckett, http://www.ryanjuckett.com/
- float cosDenom = 2 * len1 * len2;
- if (cosDenom < 0.0001f) {
- child.rotationIK = childRotation + ((float)Math.Atan2(targetY, targetX) * radDeg - parentRotation - childRotation)
- * alpha;
- return;
- }
- float cos = (targetX * targetX + targetY * targetY - len1 * len1 - len2 * len2) / cosDenom;
- if (cos < -1)
- cos = -1;
- else if (cos > 1)
- cos = 1;
- float childAngle = (float)Math.Acos(cos) * bendDirection;
- float adjacent = len1 + len2 * cos, opposite = len2 * (float)Math.Sin(childAngle);
- float parentAngle = (float)Math.Atan2(targetY * adjacent - targetX * opposite, targetX * adjacent + targetY * opposite);
- float rotation = (parentAngle - offset) * radDeg - parentRotation;
- if (rotation > 180)
- rotation -= 360;
- else if (rotation < -180) //
- rotation += 360;
- parent.rotationIK = parentRotation + rotation * alpha;
- rotation = (childAngle + offset) * radDeg - childRotation;
- if (rotation > 180)
- rotation -= 360;
- else if (rotation < -180) //
- rotation += 360;
- child.rotationIK = childRotation + (rotation + parent.worldRotation - child.parent.worldRotation) * alpha;
- }
- }
+ /// Adjusts the parent and child bone rotations so the tip of the child is as close to the target position as
+ /// possible. The target is specified in the world coordinate system.
+ /// Any descendant bone of the parent.
+ static public void apply(Bone parent, Bone child, float targetX, float targetY, int bendDirection, float alpha)
+ {
+ float childRotation = child.rotation, parentRotation = parent.rotation;
+ if (alpha == 0)
+ {
+ child.rotationIK = childRotation;
+ parent.rotationIK = parentRotation;
+ return;
+ }
+ float positionX, positionY;
+ Bone parentParent = parent.parent;
+ if (parentParent != null)
+ {
+ parentParent.worldToLocal(targetX, targetY, out positionX, out positionY);
+ targetX = (positionX - parent.x) * parentParent.worldScaleX;
+ targetY = (positionY - parent.y) * parentParent.worldScaleY;
+ }
+ else
+ {
+ targetX -= parent.x;
+ targetY -= parent.y;
+ }
+ if (child.parent == parent)
+ {
+ positionX = child.x;
+ positionY = child.y;
+ }
+ else
+ {
+ child.parent.localToWorld(child.x, child.y, out positionX, out positionY);
+ parent.worldToLocal(positionX, positionY, out positionX, out positionY);
+ }
+ float childX = positionX * parent.worldScaleX, childY = positionY * parent.worldScaleY;
+ float offset = (float)Math.Atan2(childY, childX);
+ float len1 = (float)Math.Sqrt(childX * childX + childY * childY), len2 = child.data.length * child.worldScaleX;
+ // Based on code by Ryan Juckett with permission: Copyright (c) 2008-2009 Ryan Juckett, http://www.ryanjuckett.com/
+ float cosDenom = 2 * len1 * len2;
+ if (cosDenom < 0.0001f)
+ {
+ child.rotationIK = childRotation + ((float)Math.Atan2(targetY, targetX) * radDeg - parentRotation - childRotation)
+ * alpha;
+ return;
+ }
+ float cos = (targetX * targetX + targetY * targetY - len1 * len1 - len2 * len2) / cosDenom;
+ if (cos < -1)
+ cos = -1;
+ else if (cos > 1)
+ cos = 1;
+ float childAngle = (float)Math.Acos(cos) * bendDirection;
+ float adjacent = len1 + len2 * cos, opposite = len2 * (float)Math.Sin(childAngle);
+ float parentAngle = (float)Math.Atan2(targetY * adjacent - targetX * opposite, targetX * adjacent + targetY * opposite);
+ float rotation = (parentAngle - offset) * radDeg - parentRotation;
+ if (rotation > 180)
+ rotation -= 360;
+ else if (rotation < -180) //
+ rotation += 360;
+ parent.rotationIK = parentRotation + rotation * alpha;
+ rotation = (childAngle + offset) * radDeg - childRotation;
+ if (rotation > 180)
+ rotation -= 360;
+ else if (rotation < -180) //
+ rotation += 360;
+ child.rotationIK = childRotation + (rotation + parent.worldRotation - child.parent.worldRotation) * alpha;
+ }
+ }
}
diff --git a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/IkConstraintData.cs b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/IkConstraintData.cs
index d83f3c4..b5fc366 100644
--- a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/IkConstraintData.cs
+++ b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/IkConstraintData.cs
@@ -31,27 +31,31 @@
using System;
using System.Collections.Generic;
-namespace Spine2_1_08 {
- public class IkConstraintData {
- internal String name;
- internal List bones = new List();
- internal BoneData target;
- internal int bendDirection = 1;
- internal float mix = 1;
+namespace Spine2_1_08
+{
+ public class IkConstraintData
+ {
+ internal String name;
+ internal List bones = new List();
+ internal BoneData target;
+ internal int bendDirection = 1;
+ internal float mix = 1;
- public String Name { get { return name; } }
- public List Bones { get { return bones; } }
- public BoneData Target { get { return target; } set { target = value; } }
- public int BendDirection { get { return bendDirection; } set { bendDirection = value; } }
- public float Mix { get { return mix; } set { mix = value; } }
+ public String Name { get { return name; } }
+ public List Bones { get { return bones; } }
+ public BoneData Target { get { return target; } set { target = value; } }
+ public int BendDirection { get { return bendDirection; } set { bendDirection = value; } }
+ public float Mix { get { return mix; } set { mix = value; } }
- public IkConstraintData (String name) {
- if (name == null) throw new ArgumentNullException("name cannot be null.");
- this.name = name;
- }
+ public IkConstraintData(String name)
+ {
+ if (name == null) throw new ArgumentNullException("name cannot be null.");
+ this.name = name;
+ }
- override public String ToString () {
- return name;
- }
- }
+ override public String ToString()
+ {
+ return name;
+ }
+ }
}
diff --git a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Json.cs b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Json.cs
index 28b3e27..cbbf236 100644
--- a/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Json.cs
+++ b/SpineViewerWPF/SpineLibrary/spine-runtimes-2.1.08/Json.cs
@@ -29,10 +29,10 @@
using System;
using System.Collections;
using System.Collections.Generic;
+using System.Globalization;
using System.IO;
using System.Text;
-using System.Globalization;
-
+
namespace Spine2_1_08
{
// Example usage:
@@ -58,7 +58,7 @@ namespace Spine2_1_08
// Debug.Log("deserialized: " + dict.GetType());
// Debug.Log("dict['array'][0]: " + ((List