This commit is contained in:
Spartan322
2025-05-14 14:16:55 -04:00
404 changed files with 6993 additions and 3243 deletions

View File

@@ -69,6 +69,7 @@ GodotIOJavaWrapper::GodotIOJavaWrapper(JNIEnv *p_env, jobject p_godot_io_instanc
_set_screen_orientation = p_env->GetMethodID(cls, "setScreenOrientation", "(I)V");
_get_screen_orientation = p_env->GetMethodID(cls, "getScreenOrientation", "()I");
_get_system_dir = p_env->GetMethodID(cls, "getSystemDir", "(IZ)Ljava/lang/String;");
_get_display_rotation = p_env->GetMethodID(cls, "getDisplayRotation", "()I");
}
}
@@ -291,6 +292,16 @@ String GodotIOJavaWrapper::get_system_dir(int p_dir, bool p_shared_storage) {
}
}
int GodotIOJavaWrapper::get_display_rotation() {
if (_get_display_rotation) {
JNIEnv *env = get_jni_env();
ERR_FAIL_NULL_V(env, 0);
return env->CallIntMethod(godot_io_instance, _get_display_rotation);
} else {
return 0;
}
}
// SafeNumeric because it can be changed from non-main thread and we need to
// ensure the change is immediately visible to other threads.
static SafeNumeric<int> virtual_keyboard_height;