Skip to content

Commit 83f114f

Browse files
committed
Update to work with Axmol 2.1
1 parent 2dc9fab commit 83f114f

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

src/spine/SkeletonAnimation.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ namespace spine {
5757
static SkeletonAnimation *createWithBinaryFile(const std::string &skeletonBinaryFile, const std::string &atlasFile, float scale = 1);
5858

5959
// Use createWithJsonFile instead
60-
AX_DEPRECATED_ATTRIBUTE static SkeletonAnimation *createWithFile(const std::string &skeletonJsonFile, Atlas *atlas, float scale = 1) {
60+
AX_DEPRECATED(2.1) static SkeletonAnimation *createWithFile(const std::string &skeletonJsonFile, Atlas *atlas, float scale = 1) {
6161
return SkeletonAnimation::createWithJsonFile(skeletonJsonFile, atlas, scale);
6262
}
6363
// Use createWithJsonFile instead
64-
AX_DEPRECATED_ATTRIBUTE static SkeletonAnimation *createWithFile(const std::string &skeletonJsonFile, const std::string &atlasFile, float scale = 1) {
64+
AX_DEPRECATED(2.1) static SkeletonAnimation *createWithFile(const std::string &skeletonJsonFile, const std::string &atlasFile, float scale = 1) {
6565
return SkeletonAnimation::createWithJsonFile(skeletonJsonFile, atlasFile, scale);
6666
}
6767

src/spine/SkeletonRenderer.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include <spine/Extension.h>
3232
#include <spine/spine-axmol.h>
3333

34-
USING_NS_AX;
34+
using namespace ax;
3535

3636
namespace spine {
3737

@@ -528,21 +528,19 @@ namespace spine {
528528

529529
// Draw bounding rectangle
530530
if (_debugBoundingRect) {
531-
drawNode->setLineWidth(2.0f);
532531
const axmol::Rect brect = getBoundingBox();
533532
const Vec2 points[4] =
534533
{
535534
brect.origin,
536535
{brect.origin.x + brect.size.width, brect.origin.y},
537536
{brect.origin.x + brect.size.width, brect.origin.y + brect.size.height},
538537
{brect.origin.x, brect.origin.y + brect.size.height}};
539-
drawNode->drawPoly(points, 4, true, Color4F::GREEN);
538+
drawNode->drawPoly(points, 4, true, Color4B::GREEN, 2.0f);
540539
}
541540

542541
if (_debugSlots) {
543542
// Slots.
544543
// DrawPrimitives::setDrawColor4B(0, 0, 255, 255);
545-
drawNode->setLineWidth(2.0f);
546544
V3F_C4B_T2F_Quad quad;
547545
for (int i = 0, n = (int)_skeleton->getSlots().size(); i < n; i++) {
548546
Slot *slot = _skeleton->getDrawOrder()[i];
@@ -563,33 +561,31 @@ namespace spine {
563561
{worldVertices[2], worldVertices[3]},
564562
{worldVertices[4], worldVertices[5]},
565563
{worldVertices[6], worldVertices[7]}};
566-
drawNode->drawPoly(points, 4, true, Color4F::BLUE);
564+
drawNode->drawPoly(points, 4, true, Color4B::BLUE, 2.0f);
567565
}
568566
}
569567

570568
if (_debugBones) {
571569
// Bone lengths.
572-
drawNode->setLineWidth(2.0f);
573570
for (int i = 0, n = (int)_skeleton->getBones().size(); i < n; i++) {
574571
Bone *bone = _skeleton->getBones()[i];
575572
if (!bone->isActive()) continue;
576573
float x = bone->getData().getLength() * bone->getA() + bone->getWorldX();
577574
float y = bone->getData().getLength() * bone->getC() + bone->getWorldY();
578-
drawNode->drawLine(Vec2(bone->getWorldX(), bone->getWorldY()), Vec2(x, y), Color4F::RED);
575+
drawNode->drawLine(Vec2(bone->getWorldX(), bone->getWorldY()), Vec2(x, y), Color4B::RED, 2.0f);
579576
}
580577
// Bone origins.
581-
auto color = Color4F::BLUE;// Root bone is blue.
578+
auto color = Color4B::BLUE;// Root bone is blue.
582579
for (int i = 0, n = (int)_skeleton->getBones().size(); i < n; i++) {
583580
Bone *bone = _skeleton->getBones()[i];
584581
if (!bone->isActive()) continue;
585582
drawNode->drawPoint(Vec2(bone->getWorldX(), bone->getWorldY()), 4, color);
586-
if (i == 0) color = Color4F::GREEN;
583+
if (i == 0) color = Color4B::GREEN;
587584
}
588585
}
589586

590587
if (_debugMeshes) {
591588
// Meshes.
592-
drawNode->setLineWidth(2.0f);
593589
for (int i = 0, n = (int)_skeleton->getSlots().size(); i < n; ++i) {
594590
Slot *slot = _skeleton->getDrawOrder()[i];
595591
if (!slot->getBone().isActive()) continue;
@@ -607,7 +603,7 @@ namespace spine {
607603
worldCoord + (idx0 * 2),
608604
worldCoord + (idx1 * 2),
609605
worldCoord + (idx2 * 2)};
610-
drawNode->drawPoly(v, 3, true, Color4F::YELLOW);
606+
drawNode->drawPoly(v, 3, true, Color4B::YELLOW, 2.0f);
611607
}
612608
VLA_FREE(worldCoord);
613609
}

0 commit comments

Comments
 (0)