diff --git a/cocos/editor-support/cocostudio/CCSkin.cpp b/cocos/editor-support/cocostudio/CCSkin.cpp index 7b4a100069..00d8137a73 100644 --- a/cocos/editor-support/cocostudio/CCSkin.cpp +++ b/cocos/editor-support/cocostudio/CCSkin.cpp @@ -213,6 +213,17 @@ kmMat4 Skin::getNodeToWorldTransformAR() const return TransformConcat(displayTransform, _bone->getArmature()->getNodeToWorldTransform()); } +void Skin::draw() +{ + kmMat4 mv; + kmGLGetMatrix(KM_GL_MODELVIEW, &mv); + + //TODO implement z order + QuadCommand* renderCommand = QuadCommand::getCommandPool().generateCommand(); + renderCommand->init(0, _vertexZ, _texture->getName(), _shaderProgram, _blendFunc, &_quad, 1, mv); + Director::getInstance()->getRenderer()->addCommand(renderCommand); +} + void Skin::setBone(Bone *bone) { _bone = bone; diff --git a/cocos/editor-support/cocostudio/CCSkin.h b/cocos/editor-support/cocostudio/CCSkin.h index 2c580c3038..10dd72c5eb 100644 --- a/cocos/editor-support/cocostudio/CCSkin.h +++ b/cocos/editor-support/cocostudio/CCSkin.h @@ -50,6 +50,9 @@ public: kmMat4 getNodeToWorldTransform() const override; kmMat4 getNodeToWorldTransformAR() const; + + virtual void draw() override; + /** * @js NA * @lua NA diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp index 6885a7871f..059313e410 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp @@ -527,7 +527,7 @@ void TestAnimationEvent::onEnter() * Set armature's movement event callback function * To disconnect this event, just setMovementEventCallFunc(nullptr, nullptr); */ - armature->getAnimation()->setMovementEventCallFunc(CC_CALLBACK_0(TestAnimationEvent::animationEvent, this, placeholders::_1, placeholders::_2, placeholders::_3)); + armature->getAnimation()->setMovementEventCallFunc(CC_CALLBACK_0(TestAnimationEvent::animationEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); addChild(armature); } std::string TestAnimationEvent::title() const @@ -583,7 +583,7 @@ void TestFrameEvent::onEnter() * Set armature's frame event callback function * To disconnect this event, just setFrameEventCallFunc(nullptr); */ - armature->getAnimation()->setFrameEventCallFunc(CC_CALLBACK_0(TestFrameEvent::onFrameEvent, this, placeholders::_1, placeholders::_2, placeholders::_3, placeholders::_4)); + armature->getAnimation()->setFrameEventCallFunc(CC_CALLBACK_0(TestFrameEvent::onFrameEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); addChild(armature); schedule( schedule_selector(TestFrameEvent::checkAction) ); @@ -752,7 +752,7 @@ void TestColliderDetector::onEnter() * Set armature's frame event callback function * To disconnect this event, just setFrameEventCallFunc(nullptr); */ - armature->getAnimation()->setFrameEventCallFunc(CC_CALLBACK_0(TestColliderDetector::onFrameEvent, this, placeholders::_1, placeholders::_2, placeholders::_3, placeholders::_4)); + armature->getAnimation()->setFrameEventCallFunc(CC_CALLBACK_0(TestColliderDetector::onFrameEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); addChild(armature); armature2 = Armature::create("Cowboy"); @@ -1374,12 +1374,12 @@ void TestPlaySeveralMovement::onEnter() armature->setPosition(Point(VisibleRect::center().x, VisibleRect::center().y/*-100*/)); addChild(armature); } -std::string TestPlaySeveralMovement::title() +std::string TestPlaySeveralMovement::title() const { return "Test play several movement"; } -std::string TestPlaySeveralMovement::subtitle() +std::string TestPlaySeveralMovement::subtitle()const { return "Movement is played one by one"; } @@ -1405,11 +1405,11 @@ void TestEasing::onEnter() updateSubTitle(); } -std::string TestEasing::title() +std::string TestEasing::title() const { return "Test easing effect"; } -std::string TestEasing::subtitle() +std::string TestEasing::subtitle() const { return "Current easing : "; } diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h index 51d4fbd5d8..b118589f64 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h @@ -267,7 +267,7 @@ public: ~TestColliderDetector(); virtual void onEnter(); - virtual std::string title(); + virtual std::string title() const override; virtual void update(float delta); virtual void draw(); @@ -354,8 +354,8 @@ class TestPlaySeveralMovement : public ArmatureTestLayer { public: virtual void onEnter(); - virtual std::string title(); - virtual std::string subtitle(); + virtual std::string title() const override; + virtual std::string subtitle() const override; }; @@ -363,8 +363,8 @@ class TestEasing : public ArmatureTestLayer { public: virtual void onEnter(); - virtual std::string title(); - virtual std::string subtitle(); + virtual std::string title() const override; + virtual std::string subtitle() const override; void onTouchesEnded(const std::vector& touches, Event* event); void updateSubTitle();