ported more changes

This commit is contained in:
unknown 2019-07-02 11:47:45 +02:00
parent c8a34cdbd5
commit 9df2c28768

View File

@ -303,12 +303,18 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t
for (int i = 0, n = _skeleton->getSlots().size(); i < n; ++i) {
Slot* slot = _skeleton->getDrawOrder()[i];;
if (slotIsOutRange(*slot, _startSlotIndex, _endSlotIndex)) {
_clipper->clipEnd(*slot);
continue;
}
if (!slot->getAttachment()) {
_clipper->clipEnd(*slot);
continue;
}
if (slotIsOutRange(*slot, _startSlotIndex, _endSlotIndex)) {
// Early exit if slot is invisible
if (slot->getColor().a == 0) {
_clipper->clipEnd(*slot);
continue;
}
@ -317,8 +323,8 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t
TwoColorTriangles trianglesTwoColor;
if (slot->getAttachment()->getRTTI().isExactly(RegionAttachment::rtti)) {
RegionAttachment* attachment = (RegionAttachment*)slot->getAttachment();
attachmentVertices = (AttachmentVertices*)attachment->getRendererObject();
RegionAttachment* attachment = static_cast<RegionAttachment*>(slot->getAttachment());
attachmentVertices = static_cast<AttachmentVertices*>(attachment->getRendererObject());
// Early exit if attachment is invisible
if (attachment->getColor().a == 0) {
@ -892,6 +898,10 @@ namespace {
if (slotIsOutRange(slot, startSlotIndex, endSlotIndex))
{
continue;
}
// Early exit if slot is invisible
if (slot.getColor().a == 0) {
continue;
}
if (attachment->getRTTI().isExactly(RegionAttachment::rtti))
{
@ -925,6 +935,9 @@ namespace {
{
continue;
}
if (slot.getColor().a == 0) {
continue;
}
if (attachment->getRTTI().isExactly(RegionAttachment::rtti))
{
RegionAttachment* const regionAttachment = static_cast<RegionAttachment*>(attachment);