mirror of https://github.com/axmolengine/axmol.git
Merge branch 'master' of https://github.com/cocos2d/cocos2d-x
This commit is contained in:
commit
32e7ee6e2f
|
@ -181,6 +181,10 @@ public class Cocos2dxActivity extends Activity{
|
|||
public static String getCocos2dxPackageName(){
|
||||
return packageName;
|
||||
}
|
||||
|
||||
public static void terminateProcess(){
|
||||
android.os.Process.killProcess(android.os.Process.myPid());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
|
|
|
@ -181,6 +181,10 @@ public class Cocos2dxActivity extends Activity{
|
|||
public static String getCocos2dxPackageName(){
|
||||
return packageName;
|
||||
}
|
||||
|
||||
public static void terminateProcess(){
|
||||
android.os.Process.killProcess(android.os.Process.myPid());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
#include <android/log.h>
|
||||
#include <jni.h>
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#define LOG_TAG "CCApplication_android Debug"
|
||||
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ bool CCEGLView::isOpenGLReady()
|
|||
|
||||
void CCEGLView::release()
|
||||
{
|
||||
exit(0);
|
||||
terminateProcessJNI();
|
||||
}
|
||||
|
||||
void CCEGLView::setTouchDelegate(EGLTouchDelegate * pDelegate)
|
||||
|
|
|
@ -456,4 +456,20 @@ extern "C"
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// terminate the process
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void terminateProcessJNI()
|
||||
{
|
||||
TMethodJNI t;
|
||||
|
||||
if (getMethodID(t
|
||||
, "org/cocos2dx/lib/Cocos2dxActivity"
|
||||
, "terminateProcess"
|
||||
, "()V"))
|
||||
{
|
||||
t.env->CallStaticObjectMethod(t.classID, t.methodID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,12 +30,13 @@ extern "C"
|
|||
|
||||
{
|
||||
extern JavaVM *gJavaVM;
|
||||
void enableAccelerometerJNI();
|
||||
void disableAccelerometerJNI();
|
||||
void showMessageBoxJNI(const char * pszMsg, const char * pszTitle);
|
||||
void setKeyboardStateJNI(int bOpen);
|
||||
char* getCurrentLanguageJNI();
|
||||
char* getPackageNameJNI();
|
||||
extern void enableAccelerometerJNI();
|
||||
extern void disableAccelerometerJNI();
|
||||
extern void showMessageBoxJNI(const char * pszMsg, const char * pszTitle);
|
||||
extern void setKeyboardStateJNI(int bOpen);
|
||||
extern char* getCurrentLanguageJNI();
|
||||
extern char* getPackageNameJNI();
|
||||
extern void terminateProcessJNI();
|
||||
}
|
||||
|
||||
#endif // __ANDROID_COCOS2D_JNI_H__
|
||||
|
|
|
@ -328,7 +328,7 @@ CCTexture2D * CCTextureCache::addPVRImage(const char* path)
|
|||
}
|
||||
else
|
||||
{
|
||||
CCLOG("cocos2d: Couldn't add PVRImage:%s in CCTextureCache",key);
|
||||
CCLOG("cocos2d: Couldn't add PVRImage:%s in CCTextureCache",key.c_str());
|
||||
}
|
||||
|
||||
return tex;
|
||||
|
|
|
@ -181,6 +181,10 @@ public class Cocos2dxActivity extends Activity{
|
|||
public static String getCocos2dxPackageName(){
|
||||
return packageName;
|
||||
}
|
||||
|
||||
public static void terminateProcess(){
|
||||
android.os.Process.killProcess(android.os.Process.myPid());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
|
|
Loading…
Reference in New Issue