mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[monogame] Fixed rendering for sequence attachments.
A region attachment with a sequence has its texture region set by `computeWorldVertices`. That must be called before the texture region is assigned to a local.
This commit is contained in:
parent
b6e6712145
commit
899f7d77ef
@ -123,18 +123,16 @@ namespace Spine {
|
|||||||
if (attachment is RegionAttachment) {
|
if (attachment is RegionAttachment) {
|
||||||
RegionAttachment regionAttachment = (RegionAttachment)attachment;
|
RegionAttachment regionAttachment = (RegionAttachment)attachment;
|
||||||
attachmentColorR = regionAttachment.R; attachmentColorG = regionAttachment.G; attachmentColorB = regionAttachment.B; attachmentColorA = regionAttachment.A;
|
attachmentColorR = regionAttachment.R; attachmentColorG = regionAttachment.G; attachmentColorB = regionAttachment.B; attachmentColorA = regionAttachment.A;
|
||||||
AtlasRegion region = (AtlasRegion)regionAttachment.Region;
|
|
||||||
textureObject = region.page.rendererObject;
|
|
||||||
verticesCount = 4;
|
|
||||||
regionAttachment.ComputeWorldVertices(slot, vertices, 0, 2);
|
regionAttachment.ComputeWorldVertices(slot, vertices, 0, 2);
|
||||||
|
verticesCount = 4;
|
||||||
indicesCount = 6;
|
indicesCount = 6;
|
||||||
indices = quadTriangles;
|
indices = quadTriangles;
|
||||||
uvs = regionAttachment.UVs;
|
uvs = regionAttachment.UVs;
|
||||||
|
AtlasRegion region = (AtlasRegion)regionAttachment.Region;
|
||||||
|
textureObject = region.page.rendererObject;
|
||||||
} else if (attachment is MeshAttachment) {
|
} else if (attachment is MeshAttachment) {
|
||||||
MeshAttachment mesh = (MeshAttachment)attachment;
|
MeshAttachment mesh = (MeshAttachment)attachment;
|
||||||
attachmentColorR = mesh.R; attachmentColorG = mesh.G; attachmentColorB = mesh.B; attachmentColorA = mesh.A;
|
attachmentColorR = mesh.R; attachmentColorG = mesh.G; attachmentColorB = mesh.B; attachmentColorA = mesh.A;
|
||||||
AtlasRegion region = (AtlasRegion)mesh.Region;
|
|
||||||
textureObject = region.page.rendererObject;
|
|
||||||
int vertexCount = mesh.WorldVerticesLength;
|
int vertexCount = mesh.WorldVerticesLength;
|
||||||
if (vertices.Length < vertexCount) vertices = new float[vertexCount];
|
if (vertices.Length < vertexCount) vertices = new float[vertexCount];
|
||||||
verticesCount = vertexCount >> 1;
|
verticesCount = vertexCount >> 1;
|
||||||
@ -142,6 +140,8 @@ namespace Spine {
|
|||||||
indicesCount = mesh.Triangles.Length;
|
indicesCount = mesh.Triangles.Length;
|
||||||
indices = mesh.Triangles;
|
indices = mesh.Triangles;
|
||||||
uvs = mesh.UVs;
|
uvs = mesh.UVs;
|
||||||
|
AtlasRegion region = (AtlasRegion)mesh.Region;
|
||||||
|
textureObject = region.page.rendererObject;
|
||||||
} else if (attachment is ClippingAttachment) {
|
} else if (attachment is ClippingAttachment) {
|
||||||
ClippingAttachment clip = (ClippingAttachment)attachment;
|
ClippingAttachment clip = (ClippingAttachment)attachment;
|
||||||
clipper.ClipStart(slot, clip);
|
clipper.ClipStart(slot, clip);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user