mirror of https://github.com/axmolengine/axmol.git
fixed #1613:not reload resources on Android platform after return from background
This commit is contained in:
parent
3ecdb66553
commit
78d3c7f048
|
@ -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
|
||||||
|
|
|
@ -176,7 +176,7 @@ public class Cocos2dxGLSurfaceView extends GLSurfaceView {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
super.onPause();
|
//super.onPause();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue