Merge pull request #77 from ww-rm/dev/wpf

v0.15.8
This commit is contained in:
ww-rm
2025-08-01 00:03:42 +08:00
committed by GitHub
4 changed files with 17 additions and 6 deletions

View File

@@ -1,5 +1,13 @@
# CHANGELOG # CHANGELOG
## v0.15.8
- 修复渲染纹理过程中可能的 null 错误
## v0.15.7
- 合并社区 CLI 功能项目
## v0.15.6 ## v0.15.6
- 修复导出单个的时长错误 - 修复导出单个的时长错误

View File

@@ -7,7 +7,7 @@
<TargetFramework>net8.0-windows</TargetFramework> <TargetFramework>net8.0-windows</TargetFramework>
<BaseOutputPath>$(SolutionDir)out</BaseOutputPath> <BaseOutputPath>$(SolutionDir)out</BaseOutputPath>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion> <IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<Version>0.15.6</Version> <Version>0.15.8</Version>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>

View File

@@ -478,7 +478,6 @@ namespace Spine
} }
var attachment = slot.Attachment; var attachment = slot.Attachment;
SFML.Graphics.Texture texture;
float[] worldVertices; // 顶点世界坐标数组, 连续的 [x0, y0, x1, y1, ...] 坐标值 float[] worldVertices; // 顶点世界坐标数组, 连续的 [x0, y0, x1, y1, ...] 坐标值
int worldVerticesLength; // 顶点数组的长度 int worldVerticesLength; // 顶点数组的长度
@@ -491,10 +490,11 @@ namespace Spine
float tintB = _skeleton.B * slot.B; float tintB = _skeleton.B * slot.B;
float tintA = _skeleton.A * slot.A; float tintA = _skeleton.A * slot.A;
SFML.Graphics.Texture texture;
switch (attachment) switch (attachment)
{ {
case IRegionAttachment regionAttachment: case IRegionAttachment regionAttachment:
texture = regionAttachment.RendererObject;
worldVerticesLength = regionAttachment.ComputeWorldVertices(slot, ref _worldVertices); worldVerticesLength = regionAttachment.ComputeWorldVertices(slot, ref _worldVertices);
worldVertices = _worldVertices; worldVertices = _worldVertices;
triangles = regionAttachment.Triangles; triangles = regionAttachment.Triangles;
@@ -504,9 +504,11 @@ namespace Spine
tintG *= regionAttachment.G; tintG *= regionAttachment.G;
tintB *= regionAttachment.B; tintB *= regionAttachment.B;
tintA *= regionAttachment.A; tintA *= regionAttachment.A;
// NOTE: RenderObject 的获取要在 ComputeWorldVertices 发生之后, 否则可能存在某些 Region 尚未被赋值产生 null 引用报错
texture = regionAttachment.RendererObject;
break; break;
case IMeshAttachment meshAttachment: case IMeshAttachment meshAttachment:
texture = meshAttachment.RendererObject;
worldVerticesLength = meshAttachment.ComputeWorldVertices(slot, ref _worldVertices); worldVerticesLength = meshAttachment.ComputeWorldVertices(slot, ref _worldVertices);
worldVertices = _worldVertices; worldVertices = _worldVertices;
triangles = meshAttachment.Triangles; triangles = meshAttachment.Triangles;
@@ -516,9 +518,9 @@ namespace Spine
tintG *= meshAttachment.G; tintG *= meshAttachment.G;
tintB *= meshAttachment.B; tintB *= meshAttachment.B;
tintA *= meshAttachment.A; tintA *= meshAttachment.A;
texture = meshAttachment.RendererObject;
break; break;
case ISkinnedMeshAttachment skinnedMeshAttachment: case ISkinnedMeshAttachment skinnedMeshAttachment:
texture = skinnedMeshAttachment.RendererObject;
worldVerticesLength = skinnedMeshAttachment.ComputeWorldVertices(slot, ref _worldVertices); worldVerticesLength = skinnedMeshAttachment.ComputeWorldVertices(slot, ref _worldVertices);
worldVertices = _worldVertices; worldVertices = _worldVertices;
triangles = skinnedMeshAttachment.Triangles; triangles = skinnedMeshAttachment.Triangles;
@@ -528,6 +530,7 @@ namespace Spine
tintG *= skinnedMeshAttachment.G; tintG *= skinnedMeshAttachment.G;
tintB *= skinnedMeshAttachment.B; tintB *= skinnedMeshAttachment.B;
tintA *= skinnedMeshAttachment.A; tintA *= skinnedMeshAttachment.A;
texture = skinnedMeshAttachment.RendererObject;
break; break;
case IClippingAttachment clippingAttachment: case IClippingAttachment clippingAttachment:
_clipping.ClipStart(slot, clippingAttachment); _clipping.ClipStart(slot, clippingAttachment);

View File

@@ -7,7 +7,7 @@
<TargetFramework>net8.0-windows</TargetFramework> <TargetFramework>net8.0-windows</TargetFramework>
<BaseOutputPath>$(SolutionDir)out</BaseOutputPath> <BaseOutputPath>$(SolutionDir)out</BaseOutputPath>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion> <IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<Version>0.15.7</Version> <Version>0.15.8</Version>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<UseWPF>true</UseWPF> <UseWPF>true</UseWPF>
</PropertyGroup> </PropertyGroup>