summaryrefslogtreecommitdiffstats
path: root/platform/android/java_glue.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-06-27 23:21:45 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-06-27 23:21:45 -0300
commit2af2a84a03fd707cfa4c682aff34d722343d8985 (patch)
tree50d064e8bba7d5efb5974e3fa3a67e076fb5ef8b /platform/android/java_glue.cpp
parent1cc96a4d7440d9e8a20f7dbf17cf5771170de83d (diff)
downloadredot-engine-2af2a84a03fd707cfa4c682aff34d722343d8985.tar.gz
Misc Fixes
========== -NOTIFICATION_WM_QUIT fixed on android (seems tha way this is reported changed in newer sdk) -WIP implementation of APK Expansion APIs for publishing games larger than 50mb in Play Store -Feaures in the new tutorials are all present in the sourcecode -This (hopefully) should get rid of the animation list order getting corrupted -Improved 3D Scene Importer (Skeletons, Animations and other stuff were not being merged). Anything missing? -In code editor, the automatic syntax checker will only use file_exists() to check preload() else it might freeze the editor too much while typing if the preload is a big resource -Fixed bugs in PolygonPathFinder, stil pending to do a node and a demo
Diffstat (limited to 'platform/android/java_glue.cpp')
-rw-r--r--platform/android/java_glue.cpp46
1 files changed, 33 insertions, 13 deletions
diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp
index b11994eef0..b9e13892d2 100644
--- a/platform/android/java_glue.cpp
+++ b/platform/android/java_glue.cpp
@@ -747,8 +747,34 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_initialize(JNIEnv * env,
}
+ const char ** cmdline=NULL;
+ int cmdlen=0;
+ bool use_apk_expansion=false;
+ if (p_cmdline) {
+ int cmdlen = env->GetArrayLength(p_cmdline);
+ if (cmdlen) {
+ cmdline = (const char**)malloc((env->GetArrayLength(p_cmdline)+1)*sizeof(const char*));
+ cmdline[cmdlen]=NULL;
+
+ for (int i=0; i<cmdlen; i++) {
+
+ jstring string = (jstring) env->GetObjectArrayElement(p_cmdline, i);
+ const char *rawString = env->GetStringUTFChars(string, 0);
+ if (!rawString) {
+ __android_log_print(ANDROID_LOG_INFO,"godot","cmdline arg %i is null\n",i);
+ } else {
+ // __android_log_print(ANDROID_LOG_INFO,"godot","cmdline arg %i is: %s\n",i,rawString);
+
+ if (strcmp(rawString,"-main_pack")==0)
+ use_apk_expansion=true;
+ }
+
+ cmdline[i]=rawString;
+ }
+ }
+ }
- os_android = new OS_Android(_gfx_init_func,env,_open_uri,_get_data_dir,_get_locale, _get_model,_show_vk, _hide_vk,_set_screen_orient,_get_unique_id, _play_video, _is_video_playing, _pause_video, _stop_video);
+ os_android = new OS_Android(_gfx_init_func,env,_open_uri,_get_data_dir,_get_locale, _get_model,_show_vk, _hide_vk,_set_screen_orient,_get_unique_id, _play_video, _is_video_playing, _pause_video, _stop_video,use_apk_expansion);
os_android->set_need_reload_hooks(p_need_reload_hook);
char wd[500];
@@ -759,16 +785,6 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_initialize(JNIEnv * env,
__android_log_print(ANDROID_LOG_INFO,"godot","**SETUP");
- const char ** cmdline=NULL;
- int cmdlen = env->GetArrayLength(p_cmdline);
- cmdline = (const char**)malloc((env->GetArrayLength(p_cmdline)+1)*sizeof(const char*));
- cmdline[cmdlen]=NULL;
- for (int i=0; i<cmdlen; i++) {
-
- jstring string = (jstring) env->GetObjectArrayElement(p_cmdline, i);
- const char *rawString = env->GetStringUTFChars(string, 0);
- cmdline[i]=rawString;
- }
#if 0
char *args[]={"-test","render",NULL};
@@ -833,6 +849,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_quit(JNIEnv * env, jobjec
input_mutex->lock();
quit_request=true;
+ print_line("BACK PRESSED");
input_mutex->unlock();
}
@@ -1289,7 +1306,10 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_key(JNIEnv * env, jobject
} else if (val == 61453) {
ievent.key.scancode = KEY_ENTER;
ievent.key.unicode = KEY_ENTER;
- }
+ } else if (p_scancode==4) {
+
+ quit_request=true;
+ }
input_mutex->lock();
key_events.push_back(ievent);
@@ -1390,7 +1410,7 @@ static Variant::Type get_jni_type(const String& p_type) {
static const char* get_jni_sig(const String& p_type) {
- print_line("getting sig for " + p_type);
+
static struct {
const char *name;
const char *sig;