mirror of https://github.com/axmolengine/axmol.git
Merge pull request #836 from minggo/touch_case
fix TouchesTest crashed on Android and iOS
This commit is contained in:
commit
7cf16dbb32
|
@ -8,4 +8,4 @@
|
||||||
# project structure.
|
# project structure.
|
||||||
|
|
||||||
# Project target.
|
# Project target.
|
||||||
target=android-9
|
target=android-10
|
||||||
|
|
|
@ -78,6 +78,12 @@ void Paddle::ccTouchMoved(CCTouch* touch, CCEvent* event)
|
||||||
setPosition( CCPointMake(touchPoint.x, getPosition().y) );
|
setPosition( CCPointMake(touchPoint.x, getPosition().y) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CCObject* Paddle::copyWithZone(CCZone *pZone)
|
||||||
|
{
|
||||||
|
this->retain();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
void Paddle::ccTouchEnded(CCTouch* touch, CCEvent* event)
|
void Paddle::ccTouchEnded(CCTouch* touch, CCEvent* event)
|
||||||
{
|
{
|
||||||
CCAssert(m_state == kPaddleStateGrabbed, L"Paddle - Unexpected state!");
|
CCAssert(m_state == kPaddleStateGrabbed, L"Paddle - Unexpected state!");
|
||||||
|
|
|
@ -27,6 +27,7 @@ public:
|
||||||
virtual bool ccTouchBegan(CCTouch* touch, CCEvent* event);
|
virtual bool ccTouchBegan(CCTouch* touch, CCEvent* event);
|
||||||
virtual void ccTouchMoved(CCTouch* touch, CCEvent* event);
|
virtual void ccTouchMoved(CCTouch* touch, CCEvent* event);
|
||||||
virtual void ccTouchEnded(CCTouch* touch, CCEvent* event);
|
virtual void ccTouchEnded(CCTouch* touch, CCEvent* event);
|
||||||
|
virtual CCObject* copyWithZone(CCZone *pZone);
|
||||||
|
|
||||||
virtual void touchDelegateRetain();
|
virtual void touchDelegateRetain();
|
||||||
virtual void touchDelegateRelease();
|
virtual void touchDelegateRelease();
|
||||||
|
|
|
@ -24,7 +24,6 @@ enum
|
||||||
//
|
//
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
PongScene::PongScene()
|
PongScene::PongScene()
|
||||||
:TestScene(true)
|
|
||||||
{
|
{
|
||||||
PongLayer *pongLayer = new PongLayer();//PongLayer::node();
|
PongLayer *pongLayer = new PongLayer();//PongLayer::node();
|
||||||
addChild(pongLayer);
|
addChild(pongLayer);
|
||||||
|
@ -33,7 +32,6 @@ PongScene::PongScene()
|
||||||
|
|
||||||
void PongScene::MainMenuCallback(CCObject* pSender)
|
void PongScene::MainMenuCallback(CCObject* pSender)
|
||||||
{
|
{
|
||||||
CCDirector::sharedDirector()->setDeviceOrientation(CCDeviceOrientationPortrait);
|
|
||||||
TestScene::MainMenuCallback(pSender);
|
TestScene::MainMenuCallback(pSender);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue