[c][cpp] Ported active bone check in SkeletonBounds. See #1378.

This commit is contained in:
badlogic 2019-06-11 15:31:42 +02:00
parent f2fa37dbe0
commit d790429cd1
2 changed files with 4 additions and 0 deletions

View File

@ -129,6 +129,7 @@ void spSkeletonBounds_update (spSkeletonBounds* self, spSkeleton* skeleton, int/
spBoundingBoxAttachment* boundingBox;
spSlot* slot = skeleton->slots[i];
if (!slot->bone->active) continue;
spAttachment* attachment = slot->attachment;
if (!attachment || attachment->type != SP_ATTACHMENT_BOUNDING_BOX) continue;
boundingBox = (spBoundingBoxAttachment*)attachment;

View File

@ -34,6 +34,7 @@
#include <spine/SkeletonBounds.h>
#include <spine/Skeleton.h>
#include <spine/Bone.h>
#include <spine/BoundingBoxAttachment.h>
#include <spine/Slot.h>
@ -56,6 +57,8 @@ void SkeletonBounds::update(Skeleton &skeleton, bool updateAabb) {
for (size_t i = 0; i < slotCount; i++) {
Slot *slot = slots[i];
if (!slot->getBone().isActive()) continue;
Attachment *attachment = slot->getAttachment();
if (attachment == NULL || !attachment->getRTTI().instanceOf(BoundingBoxAttachment::rtti)) {
continue;