summaryrefslogtreecommitdiffstats
path: root/platform/android/export/export.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-07-02 10:36:30 +0200
committerGitHub <noreply@github.com>2019-07-02 10:36:30 +0200
commitd2c416ec62e65fd42ff1bbf493cf06689e4d1b60 (patch)
tree99a7b15bf35ad43c33dc9fd583cde4fd8f6e9dff /platform/android/export/export.cpp
parente8b483ce21e1c8b1d79ca1693273d03b19b38388 (diff)
parent12e0dc1b65d3e69206ce64daa461b269c638b944 (diff)
downloadredot-engine-d2c416ec62e65fd42ff1bbf493cf06689e4d1b60.tar.gz
Merge pull request #29824 from m4gr3d/add_ovr_export
Add XR mode selection to the Android export process.
Diffstat (limited to 'platform/android/export/export.cpp')
-rw-r--r--platform/android/export/export.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index b37cf642db..08cbb176fe 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -665,6 +665,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;
@@ -822,6 +824,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;
}
@@ -1139,6 +1149,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"), ""));
@@ -2071,6 +2082,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");