2014-03-11 16:52:06 +08:00
|
|
|
#include "AppDelegate.h"
|
|
|
|
#include "cocos2d.h"
|
2014-05-17 05:36:00 +08:00
|
|
|
#include "platform/android/jni/JniHelper.h"
|
2014-03-11 16:52:06 +08:00
|
|
|
#include <jni.h>
|
|
|
|
#include <android/log.h>
|
2014-05-14 14:58:55 +08:00
|
|
|
#include "ConfigParser.h"
|
2014-03-11 16:52:06 +08:00
|
|
|
|
|
|
|
#define LOG_TAG "main"
|
|
|
|
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)
|
|
|
|
|
|
|
|
using namespace cocos2d;
|
|
|
|
|
2014-03-25 15:43:42 +08:00
|
|
|
void cocos_android_app_init (JNIEnv* env, jobject thiz) {
|
2014-03-11 16:52:06 +08:00
|
|
|
LOGD("cocos_android_app_init");
|
|
|
|
AppDelegate *pAppDelegate = new AppDelegate();
|
|
|
|
}
|
2014-05-14 14:58:55 +08:00
|
|
|
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
bool Java_org_cocos2dx_lua_AppActivity_nativeIsLandScape(JNIEnv *env, jobject thisz)
|
|
|
|
{
|
|
|
|
if (!ConfigParser::getInstance()->isInit())
|
|
|
|
{
|
|
|
|
ConfigParser::getInstance()->readConfig();
|
|
|
|
}
|
|
|
|
return ConfigParser::getInstance()->isLanscape();
|
|
|
|
}
|
2014-05-20 11:44:46 +08:00
|
|
|
|
|
|
|
bool Java_org_cocos2dx_lua_AppActivity_nativeIsDebug(JNIEnv *env, jobject thisz)
|
|
|
|
{
|
|
|
|
#ifdef NDEBUG
|
|
|
|
return false;
|
|
|
|
#else
|
|
|
|
return true;
|
|
|
|
#endif
|
|
|
|
}
|
2014-05-14 14:58:55 +08:00
|
|
|
}
|
|
|
|
|