From 4c0ace849ad4f7c9d75ce474ad9c8b18fbecc1a9 Mon Sep 17 00:00:00 2001 From: natural-law Date: Wed, 9 Mar 2011 11:26:13 +0800 Subject: [PATCH] [wophone]fixed #383 1. Modify the approach of handle left soft-key clicked. 2. Fix some compile error. --- cocos2dx/platform/uphone/CCAccelerometer_uphone.cpp | 2 +- cocos2dx/platform/uphone/CCAccelerometer_uphone.h | 2 +- cocos2dx/platform/uphone/CCEGLView_uphone.cpp | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cocos2dx/platform/uphone/CCAccelerometer_uphone.cpp b/cocos2dx/platform/uphone/CCAccelerometer_uphone.cpp index bcba7c8797..c0957d1391 100644 --- a/cocos2dx/platform/uphone/CCAccelerometer_uphone.cpp +++ b/cocos2dx/platform/uphone/CCAccelerometer_uphone.cpp @@ -175,7 +175,7 @@ void CCAccelerometer::addDelegate(CCAccelerometerDelegate* pDelegate) } } -void CCAccelerometer::didAccelerate(UIAcceleration* pAccelerationValue) +void CCAccelerometer::didAccelerate(CCAcceleration* pAccelerationValue) { CCAccelerometerHandler *pHandler; CCAccelerometerDelegate *pDelegate; diff --git a/cocos2dx/platform/uphone/CCAccelerometer_uphone.h b/cocos2dx/platform/uphone/CCAccelerometer_uphone.h index 7b4b97ec57..6f0b4b0751 100644 --- a/cocos2dx/platform/uphone/CCAccelerometer_uphone.h +++ b/cocos2dx/platform/uphone/CCAccelerometer_uphone.h @@ -87,7 +87,7 @@ public: /** @brief call delegates' didAccelerate function */ - void didAccelerate(UIAcceleration* pAccelerationValue); + void didAccelerate(CCAcceleration* pAccelerationValue); protected: typedef CCMutableArray AccDelegateArray; diff --git a/cocos2dx/platform/uphone/CCEGLView_uphone.cpp b/cocos2dx/platform/uphone/CCEGLView_uphone.cpp index 0d38700b00..2c7c169d8d 100644 --- a/cocos2dx/platform/uphone/CCEGLView_uphone.cpp +++ b/cocos2dx/platform/uphone/CCEGLView_uphone.cpp @@ -293,8 +293,7 @@ Boolean CCEGLView::EventHandler(TApplication * pApp, EventType * pEvent) { bHandled = CCKeypadDispatcher::sharedDispatcher()->dispatchKeypadMSG(kTypeBackClicked); } - else if (pEvent->sParam1 == SYS_KEY_SOFTKEY_LEFT_UP || - pEvent->sParam1 == SYS_KEY_SOFTKEY_LEFT_LONG) + else if (pEvent->sParam1 == KEY_COMMAND_MAINMENU) { bHandled = CCKeypadDispatcher::sharedDispatcher()->dispatchKeypadMSG(kTypeMenuClicked); } @@ -309,7 +308,7 @@ Boolean CCEGLView::EventHandler(TApplication * pApp, EventType * pEvent) TG3_SENSOR_TYPE_ACCELEROMETER == data.sensorMask) { // convert the data to iphone format - UIAcceleration AccValue; + CCAcceleration AccValue; AccValue.x = -(data.acceleration.x / TG3_GRAVITY_EARTH); AccValue.y = -(data.acceleration.y / TG3_GRAVITY_EARTH); AccValue.z = -(data.acceleration.z / TG3_GRAVITY_EARTH);