fixed #1613:not reload resources on Android platform after return from background

This commit is contained in:
minggo 2013-04-17 15:34:57 +08:00
parent 3ecdb66553
commit 78d3c7f048
13 changed files with 24 additions and 2 deletions

View File

@ -81,7 +81,7 @@ Basically,it's only enabled in android
It's new in cocos2d-x since v0.99.5 It's new in cocos2d-x since v0.99.5
*/ */
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
#define CC_ENABLE_CACHE_TEXTURE_DATA 1 #define CC_ENABLE_CACHE_TEXTURE_DATA 0
#else #else
#define CC_ENABLE_CACHE_TEXTURE_DATA 0 #define CC_ENABLE_CACHE_TEXTURE_DATA 0
#endif #endif

View File

@ -176,7 +176,7 @@ public class Cocos2dxGLSurfaceView extends GLSurfaceView {
} }
}); });
super.onPause(); //super.onPause();
} }
@Override @Override

View File

@ -28,6 +28,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
AppDelegate *pAppDelegate = new AppDelegate(); AppDelegate *pAppDelegate = new AppDelegate();
CCApplication::sharedApplication()->run(); CCApplication::sharedApplication()->run();
} }
/*
else else
{ {
ccDrawInit(); ccDrawInit();
@ -38,6 +39,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL); CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL);
CCDirector::sharedDirector()->setGLDefaultValues(); CCDirector::sharedDirector()->setGLDefaultValues();
} }
*/
} }
} }

View File

@ -30,6 +30,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
AppDelegate *pAppDelegate = new AppDelegate(); AppDelegate *pAppDelegate = new AppDelegate();
CCApplication::sharedApplication()->run(); CCApplication::sharedApplication()->run();
} }
/*
else else
{ {
ccDrawInit(); ccDrawInit();
@ -40,6 +41,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL); CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL);
CCDirector::sharedDirector()->setGLDefaultValues(); CCDirector::sharedDirector()->setGLDefaultValues();
} }
*/
} }
} }

View File

@ -30,6 +30,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
AppDelegate *pAppDelegate = new AppDelegate(); AppDelegate *pAppDelegate = new AppDelegate();
CCApplication::sharedApplication()->run(); CCApplication::sharedApplication()->run();
} }
/*
else else
{ {
ccDrawInit(); ccDrawInit();
@ -40,6 +41,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL); CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL);
CCDirector::sharedDirector()->setGLDefaultValues(); CCDirector::sharedDirector()->setGLDefaultValues();
} }
*/
} }
} }

View File

@ -30,6 +30,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
AppDelegate *pAppDelegate = new AppDelegate(); AppDelegate *pAppDelegate = new AppDelegate();
CCApplication::sharedApplication()->run(); CCApplication::sharedApplication()->run();
} }
/*
else else
{ {
ccDrawInit(); ccDrawInit();
@ -40,6 +41,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL); CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL);
CCDirector::sharedDirector()->setGLDefaultValues(); CCDirector::sharedDirector()->setGLDefaultValues();
} }
*/
} }
} }

View File

@ -30,6 +30,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
AppDelegate *pAppDelegate = new AppDelegate(); AppDelegate *pAppDelegate = new AppDelegate();
CCApplication::sharedApplication()->run(); CCApplication::sharedApplication()->run();
} }
/*
else else
{ {
ccDrawInit(); ccDrawInit();
@ -40,6 +41,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL); CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL);
CCDirector::sharedDirector()->setGLDefaultValues(); CCDirector::sharedDirector()->setGLDefaultValues();
} }
*/
} }
} }

View File

@ -31,6 +31,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
AppDelegate *pAppDelegate = new AppDelegate(); AppDelegate *pAppDelegate = new AppDelegate();
CCApplication::sharedApplication()->run(); CCApplication::sharedApplication()->run();
} }
/*
else else
{ {
ccDrawInit(); ccDrawInit();
@ -41,6 +42,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL); CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL);
CCDirector::sharedDirector()->setGLDefaultValues(); CCDirector::sharedDirector()->setGLDefaultValues();
} }
*/
} }

View File

@ -30,6 +30,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
AppDelegate *pAppDelegate = new AppDelegate(); AppDelegate *pAppDelegate = new AppDelegate();
CCApplication::sharedApplication()->run(); CCApplication::sharedApplication()->run();
} }
/*
else else
{ {
ccDrawInit(); ccDrawInit();
@ -40,6 +41,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL); CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL);
CCDirector::sharedDirector()->setGLDefaultValues(); CCDirector::sharedDirector()->setGLDefaultValues();
} }
*/
} }
} }

View File

@ -30,6 +30,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
AppDelegate *pAppDelegate = new AppDelegate(); AppDelegate *pAppDelegate = new AppDelegate();
CCApplication::sharedApplication()->run(); CCApplication::sharedApplication()->run();
} }
/*
else else
{ {
ccDrawInit(); ccDrawInit();
@ -40,6 +41,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL); CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL);
CCDirector::sharedDirector()->setGLDefaultValues(); CCDirector::sharedDirector()->setGLDefaultValues();
} }
*/
} }
} }

View File

@ -30,6 +30,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
AppDelegate *pAppDelegate = new AppDelegate(); AppDelegate *pAppDelegate = new AppDelegate();
CCApplication::sharedApplication()->run(); CCApplication::sharedApplication()->run();
} }
/*
else else
{ {
ccDrawInit(); ccDrawInit();
@ -40,6 +41,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL); CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL);
CCDirector::sharedDirector()->setGLDefaultValues(); CCDirector::sharedDirector()->setGLDefaultValues();
} }
*/
} }
} }

View File

@ -30,6 +30,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
AppDelegate *pAppDelegate = new AppDelegate(); AppDelegate *pAppDelegate = new AppDelegate();
CCApplication::sharedApplication()->run(); CCApplication::sharedApplication()->run();
} }
/*
else else
{ {
ccDrawInit(); ccDrawInit();
@ -40,6 +41,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL); CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL);
CCDirector::sharedDirector()->setGLDefaultValues(); CCDirector::sharedDirector()->setGLDefaultValues();
} }
*/
} }
} }

View File

@ -30,6 +30,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
AppDelegate *pAppDelegate = new AppDelegate(); AppDelegate *pAppDelegate = new AppDelegate();
CCApplication::sharedApplication()->run(); CCApplication::sharedApplication()->run();
} }
/*
else else
{ {
ccDrawInit(); ccDrawInit();
@ -40,6 +41,7 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL); CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL);
CCDirector::sharedDirector()->setGLDefaultValues(); CCDirector::sharedDirector()->setGLDefaultValues();
} }
*/
} }
} }