mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[ue4] Clipping slot wasn't checked in all early loop exits. Closes #1494.
This commit is contained in:
parent
14b8849a5d
commit
6f0cf68681
@ -240,11 +240,20 @@ void SSpineWidget::UpdateMesh(int32 LayerId, FSlateWindowElementList& OutDrawEle
|
|||||||
float* attachmentUvs = nullptr;
|
float* attachmentUvs = nullptr;
|
||||||
|
|
||||||
Slot* slot = Skeleton->getDrawOrder()[i];
|
Slot* slot = Skeleton->getDrawOrder()[i];
|
||||||
if (!slot->getBone().isActive()) continue;
|
if (!slot->getBone().isActive()) {
|
||||||
|
clipper.clipEnd(*slot);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
Attachment* attachment = slot->getAttachment();
|
Attachment* attachment = slot->getAttachment();
|
||||||
if (!attachment) continue;
|
if (!attachment) {
|
||||||
if (!attachment->getRTTI().isExactly(RegionAttachment::rtti) && !attachment->getRTTI().isExactly(MeshAttachment::rtti) && !attachment->getRTTI().isExactly(ClippingAttachment::rtti)) continue;
|
clipper.clipEnd(*slot);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!attachment->getRTTI().isExactly(RegionAttachment::rtti) && !attachment->getRTTI().isExactly(MeshAttachment::rtti) && !attachment->getRTTI().isExactly(ClippingAttachment::rtti)) {
|
||||||
|
clipper.clipEnd(*slot);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (attachment->getRTTI().isExactly(RegionAttachment::rtti)) {
|
if (attachment->getRTTI().isExactly(RegionAttachment::rtti)) {
|
||||||
RegionAttachment* regionAttachment = (RegionAttachment*)attachment;
|
RegionAttachment* regionAttachment = (RegionAttachment*)attachment;
|
||||||
@ -278,23 +287,38 @@ void SSpineWidget::UpdateMesh(int32 LayerId, FSlateWindowElementList& OutDrawEle
|
|||||||
UMaterialInstanceDynamic* material = nullptr;
|
UMaterialInstanceDynamic* material = nullptr;
|
||||||
switch (slot->getData().getBlendMode()) {
|
switch (slot->getData().getBlendMode()) {
|
||||||
case BlendMode_Normal:
|
case BlendMode_Normal:
|
||||||
if (!widget->pageToNormalBlendMaterial.Contains(attachmentAtlasRegion->page)) continue;
|
if (!widget->pageToNormalBlendMaterial.Contains(attachmentAtlasRegion->page)) {
|
||||||
|
clipper.clipEnd(*slot);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
material = widget->pageToNormalBlendMaterial[attachmentAtlasRegion->page];
|
material = widget->pageToNormalBlendMaterial[attachmentAtlasRegion->page];
|
||||||
break;
|
break;
|
||||||
case BlendMode_Additive:
|
case BlendMode_Additive:
|
||||||
if (!widget->pageToAdditiveBlendMaterial.Contains(attachmentAtlasRegion->page)) continue;
|
if (!widget->pageToAdditiveBlendMaterial.Contains(attachmentAtlasRegion->page)) {
|
||||||
|
clipper.clipEnd(*slot);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
material = widget->pageToAdditiveBlendMaterial[attachmentAtlasRegion->page];
|
material = widget->pageToAdditiveBlendMaterial[attachmentAtlasRegion->page];
|
||||||
break;
|
break;
|
||||||
case BlendMode_Multiply:
|
case BlendMode_Multiply:
|
||||||
if (!widget->pageToMultiplyBlendMaterial.Contains(attachmentAtlasRegion->page)) continue;
|
if (!widget->pageToMultiplyBlendMaterial.Contains(attachmentAtlasRegion->page)) {
|
||||||
|
clipper.clipEnd(*slot);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
material = widget->pageToMultiplyBlendMaterial[attachmentAtlasRegion->page];
|
material = widget->pageToMultiplyBlendMaterial[attachmentAtlasRegion->page];
|
||||||
break;
|
break;
|
||||||
case BlendMode_Screen:
|
case BlendMode_Screen:
|
||||||
if (!widget->pageToScreenBlendMaterial.Contains(attachmentAtlasRegion->page)) continue;
|
if (!widget->pageToScreenBlendMaterial.Contains(attachmentAtlasRegion->page)) {
|
||||||
|
clipper.clipEnd(*slot);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
material = widget->pageToScreenBlendMaterial[attachmentAtlasRegion->page];
|
material = widget->pageToScreenBlendMaterial[attachmentAtlasRegion->page];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (!widget->pageToNormalBlendMaterial.Contains(attachmentAtlasRegion->page)) continue;
|
if (!widget->pageToNormalBlendMaterial.Contains(attachmentAtlasRegion->page)) {
|
||||||
|
clipper.clipEnd(*slot);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
material = widget->pageToNormalBlendMaterial[attachmentAtlasRegion->page];
|
material = widget->pageToNormalBlendMaterial[attachmentAtlasRegion->page];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,7 +329,10 @@ void SSpineWidget::UpdateMesh(int32 LayerId, FSlateWindowElementList& OutDrawEle
|
|||||||
attachmentIndices = clipper.getClippedTriangles().buffer();
|
attachmentIndices = clipper.getClippedTriangles().buffer();
|
||||||
numIndices = clipper.getClippedTriangles().size();
|
numIndices = clipper.getClippedTriangles().size();
|
||||||
attachmentUvs = clipper.getClippedUVs().buffer();
|
attachmentUvs = clipper.getClippedUVs().buffer();
|
||||||
if (clipper.getClippedTriangles().size() == 0) continue;
|
if (clipper.getClippedTriangles().size() == 0) {
|
||||||
|
clipper.clipEnd(*slot);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastMaterial != material) {
|
if (lastMaterial != material) {
|
||||||
|
|||||||
@ -223,8 +223,14 @@ void USpineSkeletonRendererComponent::UpdateMesh(Skeleton* Skeleton) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!attachment) continue;
|
if (!attachment) {
|
||||||
if (!attachment->getRTTI().isExactly(RegionAttachment::rtti) && !attachment->getRTTI().isExactly(MeshAttachment::rtti) && !attachment->getRTTI().isExactly(ClippingAttachment::rtti)) continue;
|
clipper.clipEnd(*slot);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!attachment->getRTTI().isExactly(RegionAttachment::rtti) && !attachment->getRTTI().isExactly(MeshAttachment::rtti) && !attachment->getRTTI().isExactly(ClippingAttachment::rtti)) {
|
||||||
|
clipper.clipEnd(*slot);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (attachment->getRTTI().isExactly(RegionAttachment::rtti)) {
|
if (attachment->getRTTI().isExactly(RegionAttachment::rtti)) {
|
||||||
RegionAttachment* regionAttachment = (RegionAttachment*)attachment;
|
RegionAttachment* regionAttachment = (RegionAttachment*)attachment;
|
||||||
@ -270,23 +276,38 @@ void USpineSkeletonRendererComponent::UpdateMesh(Skeleton* Skeleton) {
|
|||||||
UMaterialInstanceDynamic* material = nullptr;
|
UMaterialInstanceDynamic* material = nullptr;
|
||||||
switch (slot->getData().getBlendMode()) {
|
switch (slot->getData().getBlendMode()) {
|
||||||
case BlendMode_Normal:
|
case BlendMode_Normal:
|
||||||
if (!pageToNormalBlendMaterial.Contains(attachmentAtlasRegion->page)) continue;
|
if (!pageToNormalBlendMaterial.Contains(attachmentAtlasRegion->page)) {
|
||||||
|
clipper.clipEnd(*slot);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
material = pageToNormalBlendMaterial[attachmentAtlasRegion->page];
|
material = pageToNormalBlendMaterial[attachmentAtlasRegion->page];
|
||||||
break;
|
break;
|
||||||
case BlendMode_Additive:
|
case BlendMode_Additive:
|
||||||
if (!pageToAdditiveBlendMaterial.Contains(attachmentAtlasRegion->page)) continue;
|
if (!pageToAdditiveBlendMaterial.Contains(attachmentAtlasRegion->page)) {
|
||||||
|
clipper.clipEnd(*slot);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
material = pageToAdditiveBlendMaterial[attachmentAtlasRegion->page];
|
material = pageToAdditiveBlendMaterial[attachmentAtlasRegion->page];
|
||||||
break;
|
break;
|
||||||
case BlendMode_Multiply:
|
case BlendMode_Multiply:
|
||||||
if (!pageToMultiplyBlendMaterial.Contains(attachmentAtlasRegion->page)) continue;
|
if (!pageToMultiplyBlendMaterial.Contains(attachmentAtlasRegion->page)) {
|
||||||
|
clipper.clipEnd(*slot);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
material = pageToMultiplyBlendMaterial[attachmentAtlasRegion->page];
|
material = pageToMultiplyBlendMaterial[attachmentAtlasRegion->page];
|
||||||
break;
|
break;
|
||||||
case BlendMode_Screen:
|
case BlendMode_Screen:
|
||||||
if (!pageToScreenBlendMaterial.Contains(attachmentAtlasRegion->page)) continue;
|
if (!pageToScreenBlendMaterial.Contains(attachmentAtlasRegion->page)) {
|
||||||
|
clipper.clipEnd(*slot);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
material = pageToScreenBlendMaterial[attachmentAtlasRegion->page];
|
material = pageToScreenBlendMaterial[attachmentAtlasRegion->page];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (!pageToNormalBlendMaterial.Contains(attachmentAtlasRegion->page)) continue;
|
if (!pageToNormalBlendMaterial.Contains(attachmentAtlasRegion->page)) {
|
||||||
|
clipper.clipEnd(*slot);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
material = pageToNormalBlendMaterial[attachmentAtlasRegion->page];
|
material = pageToNormalBlendMaterial[attachmentAtlasRegion->page];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -297,7 +318,10 @@ void USpineSkeletonRendererComponent::UpdateMesh(Skeleton* Skeleton) {
|
|||||||
attachmentIndices = clipper.getClippedTriangles().buffer();
|
attachmentIndices = clipper.getClippedTriangles().buffer();
|
||||||
numIndices = clipper.getClippedTriangles().size();
|
numIndices = clipper.getClippedTriangles().size();
|
||||||
attachmentUvs = clipper.getClippedUVs().buffer();
|
attachmentUvs = clipper.getClippedUVs().buffer();
|
||||||
if (clipper.getClippedTriangles().size() == 0) continue;
|
if (clipper.getClippedTriangles().size() == 0) {
|
||||||
|
clipper.clipEnd(*slot);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastMaterial != material) {
|
if (lastMaterial != material) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user