You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +00:00
Add XR mode selection to the Android export process.
This commit is contained in:
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user