Merge pull request #472 from minggo/iss680

fixed #680
This commit is contained in:
Walzer 2011-08-17 01:06:39 -07:00
commit d721f4d3c0
2 changed files with 17 additions and 1 deletions

View File

@ -325,6 +325,22 @@ public:
return m_array.rbegin();
}
CCMutableArrayIterator getLastValidIterator(void)
{
CCMutableArrayIterator iter;
CCMutableArrayIterator ret;
for (iter = m_array.begin(); iter != m_array.end(); ++iter)
{
ret = iter;
if (! (*iter))
{
break;
}
}
return ret;
}
/*
* end is a keyword of lua, so should use other name
* to export to lua

View File

@ -264,7 +264,7 @@ CCTouchHandler* CCTouchDispatcher::findHandler(CCTouchDelegate *pDelegate)
void CCTouchDispatcher::rearrangeHandlers(CCMutableArray<CCTouchHandler*> *pArray)
{
std::sort(pArray->begin(), pArray->end(), less);
std::sort(pArray->begin(), pArray->getLastValidIterator(), less);
}
void CCTouchDispatcher::setPriority(int nPriority, CCTouchDelegate *pDelegate)