From f10bd853c03537bf73d426a487c408850f10cfdc Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 10 Dec 2013 20:33:21 +0800 Subject: [PATCH] A warning fix in CCBAnimationManager. Uses CallFuncN::create(std::function) instead. --- .../cocosbuilder/CCBAnimationManager.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp b/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp index f4faefcba6..431e5453c3 100644 --- a/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp +++ b/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp @@ -683,8 +683,14 @@ Object* CCBAnimationManager::actionForCallbackChannel(CCBSequenceProperty* chann } else { - // XXX: how to fix this warning? - CallFuncN *callback = CallFuncN::create(target, selCallFunc); + auto savedTarget = std::make_shared>(); + savedTarget->pushBack(target); + + auto callback = CallFuncN::create([savedTarget, selCallFunc](Node* sender){ + auto t = savedTarget->at(0); + (t->*selCallFunc)(sender); + }); + actions.pushBack(callback); } }