Use getInstance() instead of various deprecated singleton access methods

This commit is contained in:
folecr 2013-07-26 15:51:44 -07:00
parent af1e450fe6
commit 9cefb85bea
1 changed files with 7 additions and 7 deletions

View File

@ -70,9 +70,9 @@ static void cocos_init(cocos_dimensions d, AAssetManager* assetmanager) {
cocos2d::FileUtilsAndroid::setassetmanager(assetmanager); cocos2d::FileUtilsAndroid::setassetmanager(assetmanager);
if (!cocos2d::Director::sharedDirector()->getOpenGLView()) if (!cocos2d::Director::getInstance()->getOpenGLView())
{ {
cocos2d::EGLView *view = cocos2d::EGLView::sharedOpenGLView(); cocos2d::EGLView *view = cocos2d::EGLView::getInstance();
view->setFrameSize(d.w, d.h); view->setFrameSize(d.w, d.h);
cocos_android_app_init(); cocos_android_app_init();
@ -188,7 +188,7 @@ static void engine_draw_frame(struct engine* engine) {
return; return;
} }
cocos2d::Director::sharedDirector()->mainLoop(); cocos2d::Director::getInstance()->mainLoop();
LOG_RENDER_DEBUG("engine_draw_frame : just called cocos' mainLoop()"); LOG_RENDER_DEBUG("engine_draw_frame : just called cocos' mainLoop()");
/* // Just fill the screen with a color. */ /* // Just fill the screen with a color. */
@ -286,8 +286,8 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) {
engine->accelerometerSensor, (1000L/60)*1000); engine->accelerometerSensor, (1000L/60)*1000);
} }
if (cocos2d::Director::sharedDirector()->getOpenGLView()) { if (cocos2d::Director::getInstance()->getOpenGLView()) {
cocos2d::Application::sharedApplication()->applicationWillEnterForeground(); cocos2d::Application::getInstance()->applicationWillEnterForeground();
} }
break; break;
@ -299,8 +299,8 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) {
engine->accelerometerSensor); engine->accelerometerSensor);
} }
cocos2d::Application::sharedApplication()->applicationDidEnterBackground(); cocos2d::Application::getInstance()->applicationDidEnterBackground();
cocos2d::NotificationCenter::sharedNotificationCenter()->postNotification(EVENT_COME_TO_BACKGROUND, NULL); cocos2d::NotificationCenter::getInstance()->postNotification(EVENT_COME_TO_BACKGROUND, NULL);
// Also stop animating. // Also stop animating.
engine->animating = 0; engine->animating = 0;