Merge pull request #3632 from dumganhar/develop

issue #2087: [dispatcher]  fixedPriority == 0 is forbidden since it's used for scene graph based priority.
This commit is contained in:
James Chen 2013-09-16 07:47:16 -07:00
commit ec57e99d63
2 changed files with 3 additions and 1 deletions

View File

@ -121,6 +121,7 @@ void EventDispatcher::addEventListenerWithSceneGraphPriority(EventListener* list
void EventDispatcher::addEventListenerWithFixedPriority(EventListener* listener, int fixedPriority)
{
CCASSERT(!listener->_isRegistered, "The listener has been registered.");
CCASSERT(fixedPriority != 0, "0 priority is forbidden for fixed priority since it's used for scene graph based priority.");
if (!listener->checkAvaiable())
return;

View File

@ -59,7 +59,7 @@ public:
* @param listener The listener of a specified event.
* @param node The priority of the listener is based on the draw order of this node.
* @note The priority of scene graph will be fixed value 0. So the order of listener item
* in the vector will be ' <0, =0, scene graph, >0'.
* in the vector will be ' <0, scene graph (0 priority), >0'.
*/
void addEventListenerWithSceneGraphPriority(EventListener* listener, Node* node);
@ -67,6 +67,7 @@ public:
* @param listener The listener of a specified event.
* @param fixedPriority The fixed priority of the listener.
* @note A lower priority will be called before the ones that have a higher value.
* 0 priority is forbidden for fixed priority since it's used for scene graph based priority.
*/
void addEventListenerWithFixedPriority(EventListener* listener, int fixedPriority);