diff options
author | fhuya <fhuyakou@gmail.com> | 2019-06-16 01:58:34 -0700 |
---|---|---|
committer | fhuya <fhuyakou@gmail.com> | 2019-07-02 00:12:38 -0700 |
commit | 12e0dc1b65d3e69206ce64daa461b269c638b944 (patch) | |
tree | 90b3e4815e72fae2dc9b66eaf2b65c61f6569af3 /platform/android/export | |
parent | 6ba1b4e371a875df527026725e3dc47d7cca8cf0 (diff) |
Add XR mode selection to the Android export process.
Diffstat (limited to 'platform/android/export')
-rw-r--r-- | platform/android/export/export.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 30267aa968..d0907bec74 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -668,6 +668,8 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { bool screen_support_large = p_preset->get("screen/support_large"); bool screen_support_xlarge = p_preset->get("screen/support_xlarge"); + int xr_mode_index = p_preset->get("graphics/xr_mode"); + Vector<String> perms; const char **aperms = android_perms; @@ -825,6 +827,14 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { encode_uint32(min_gles3 ? 0x00030000 : 0x00020000, &p_manifest.write[iofs + 16]); } + if (tname == "meta-data" && attrname == "value") { + if (xr_mode_index == 1 /* XRMode.OVR */) { + string_table.write[attr_value] = "vr_only"; + } else { + string_table.write[attr_value] = ""; + } + } + iofs += 20; } @@ -1142,6 +1152,7 @@ public: virtual void get_export_options(List<ExportOption> *r_options) { + r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "graphics/xr_mode", PROPERTY_HINT_ENUM, "Regular,Oculus Mobile VR"), 0)); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "graphics/32_bits_framebuffer"), true)); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "one_click_deploy/clear_previous_install"), true)); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_package/debug", PROPERTY_HINT_GLOBAL_FILE, "*.apk"), "")); @@ -2074,6 +2085,14 @@ public: } } + int xr_mode_index = p_preset->get("graphics/xr_mode"); + if (xr_mode_index == 1 /* XRMode.OVR */) { + cl.push_back("--xr_mode_ovr"); + } else { + // XRMode.REGULAR is the default. + cl.push_back("--xr_mode_regular"); + } + if (use_32_fb) cl.push_back("--use_depth_32"); |