更换为wpf

This commit is contained in:
ww-rm
2025-05-27 15:55:10 +08:00
parent d0f629d9ba
commit 17257a0ffe
316 changed files with 19206 additions and 76537 deletions

View File

@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Spine.SpineWrappers.Attachments
{
public interface IAttachment
{
/// <summary>
/// 附件的唯一名字
/// </summary>
public string Name { get; }
/// <summary>
/// 计算世界顶点数组
/// </summary>
/// <param name="slot">装载的插槽</param>
/// <param name="worldVertices">顶点缓冲数组, 如果大小不足会重分配到合适的大小, 实际长度需要通过返回值获取</param>
/// <returns><paramref name="worldVertices"/> 的实际长度, 顶点数是长度除以 2</returns>
public int ComputeWorldVertices(ISlot slot, ref float[] worldVertices);
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Spine.SpineWrappers.Attachments
{
public interface IBoundingBoxAttachment : IAttachment
{
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Spine.SpineWrappers.Attachments
{
public interface IClippingAttachment : IAttachment
{
}
}

View File

@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Spine.SpineWrappers.Attachments
{
public interface IMeshAttachment : IAttachment
{
/// <summary>
/// R
/// </summary>
public float R { get; set; }
/// <summary>
/// G
/// </summary>
public float G { get; set; }
/// <summary>
/// B
/// </summary>
public float B { get; set; }
/// <summary>
/// A
/// </summary>
public float A { get; set; }
/// <summary>
/// 用于渲染的纹理对象
/// </summary>
public SFML.Graphics.Texture RendererObject { get; }
/// <summary>
/// 顶点纹理坐标, 每个坐标有 u 和 v 两个数, 有效长度和 <see cref="IAttachment.ComputeWorldVertices(ISlot, ref float[])"/> 返回值一致
/// </summary>
public float[] UVs { get; }
/// <summary>
/// 三角形索引顶点数组, 每 3 个为一组, 指向顶点的下标 (不是顶点坐标数组下标)
/// </summary>
public int[] Triangles { get; }
/// <summary>
/// 边缘顶点数组长度
/// </summary>
public int HullLength { get; }
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Spine.SpineWrappers.Attachments
{
public interface IPathAttachment : IAttachment
{
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Spine.SpineWrappers.Attachments
{
public interface IPointAttachment : IAttachment
{
}
}

View File

@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Spine.SpineWrappers.Attachments
{
public interface IRegionAttachment : IAttachment
{
/// <summary>
/// 总是将 Region 附件矩形区域切分成两个这样的三角形
/// </summary>
private static readonly int[] _trangles = [0, 1, 2, 2, 3, 0];
/// <summary>
/// R
/// </summary>
public float R { get; set; }
/// <summary>
/// G
/// </summary>
public float G { get; set; }
/// <summary>
/// B
/// </summary>
public float B { get; set; }
/// <summary>
/// A
/// </summary>
public float A { get; set; }
/// <summary>
/// 用于渲染的纹理对象
/// </summary>
public SFML.Graphics.Texture RendererObject { get; }
/// <summary>
/// 顶点纹理坐标, 每个坐标有 u 和 v 两个数, 有效长度和 <see cref="IAttachment.ComputeWorldVertices(ISlot, ref float[])"/> 返回值一致
/// </summary>
public float[] UVs { get; }
/// <summary>
/// 三角形索引顶点数组, 每 3 个为一组, 指向顶点的下标 (不是顶点坐标数组下标)
/// </summary>
public int[] Triangles => _trangles;
}
}

View File

@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Spine.SpineWrappers.Attachments
{
public interface ISkinnedMeshAttachment : IAttachment
{
/// <summary>
/// R
/// </summary>
public float R { get; set; }
/// <summary>
/// G
/// </summary>
public float G { get; set; }
/// <summary>
/// B
/// </summary>
public float B { get; set; }
/// <summary>
/// A
/// </summary>
public float A { get; set; }
/// <summary>
/// 用于渲染的纹理对象
/// </summary>
public SFML.Graphics.Texture RendererObject { get; }
/// <summary>
/// 顶点纹理坐标, 每个坐标有 u 和 v 两个数, 有效长度和 <see cref="IAttachment.ComputeWorldVertices(ISlot, ref float[])"/> 返回值一致
/// </summary>
public float[] UVs { get; }
/// <summary>
/// 三角形索引顶点数组, 每 3 个为一组, 指向顶点的下标 (不是顶点坐标数组下标)
/// </summary>
public int[] Triangles { get; }
/// <summary>
/// 边缘顶点数组长度
/// </summary>
public int HullLength { get; }
}
}