From b5a1360a1753cf9765630134fa75754ff49b6194 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 20 Mar 2017 09:28:12 +0800 Subject: [PATCH] revert #17437 (#17545) * revert #17437 * fix resource path --- cocos/2d/CCActionInterval.cpp | 5 -- cocos/2d/CCActionInterval.h | 1 - .../Classes/ActionsTest/ActionsTest.cpp | 57 ------------------- .../Classes/ActionsTest/ActionsTest.h | 15 ----- 4 files changed, 78 deletions(-) diff --git a/cocos/2d/CCActionInterval.cpp b/cocos/2d/CCActionInterval.cpp index 0bb8e28563..7705b84b64 100644 --- a/cocos/2d/CCActionInterval.cpp +++ b/cocos/2d/CCActionInterval.cpp @@ -422,11 +422,6 @@ Sequence* Sequence::reverse() const return nullptr; } -bool Sequence::isDone() const -{ - return (_last == 1) && _actions[1]->isDone(); -} - // // Repeat // diff --git a/cocos/2d/CCActionInterval.h b/cocos/2d/CCActionInterval.h index d93f30abaa..f87e901035 100644 --- a/cocos/2d/CCActionInterval.h +++ b/cocos/2d/CCActionInterval.h @@ -182,7 +182,6 @@ public: // virtual Sequence* clone() const override; virtual Sequence* reverse() const override; - virtual bool isDone() const override; virtual void startWithTarget(Node *target) override; virtual void stop(void) override; /** diff --git a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp index 4d16325c28..f022968475 100644 --- a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp +++ b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp @@ -92,7 +92,6 @@ ActionsTests::ActionsTests() ADD_TEST_CASE(ActionFloatTest); ADD_TEST_CASE(Issue14936_1); ADD_TEST_CASE(Issue14936_2); - ADD_TEST_CASE(SequenceWithFinalInstant); } std::string ActionsDemo::title() const @@ -2395,59 +2394,3 @@ std::string ActionFloatTest::subtitle() const } - -//------------------------------------------------------------------ -// -// SequenceWithFinalInstant -// -//------------------------------------------------------------------ -void SequenceWithFinalInstant::onEnter() -{ - ActionsDemo::onEnter(); - - _manager = new cocos2d::ActionManager(); - - _target = cocos2d::Node::create(); - _target->setActionManager( _manager ); - _target->retain(); - _target->onEnter(); - - bool called( false ); - const auto f - ( [ &called ]() -> void - { - cocos2d::log("Callback called."); - called = true; - } ); - - const auto action = - cocos2d::Sequence::create - (cocos2d::DelayTime::create(0.05), - cocos2d::CallFunc::create(f), - nullptr); - - _target->runAction(action); - _manager->update(0); - _manager->update(0.05 - FLT_EPSILON); - - if ( action->isDone() && !called ) - cocos2d::log - ("Action says it is done but is not." - " called=%d, elapsed=%f, duration=%f", - (int)called, action->getElapsed(), action->getDuration()); - else - cocos2d::log("Everything went fine."); -} - -void SequenceWithFinalInstant::onExit() -{ - ActionsDemo::onExit(); - _target->onExit(); - _target->release(); - _manager->release(); -} - -std::string SequenceWithFinalInstant::subtitle() const -{ - return "Instant action should be run. See console."; -} diff --git a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h index ee96983652..0893204cf7 100644 --- a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h +++ b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h @@ -620,19 +620,4 @@ private: int _count; }; -class SequenceWithFinalInstant : public ActionsDemo -{ -public: - CREATE_FUNC(SequenceWithFinalInstant); - - virtual std::string subtitle() const override; - virtual void onEnter() override; - virtual void onExit() override; - -private: - cocos2d::ActionManager* _manager; - cocos2d::Node* _target; - -}; - #endif