Merge pull request #690 from gzito/master

Some minor fixes for Marmalade port
This commit is contained in:
minggo 2012-01-29 21:35:57 -08:00
commit 126558aa1d
8 changed files with 33 additions and 25 deletions

View File

@ -0,0 +1 @@
abc899cd55086105f439df7a6d01db84168aebb5

View File

@ -67,37 +67,36 @@ int CCApplication::Run()
return 0;
}
int64 updateTime = s3eTimerGetMs();
uint64 updateTime = 0 ;
while (true)
{
int64 currentTime = s3eTimerGetMs();
if (currentTime - updateTime > m_nAnimationInterval)
{
updateTime = currentTime;
updateTime = s3eTimerGetMs();
s3eDeviceYield(0);
s3eKeyboardUpdate();
s3ePointerUpdate();
s3eDeviceYield(0);
s3eKeyboardUpdate();
s3ePointerUpdate();
ccAccelerationUpdate();
ccAccelerationUpdate();
quitRequested = s3eDeviceCheckQuitRequest() ;
if( quitRequested && CCDirector::sharedDirector()->getOpenGLView() != NULL ) {
CCDirector::sharedDirector()->end() ;
// end status will be processed in CCDirector::sharedDirector()->mainLoop();
}
CCDirector::sharedDirector()->mainLoop();
if( quitRequested ) {
break ;
}
quitRequested = s3eDeviceCheckQuitRequest() ;
if( quitRequested && CCDirector::sharedDirector()->getOpenGLView() != NULL ) {
CCDirector::sharedDirector()->end() ;
// end status will be processed in CCDirector::sharedDirector()->mainLoop();
}
else
{
s3eDeviceYield(0);
CCDirector::sharedDirector()->mainLoop();
if( quitRequested ) {
break ;
}
while ((s3eTimerGetMs() - updateTime) < m_nAnimationInterval) {
int32 yield = (int32) (m_nAnimationInterval - (s3eTimerGetMs() - updateTime));
if (yield<0)
break;
s3eDeviceYield(yield);
}
}
return -1;
@ -125,9 +124,12 @@ void CCApplication::statusBarFrame(CCRect * rect)
}
void CCApplication::ccAccelerationUpdate()
{
// Accelerometer doesn't work on Marmalade X86 MacOS-X simulator
#if !(defined(__APPLE__) && defined(I3D_ARCH_X86))
CCAccelerometer::sharedAccelerometer()->update(s3eAccelerometerGetX(),s3eAccelerometerGetY(),s3eAccelerometerGetZ(),s3eTimerGetMs());
#endif
}
//////////////////////////////////////////////////////////////////////////
// static member function
//////////////////////////////////////////////////////////////////////////

View File

@ -113,7 +113,7 @@ public:
static ccLanguageType getCurrentLanguage();
protected:
int64 m_nAnimationInterval;
uint64 m_nAnimationInterval;
static CCApplication * sm_pSharedApplication;
};

View File

@ -0,0 +1 @@
ebb3361a7a53d63ab60931a48bedc3ec8ccfe206

View File

@ -0,0 +1 @@
ab579da81872bb45c6e102dc2dbf6ee9e8082f75

View File

@ -0,0 +1 @@
cce195a8ee10fc4fd7b5acf048ab3e04b0750685

View File

@ -0,0 +1 @@
abc899cd55086105f439df7a6d01db84168aebb5

View File

@ -0,0 +1 @@
3f8554bba4214706aafc933d057de89351197eb4