diff options
| author | Juan Linietsky | 2014-12-02 14:02:41 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2014-12-02 14:02:41 -0300 |
| commit | e361e8539c889d3ca66e77ebb5d0ceb61d17f49d (patch) | |
| tree | e34bb70d58e8d023df34c3e6744b5cdfa866ef7d /platform/android/java_glue.cpp | |
| parent | 9d5a2cb8470d538fa33f9f7b4d6cdd5390b3b70b (diff) | |
| download | godot-e361e8539c889d3ca66e77ebb5d0ceb61d17f49d.tar.gz godot-e361e8539c889d3ca66e77ebb5d0ceb61d17f49d.tar.zst godot-e361e8539c889d3ca66e77ebb5d0ceb61d17f49d.zip | |
Diffstat (limited to 'platform/android/java_glue.cpp')
| -rw-r--r-- | platform/android/java_glue.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp index fdc6f1207..3d3ba5d27 100644 --- a/platform/android/java_glue.cpp +++ b/platform/android/java_glue.cpp @@ -599,7 +599,7 @@ static jmethodID _showKeyboard=0; static jmethodID _hideKeyboard=0; static jmethodID _setScreenOrientation=0; static jmethodID _getUniqueID=0; - +static jmethodID _getSystemDir=0; static jmethodID _playVideo=0; static jmethodID _isVideoPlaying=0; static jmethodID _pauseVideo=0; @@ -659,6 +659,14 @@ static void _set_screen_orient(int p_orient) { env->CallVoidMethod(godot_io, _setScreenOrientation, p_orient ); }; +static String _get_system_dir(int p_dir) { + + JNIEnv *env = ThreadAndroid::get_env(); + jstring s =(jstring)env->CallObjectMethod(godot_io,_getSystemDir,p_dir); + return String(env->GetStringUTFChars( s, NULL )); +}; + + static void _hide_vk() { JNIEnv* env = ThreadAndroid::get_env(); @@ -738,7 +746,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_initialize(JNIEnv * env, _showKeyboard = env->GetMethodID(c,"showKeyboard","(Ljava/lang/String;)V"); _hideKeyboard = env->GetMethodID(c,"hideKeyboard","()V"); _setScreenOrientation = env->GetMethodID(c,"setScreenOrientation","(I)V"); - + _getSystemDir = env->GetMethodID(c,"getSystemDir","(I)Ljava/lang/String;"); _playVideo = env->GetMethodID(c,"playVideo","(Ljava/lang/String;)V"); _isVideoPlaying = env->GetMethodID(c,"isVideoPlaying","()Z"); _pauseVideo = env->GetMethodID(c,"pauseVideo","()V"); @@ -781,7 +789,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_initialize(JNIEnv * env, __android_log_print(ANDROID_LOG_INFO,"godot","CMDLINE LEN %i - APK EXPANSION %I\n",cmdlen,int(use_apk_expansion)); - 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 = 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, _get_system_dir, _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]; |
