[wophone]fixed #383

1. Modify the approach of handle left soft-key clicked.
2. Fix some compile error.
This commit is contained in:
natural-law 2011-03-09 11:26:13 +08:00
parent 1aafd4fc56
commit 4c0ace849a
3 changed files with 4 additions and 5 deletions

View File

@ -175,7 +175,7 @@ void CCAccelerometer::addDelegate(CCAccelerometerDelegate* pDelegate)
} }
} }
void CCAccelerometer::didAccelerate(UIAcceleration* pAccelerationValue) void CCAccelerometer::didAccelerate(CCAcceleration* pAccelerationValue)
{ {
CCAccelerometerHandler *pHandler; CCAccelerometerHandler *pHandler;
CCAccelerometerDelegate *pDelegate; CCAccelerometerDelegate *pDelegate;

View File

@ -87,7 +87,7 @@ public:
/** /**
@brief call delegates' didAccelerate function @brief call delegates' didAccelerate function
*/ */
void didAccelerate(UIAcceleration* pAccelerationValue); void didAccelerate(CCAcceleration* pAccelerationValue);
protected: protected:
typedef CCMutableArray<CCAccelerometerHandler*> AccDelegateArray; typedef CCMutableArray<CCAccelerometerHandler*> AccDelegateArray;

View File

@ -293,8 +293,7 @@ Boolean CCEGLView::EventHandler(TApplication * pApp, EventType * pEvent)
{ {
bHandled = CCKeypadDispatcher::sharedDispatcher()->dispatchKeypadMSG(kTypeBackClicked); bHandled = CCKeypadDispatcher::sharedDispatcher()->dispatchKeypadMSG(kTypeBackClicked);
} }
else if (pEvent->sParam1 == SYS_KEY_SOFTKEY_LEFT_UP || else if (pEvent->sParam1 == KEY_COMMAND_MAINMENU)
pEvent->sParam1 == SYS_KEY_SOFTKEY_LEFT_LONG)
{ {
bHandled = CCKeypadDispatcher::sharedDispatcher()->dispatchKeypadMSG(kTypeMenuClicked); bHandled = CCKeypadDispatcher::sharedDispatcher()->dispatchKeypadMSG(kTypeMenuClicked);
} }
@ -309,7 +308,7 @@ Boolean CCEGLView::EventHandler(TApplication * pApp, EventType * pEvent)
TG3_SENSOR_TYPE_ACCELEROMETER == data.sensorMask) TG3_SENSOR_TYPE_ACCELEROMETER == data.sensorMask)
{ {
// convert the data to iphone format // convert the data to iphone format
UIAcceleration AccValue; CCAcceleration AccValue;
AccValue.x = -(data.acceleration.x / TG3_GRAVITY_EARTH); AccValue.x = -(data.acceleration.x / TG3_GRAVITY_EARTH);
AccValue.y = -(data.acceleration.y / TG3_GRAVITY_EARTH); AccValue.y = -(data.acceleration.y / TG3_GRAVITY_EARTH);
AccValue.z = -(data.acceleration.z / TG3_GRAVITY_EARTH); AccValue.z = -(data.acceleration.z / TG3_GRAVITY_EARTH);