fixed #737: remove view id

This commit is contained in:
minggo 2012-03-12 11:00:12 +08:00
parent a0d30b5d1b
commit 7fc0ffbf26
3 changed files with 11 additions and 11 deletions

View File

@ -59,7 +59,7 @@ static CCTouch *s_pTouches[MAX_TOUCHES] = { NULL };
LOGD("Beginning touches with id: %d, x=%f, y=%f", id, x, y);
pTouch = new CCTouch();
pTouch->SetTouchInfo((x - rcRect.origin.x) / fScreenScaleFactor, (y - rcRect.origin.y) / fScreenScaleFactor, id);
pTouch->SetTouchInfo((x - rcRect.origin.x) / fScreenScaleFactor, (y - rcRect.origin.y) / fScreenScaleFactor);
s_pTouches[id] = pTouch;
set.addObject(pTouch);
@ -83,7 +83,7 @@ static CCTouch *s_pTouches[MAX_TOUCHES] = { NULL };
{
LOGD("Ending touches with id: %d, x=%f, y=%f", id, x, y);
pTouch->SetTouchInfo((x - rcRect.origin.x) / fScreenScaleFactor , (y - rcRect.origin.y) / fScreenScaleFactor, id);
pTouch->SetTouchInfo((x - rcRect.origin.x) / fScreenScaleFactor , (y - rcRect.origin.y) / fScreenScaleFactor);
set.addObject(pTouch);
// release the object
@ -116,7 +116,7 @@ static CCTouch *s_pTouches[MAX_TOUCHES] = { NULL };
if (pTouch)
{
pTouch->SetTouchInfo((x[i] - rcRect.origin.x) / fScreenScaleFactor ,
(y[i] - rcRect.origin.y) / fScreenScaleFactor, id[i]);
(y[i] - rcRect.origin.y) / fScreenScaleFactor);
set.addObject(pTouch);
}
else
@ -149,7 +149,7 @@ static CCTouch *s_pTouches[MAX_TOUCHES] = { NULL };
if (pTouch)
{
pTouch->SetTouchInfo((x[i] - rcRect.origin.x) / fScreenScaleFactor ,
(y[i] - rcRect.origin.y) / fScreenScaleFactor, id[i]);
(y[i] - rcRect.origin.y) / fScreenScaleFactor);
set.addObject(pTouch);
s_pTouches[id[i]] = NULL;
pTouch->release();

View File

@ -421,7 +421,7 @@ void CCEGLView::onTouchesBegin(int id[], float x[], float y[], int pointerNumber
{
pTouch = new CCTouch();
pTouch->SetTouchInfo((x[i] - m_rcViewPort.origin.x) / m_fScreenScaleFactor,
(y[i] - m_rcViewPort.origin.y) / m_fScreenScaleFactor, id[i]);
(y[i] - m_rcViewPort.origin.y) / m_fScreenScaleFactor);
s_mapTouches.Add(id[i], pTouch);
set.addObject(pTouch);
m_pDelegate->touchesBegan(&set, NULL);
@ -445,7 +445,7 @@ void CCEGLView::onTouchesMove(int id[], float x[], float y[], int pointerNumber)
if (E_SUCCESS == r && pTouch != NULL)
{
pTouch->SetTouchInfo((x[i] - m_rcViewPort.origin.x) / m_fScreenScaleFactor,
(y[i] - m_rcViewPort.origin.y) / m_fScreenScaleFactor, id[i]);
(y[i] - m_rcViewPort.origin.y) / m_fScreenScaleFactor);
set.addObject(pTouch);
}
else
@ -469,7 +469,7 @@ void CCEGLView::onTouchesEnd(int id[], float x[], float y[], int pointerNumber)
if (E_SUCCESS == r && pTouch != NULL)
{
pTouch->SetTouchInfo((x[i] - m_rcViewPort.origin.x) / m_fScreenScaleFactor,
(y[i] - m_rcViewPort.origin.y) / m_fScreenScaleFactor, id[i]);
(y[i] - m_rcViewPort.origin.y) / m_fScreenScaleFactor);
set.addObject(pTouch);
s_mapTouches.Remove(id[i]);
pTouch->release();

View File

@ -413,7 +413,7 @@ static cocos2d::CCTouch *s_pTouches[MAX_TOUCHES];
pTouch = s_pTouches[unUsedIndex] = new cocos2d::CCTouch();
float x = [touch locationInView: [touch view]].x;
float y = [touch locationInView: [touch view]].y;
pTouch->SetTouchInfo(x, y, unUsedIndex);
pTouch->SetTouchInfo(x, y);
CFDictionaryAddValue(touchesIntergerDict, touch, [NSNumber numberWithInt:unUsedIndex]);
@ -446,7 +446,7 @@ static cocos2d::CCTouch *s_pTouches[MAX_TOUCHES];
float x = [touch locationInView: [touch view]].x;
float y = [touch locationInView: [touch view]].y;
pTouch->SetTouchInfo(x, y, pTouch->id());
pTouch->SetTouchInfo(x, y);
set.addObject(pTouch);
}
@ -472,7 +472,7 @@ static cocos2d::CCTouch *s_pTouches[MAX_TOUCHES];
float x = [touch locationInView: [touch view]].x;
float y = [touch locationInView: [touch view]].y;
pTouch->SetTouchInfo(x, y, pTouch->id());
pTouch->SetTouchInfo(x, y);
set.addObject(pTouch);
CFDictionaryRemoveValue(touchesIntergerDict, touch);
@ -502,7 +502,7 @@ static cocos2d::CCTouch *s_pTouches[MAX_TOUCHES];
float x = [touch locationInView: [touch view]].x;
float y = [touch locationInView: [touch view]].y;
pTouch->SetTouchInfo(x, y, pTouch->id());
pTouch->SetTouchInfo(x, y);
set.addObject(pTouch);
CFDictionaryRemoveValue(touchesIntergerDict, touch);