调整结构
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using SpineRuntime38.Attachments;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
using System;
|
||||
|
||||
namespace SpineRuntime38 {
|
||||
namespace SpineRuntime38.Attachments {
|
||||
|
||||
/// <summary>
|
||||
/// An AttachmentLoader that configures attachments using texture regions from an Atlas.
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
using System;
|
||||
|
||||
namespace SpineRuntime38 {
|
||||
namespace SpineRuntime38.Attachments {
|
||||
abstract public class Attachment {
|
||||
public string Name { get; private set; }
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
namespace SpineRuntime38 {
|
||||
namespace SpineRuntime38.Attachments {
|
||||
public interface AttachmentLoader {
|
||||
/// <return>May be null to not load any attachment.</return>
|
||||
RegionAttachment NewRegionAttachment (Skin skin, string name, string path);
|
||||
@@ -27,7 +27,7 @@
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
namespace SpineRuntime38 {
|
||||
namespace SpineRuntime38.Attachments {
|
||||
public enum AttachmentType {
|
||||
Region, Boundingbox, Mesh, Linkedmesh, Path, Point, Clipping
|
||||
}
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
using System;
|
||||
|
||||
namespace SpineRuntime38 {
|
||||
namespace SpineRuntime38.Attachments {
|
||||
/// <summary>Attachment that has a polygon for bounds checking.</summary>
|
||||
public class BoundingBoxAttachment : VertexAttachment {
|
||||
public BoundingBoxAttachment (string name)
|
||||
@@ -37,7 +37,7 @@ namespace SpineRuntime38 {
|
||||
}
|
||||
|
||||
public override Attachment Copy () {
|
||||
BoundingBoxAttachment copy = new BoundingBoxAttachment(this.Name);
|
||||
BoundingBoxAttachment copy = new BoundingBoxAttachment(Name);
|
||||
CopyTo(copy);
|
||||
return copy;
|
||||
}
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
using System;
|
||||
|
||||
namespace SpineRuntime38 {
|
||||
namespace SpineRuntime38.Attachments {
|
||||
public class ClippingAttachment : VertexAttachment {
|
||||
internal SlotData endSlot;
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace SpineRuntime38 {
|
||||
}
|
||||
|
||||
public override Attachment Copy () {
|
||||
ClippingAttachment copy = new ClippingAttachment(this.Name);
|
||||
ClippingAttachment copy = new ClippingAttachment(Name);
|
||||
CopyTo(copy);
|
||||
copy.endSlot = endSlot;
|
||||
return copy;
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
using System;
|
||||
|
||||
namespace SpineRuntime38 {
|
||||
namespace SpineRuntime38.Attachments {
|
||||
/// <summary>Attachment that displays a texture region using a mesh.</summary>
|
||||
public class MeshAttachment : VertexAttachment, IHasRendererObject {
|
||||
internal float regionOffsetX, regionOffsetY, regionWidth, regionHeight, regionOriginalWidth, regionOriginalHeight;
|
||||
@@ -41,8 +41,8 @@ namespace SpineRuntime38 {
|
||||
|
||||
public int HullLength { get { return hulllength; } set { hulllength = value; } }
|
||||
public float[] RegionUVs { get { return regionUVs; } set { regionUVs = value; } }
|
||||
/// <summary>The UV pair for each vertex, normalized within the entire texture. <seealso cref="MeshAttachment.UpdateUVs"/></summary>
|
||||
public float[] UVs { get { return uvs; } set { uvs = value; } }
|
||||
/// <summary>The UV pair for each vertex, normalized within the entire texture. <seealso cref="UpdateUVs"/></summary>
|
||||
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; } }
|
||||
@@ -99,8 +99,8 @@ namespace SpineRuntime38 {
|
||||
float u = RegionU, v = RegionV, width = 0, height = 0;
|
||||
|
||||
if (RegionDegrees == 90) {
|
||||
float textureHeight = this.regionWidth / (RegionV2 - RegionV);
|
||||
float textureWidth = this.regionHeight / (RegionU2 - RegionU);
|
||||
float textureHeight = regionWidth / (RegionV2 - RegionV);
|
||||
float textureWidth = regionHeight / (RegionU2 - RegionU);
|
||||
u -= (RegionOriginalHeight - RegionOffsetY - RegionHeight) / textureWidth;
|
||||
v -= (RegionOriginalWidth - RegionOffsetX - RegionWidth) / textureHeight;
|
||||
width = RegionOriginalHeight / textureWidth;
|
||||
@@ -111,8 +111,8 @@ namespace SpineRuntime38 {
|
||||
uvs[i + 1] = v + (1 - regionUVs[i]) * height;
|
||||
}
|
||||
} else if (RegionDegrees == 180) {
|
||||
float textureWidth = this.regionWidth / (RegionU2 - RegionU);
|
||||
float textureHeight = this.regionHeight / (RegionV2 - RegionV);
|
||||
float textureWidth = regionWidth / (RegionU2 - RegionU);
|
||||
float textureHeight = regionHeight / (RegionV2 - RegionV);
|
||||
u -= (RegionOriginalWidth - RegionOffsetX - RegionWidth) / textureWidth;
|
||||
v -= RegionOffsetY / textureHeight;
|
||||
width = RegionOriginalWidth / textureWidth;
|
||||
@@ -123,8 +123,8 @@ namespace SpineRuntime38 {
|
||||
uvs[i + 1] = v + (1 - regionUVs[i + 1]) * height;
|
||||
}
|
||||
} else if (RegionDegrees == 270) {
|
||||
float textureWidth = this.regionWidth / (RegionU2 - RegionU);
|
||||
float textureHeight = this.regionHeight / (RegionV2 - RegionV);
|
||||
float textureWidth = regionWidth / (RegionU2 - RegionU);
|
||||
float textureHeight = regionHeight / (RegionV2 - RegionV);
|
||||
u -= RegionOffsetY / textureWidth;
|
||||
v -= RegionOffsetX / textureHeight;
|
||||
width = RegionOriginalHeight / textureWidth;
|
||||
@@ -135,8 +135,8 @@ namespace SpineRuntime38 {
|
||||
uvs[i + 1] = v + regionUVs[i] * height;
|
||||
}
|
||||
} else {
|
||||
float textureWidth = this.regionWidth / (RegionU2 - RegionU);
|
||||
float textureHeight = this.regionHeight / (RegionV2 - RegionV);
|
||||
float textureWidth = regionWidth / (RegionU2 - RegionU);
|
||||
float textureHeight = regionHeight / (RegionV2 - RegionV);
|
||||
u -= RegionOffsetX / textureWidth;
|
||||
v -= (RegionOriginalHeight - RegionOffsetY - RegionHeight) / textureHeight;
|
||||
width = RegionOriginalWidth / textureWidth;
|
||||
@@ -152,7 +152,7 @@ namespace SpineRuntime38 {
|
||||
public override Attachment Copy () {
|
||||
if (parentMesh != null) return NewLinkedMesh();
|
||||
|
||||
MeshAttachment copy = new MeshAttachment(this.Name);
|
||||
MeshAttachment copy = new MeshAttachment(Name);
|
||||
copy.RendererObject = RendererObject;
|
||||
copy.regionOffsetX = regionOffsetX;
|
||||
copy.regionOffsetY = regionOffsetY;
|
||||
@@ -30,7 +30,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SpineRuntime38 {
|
||||
namespace SpineRuntime38.Attachments {
|
||||
public class PathAttachment : VertexAttachment {
|
||||
internal float[] lengths;
|
||||
internal bool closed, constantSpeed;
|
||||
@@ -40,12 +40,12 @@ namespace SpineRuntime38 {
|
||||
public bool Closed { get { return closed; } set { closed = value; } }
|
||||
public bool ConstantSpeed { get { return constantSpeed; } set { constantSpeed = value; } }
|
||||
|
||||
public PathAttachment (String name)
|
||||
public PathAttachment (string name)
|
||||
: base(name) {
|
||||
}
|
||||
|
||||
public override Attachment Copy () {
|
||||
PathAttachment copy = new PathAttachment(this.Name);
|
||||
PathAttachment copy = new PathAttachment(Name);
|
||||
CopyTo(copy);
|
||||
copy.lengths = new float[lengths.Length];
|
||||
Array.Copy(lengths, 0, copy.lengths, 0, lengths.Length);
|
||||
@@ -27,7 +27,7 @@
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
namespace SpineRuntime38 {
|
||||
namespace SpineRuntime38.Attachments {
|
||||
/// <summary>
|
||||
/// An attachment which is a single point and a rotation. This can be used to spawn projectiles, particles, etc. A bone can be
|
||||
/// used in similar ways, but a PointAttachment is slightly less expensive to compute and can be hidden, shown, and placed in a
|
||||
@@ -46,7 +46,7 @@ namespace SpineRuntime38 {
|
||||
}
|
||||
|
||||
public void ComputeWorldPosition (Bone bone, out float ox, out float oy) {
|
||||
bone.LocalToWorld(this.x, this.y, out ox, out oy);
|
||||
bone.LocalToWorld(x, y, out ox, out oy);
|
||||
}
|
||||
|
||||
public float ComputeWorldRotation (Bone bone) {
|
||||
@@ -57,7 +57,7 @@ namespace SpineRuntime38 {
|
||||
}
|
||||
|
||||
public override Attachment Copy () {
|
||||
PointAttachment copy = new PointAttachment(this.Name);
|
||||
PointAttachment copy = new PointAttachment(Name);
|
||||
copy.x = x;
|
||||
copy.y = y;
|
||||
copy.rotation = rotation;
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
using System;
|
||||
|
||||
namespace SpineRuntime38 {
|
||||
namespace SpineRuntime38.Attachments {
|
||||
/// <summary>Attachment that displays a texture region.</summary>
|
||||
public class RegionAttachment : Attachment, IHasRendererObject {
|
||||
public const int BLX = 0;
|
||||
@@ -180,7 +180,7 @@ namespace SpineRuntime38 {
|
||||
}
|
||||
|
||||
public override Attachment Copy () {
|
||||
RegionAttachment copy = new RegionAttachment(this.Name);
|
||||
RegionAttachment copy = new RegionAttachment(Name);
|
||||
copy.RendererObject = RendererObject;
|
||||
copy.regionOffsetX = regionOffsetX;
|
||||
copy.regionOffsetY = regionOffsetY;
|
||||
@@ -29,12 +29,12 @@
|
||||
|
||||
using System;
|
||||
|
||||
namespace SpineRuntime38 {
|
||||
namespace SpineRuntime38.Attachments {
|
||||
/// <summary>>An attachment with vertices that are transformed by one or more bones and can be deformed by a slot's
|
||||
/// <see cref="Slot.Deform"/>.</summary>
|
||||
public abstract class VertexAttachment : Attachment {
|
||||
static int nextID = 0;
|
||||
static readonly Object nextIdLock = new Object();
|
||||
static readonly object nextIdLock = new object();
|
||||
|
||||
internal readonly int id;
|
||||
internal int[] bones;
|
||||
@@ -55,8 +55,8 @@ namespace SpineRuntime38 {
|
||||
: base(name) {
|
||||
|
||||
deformAttachment = this;
|
||||
lock (VertexAttachment.nextIdLock) {
|
||||
id = (VertexAttachment.nextID++ & 65535) << 11;
|
||||
lock (nextIdLock) {
|
||||
id = (nextID++ & 65535) << 11;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using SpineRuntime38.Attachments;
|
||||
using System;
|
||||
|
||||
namespace SpineRuntime38 {
|
||||
@@ -27,6 +27,7 @@
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using SpineRuntime38.Attachments;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using SpineRuntime38.Attachments;
|
||||
|
||||
#if WINDOWS_STOREAPP
|
||||
using System.Threading.Tasks;
|
||||
@@ -27,6 +27,7 @@
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using SpineRuntime38.Attachments;
|
||||
using System;
|
||||
|
||||
namespace SpineRuntime38 {
|
||||
@@ -27,6 +27,7 @@
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using SpineRuntime38.Attachments;
|
||||
using System;
|
||||
|
||||
namespace SpineRuntime38 {
|
||||
@@ -34,6 +34,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using SpineRuntime38.Attachments;
|
||||
|
||||
#if WINDOWS_STOREAPP
|
||||
using System.Threading.Tasks;
|
||||
@@ -27,6 +27,7 @@
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using SpineRuntime38.Attachments;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@@ -27,6 +27,7 @@
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using SpineRuntime38.Attachments;
|
||||
using System;
|
||||
|
||||
namespace SpineRuntime38 {
|
||||
@@ -41,6 +41,11 @@ namespace SpineViewer
|
||||
LogManager.ReconfigExistingLoggers();
|
||||
}
|
||||
|
||||
private void ExportPng_Work(object? sender, DoWorkEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void MainForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
spinePreviewer.StartPreview();
|
||||
@@ -63,11 +68,23 @@ namespace SpineViewer
|
||||
|
||||
private void toolStripMenuItem_Export_Click(object sender, EventArgs e)
|
||||
{
|
||||
Program.Logger.Debug("Debug Test");
|
||||
Program.Logger.Info("Info Test");
|
||||
Program.Logger.Warn("Warn Test");
|
||||
Program.Logger.Error("Error Test");
|
||||
Program.Logger.Fatal("Fatal Test");
|
||||
lock (spineListView.Spines)
|
||||
{
|
||||
if (spineListView.Spines.Count <= 0)
|
||||
{
|
||||
MessageBox.Show("请至少打开一个骨骼文件", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//var openDialog = new BatchOpenSpineDialog();
|
||||
//if (openDialog.ShowDialog() != DialogResult.OK)
|
||||
// return;
|
||||
|
||||
//var progressDialog = new ProgressDialog();
|
||||
//progressDialog.DoWork += ExportPng_Work;
|
||||
//progressDialog.RunWorkerAsync(new { openDialog.SkelPaths, openDialog.Version });
|
||||
//progressDialog.ShowDialog();
|
||||
}
|
||||
|
||||
private void toolStripMenuItem_Exit_Click(object sender, EventArgs e)
|
||||
@@ -6,6 +6,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SpineRuntime38;
|
||||
using SpineRuntime38.Attachments;
|
||||
using SpineViewer.Spine;
|
||||
|
||||
namespace SpineViewer.Spine.Implementations
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user