|
@@ -230,7 +230,7 @@ void SSpineWidget::UpdateMesh(int32 LayerId, FSlateWindowElementList& OutDrawEle
|
|
|
unsigned short quadIndices[] = { 0, 1, 2, 0, 2, 3 };
|
|
|
|
|
|
for (int i = 0; i < (int)Skeleton->getSlots().size(); ++i) {
|
|
|
- Vector<float> &attachmentVertices = worldVertices;
|
|
|
+ Vector<float> *attachmentVertices = &worldVertices;
|
|
|
unsigned short* attachmentIndices = nullptr;
|
|
|
int numVertices;
|
|
|
int numIndices;
|
|
@@ -250,7 +250,7 @@ void SSpineWidget::UpdateMesh(int32 LayerId, FSlateWindowElementList& OutDrawEle
|
|
|
RegionAttachment* regionAttachment = (RegionAttachment*)attachment;
|
|
|
attachmentColor.set(regionAttachment->getColor());
|
|
|
attachmentAtlasRegion = (AtlasRegion*)regionAttachment->getRendererObject();
|
|
|
- regionAttachment->computeWorldVertices(slot->getBone(), attachmentVertices, 0, 2);
|
|
|
+ regionAttachment->computeWorldVertices(slot->getBone(), *attachmentVertices, 0, 2);
|
|
|
attachmentIndices = quadIndices;
|
|
|
attachmentUvs = regionAttachment->getUVs().buffer();
|
|
|
numVertices = 4;
|
|
@@ -260,7 +260,7 @@ void SSpineWidget::UpdateMesh(int32 LayerId, FSlateWindowElementList& OutDrawEle
|
|
|
MeshAttachment* mesh = (MeshAttachment*)attachment;
|
|
|
attachmentColor.set(mesh->getColor());
|
|
|
attachmentAtlasRegion = (AtlasRegion*)mesh->getRendererObject();
|
|
|
- mesh->computeWorldVertices(*slot, 0, mesh->getWorldVerticesLength(), attachmentVertices, 0, 2);
|
|
|
+ mesh->computeWorldVertices(*slot, 0, mesh->getWorldVerticesLength(), *attachmentVertices, 0, 2);
|
|
|
attachmentIndices = mesh->getTriangles().buffer();
|
|
|
attachmentUvs = mesh->getUVs().buffer();
|
|
|
numVertices = mesh->getWorldVerticesLength() >> 1;
|
|
@@ -299,8 +299,8 @@ void SSpineWidget::UpdateMesh(int32 LayerId, FSlateWindowElementList& OutDrawEle
|
|
|
}
|
|
|
|
|
|
if (clipper.isClipping()) {
|
|
|
- clipper.clipTriangles(attachmentVertices.buffer(), attachmentIndices, numIndices, attachmentUvs, 2);
|
|
|
- attachmentVertices = clipper.getClippedVertices();
|
|
|
+ clipper.clipTriangles(attachmentVertices->buffer(), attachmentIndices, numIndices, attachmentUvs, 2);
|
|
|
+ attachmentVertices = &clipper.getClippedVertices();
|
|
|
numVertices = clipper.getClippedVertices().size() >> 1;
|
|
|
attachmentIndices = clipper.getClippedTriangles().buffer();
|
|
|
numIndices = clipper.getClippedTriangles().size();
|
|
@@ -323,10 +323,11 @@ void SSpineWidget::UpdateMesh(int32 LayerId, FSlateWindowElementList& OutDrawEle
|
|
|
float dg = slot->hasDarkColor() ? slot->getDarkColor().g : 0.0f;
|
|
|
float db = slot->hasDarkColor() ? slot->getDarkColor().b : 0.0f;
|
|
|
|
|
|
+ float* verticesPtr = attachmentVertices->buffer();
|
|
|
for (int j = 0; j < numVertices << 1; j += 2) {
|
|
|
colors.Add(FColor(r, g, b, a));
|
|
|
darkColors.Add(FVector(dr, dg, db));
|
|
|
- vertices.Add(FVector(attachmentVertices[j], -attachmentVertices[j + 1], depthOffset));
|
|
|
+ vertices.Add(FVector(verticesPtr[j], -verticesPtr[j + 1], depthOffset));
|
|
|
uvs.Add(FVector2D(attachmentUvs[j], attachmentUvs[j + 1]));
|
|
|
}
|
|
|
|