issue #1437: fixed some compile errors.

This commit is contained in:
James Chen 2012-08-21 17:25:03 +08:00
parent 3eecc283d0
commit fac3e9c8de
5 changed files with 10 additions and 10 deletions

View File

@ -168,12 +168,12 @@ void CCAccelerometer::setDelegate(CCAccelerometerDelegate* pDelegate)
if (pDelegate) if (pDelegate)
{ {
// Register our handler // Register our handler
CCEGLView::sharedOpenGLView().setAccelerometerKeyHook( &myAccelerometerKeyHook ); CCEGLView::sharedOpenGLView()->setAccelerometerKeyHook( &myAccelerometerKeyHook );
} }
else else
{ {
// De-register our handler // De-register our handler
CCEGLView::sharedOpenGLView().setAccelerometerKeyHook( NULL ); CCEGLView::sharedOpenGLView()->setAccelerometerKeyHook( NULL );
resetAccelerometer(); resetAccelerometer();
} }
} }

View File

@ -99,10 +99,10 @@ void CCApplication::setAnimationInterval(double interval)
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// static member function // static member function
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
CCApplication& CCApplication::sharedApplication() CCApplication* CCApplication::sharedApplication()
{ {
CC_ASSERT(sm_pSharedApplication); CC_ASSERT(sm_pSharedApplication);
return *sm_pSharedApplication; return sm_pSharedApplication;
} }
ccLanguageType CCApplication::getCurrentLanguage() ccLanguageType CCApplication::getCurrentLanguage()

View File

@ -24,7 +24,7 @@ public:
@brief Get current applicaiton instance. @brief Get current applicaiton instance.
@return Current application instance pointer. @return Current application instance pointer.
*/ */
static CCApplication& sharedApplication(); static CCApplication* sharedApplication();
/* override functions */ /* override functions */
virtual void setAnimationInterval(double interval); virtual void setAnimationInterval(double interval);

View File

@ -248,10 +248,10 @@ LRESULT CCEGLView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
switch (wParam) switch (wParam)
{ {
case SIZE_RESTORED: case SIZE_RESTORED:
CCApplication::sharedApplication().applicationWillEnterForeground(); CCApplication::sharedApplication()->applicationWillEnterForeground();
break; break;
case SIZE_MINIMIZED: case SIZE_MINIMIZED:
CCApplication::sharedApplication().applicationDidEnterBackground(); CCApplication::sharedApplication()->applicationDidEnterBackground();
break; break;
} }
break; break;

View File

@ -14,7 +14,7 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
// create the application instance // create the application instance
AppDelegate app; AppDelegate app;
CCEGLView& eglView = CCEGLView::sharedOpenGLView(); CCEGLView* eglView = CCEGLView::sharedOpenGLView();
eglView.setFrameSize(960, 640 ); eglView->setFrameSize(960, 640 );
return CCApplication::sharedApplication().run(); return CCApplication::sharedApplication()->run();
} }