mirror of https://github.com/axmolengine/axmol.git
fixed #467 CCLayer:m_eTouchDelegateType = ccTouchDeletateAllBit all the time, which makes an error logic if adding standard touch delegate when CCTouchDispatcher::m_tLock = ture
This commit is contained in:
parent
3e643d73a3
commit
f7b294fe24
|
@ -40,13 +40,17 @@ typedef enum
|
|||
class CCTouch;
|
||||
class CCEvent;
|
||||
class CCSet;
|
||||
class CCTouchDispatcher;
|
||||
|
||||
class CC_DLL CCTouchDelegate
|
||||
{
|
||||
protected:
|
||||
ccTouchDelegateFlag m_eTouchDelegateType;
|
||||
|
||||
public:
|
||||
friend class CCTouchDispatcher; // only CCTouchDispatcher & children can change m_eTouchDelegateType
|
||||
inline ccTouchDelegateFlag getTouchDelegateType(void) { return m_eTouchDelegateType; }
|
||||
|
||||
//! call the release() in child(layer or menu)
|
||||
virtual void destroy(void) {}
|
||||
//! call the retain() in child (layer or menu)
|
||||
|
|
|
@ -132,6 +132,8 @@ void CCTouchDispatcher::forceAddHandler(CCTouchHandler *pHandler, CCMutableArray
|
|||
|
||||
void CCTouchDispatcher::addStandardDelegate(CCTouchDelegate *pDelegate, int nPriority)
|
||||
{
|
||||
pDelegate->m_eTouchDelegateType = ccTouchDelegateStandardBit;
|
||||
|
||||
CCTouchHandler *pHandler = CCStandardTouchHandler::handlerWithDelegate(pDelegate, nPriority);
|
||||
if (! m_bLocked)
|
||||
{
|
||||
|
@ -146,6 +148,8 @@ void CCTouchDispatcher::addStandardDelegate(CCTouchDelegate *pDelegate, int nPri
|
|||
|
||||
void CCTouchDispatcher::addTargetedDelegate(CCTouchDelegate *pDelegate, int nPriority, bool bSwallowsTouches)
|
||||
{
|
||||
pDelegate->m_eTouchDelegateType = ccTouchDelegateTargetedBit;
|
||||
|
||||
CCTouchHandler *pHandler = CCTargetedTouchHandler::handlerWithDelegate(pDelegate, nPriority, bSwallowsTouches);
|
||||
if (! m_bLocked)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue