From 84a517e670ec48d22d586d73f6577307c83cdb5c Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Fri, 9 Jun 2023 13:49:03 +1200 Subject: [PATCH 01/41] Rename Android project to Rebel --- platform/android/java/settings.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/android/java/settings.gradle b/platform/android/java/settings.gradle index 584b626900..f20a1cd3b3 100644 --- a/platform/android/java/settings.gradle +++ b/platform/android/java/settings.gradle @@ -1,5 +1,5 @@ // Configure the root project. -rootProject.name = "Godot" +rootProject.name = "Rebel" include ':app' include ':lib' From 52e866b9bede79205cffe581d86b7dc6b241265a Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Thu, 8 Jun 2023 12:02:06 +1200 Subject: [PATCH 02/41] Rename Android app package to com.rebeltoolbox.rebelapp --- platform/android/export/export_plugin.cpp | 2 +- platform/android/export/gradle_export_util.cpp | 2 +- platform/android/java/app/AndroidManifest.xml | 2 +- platform/android/java/app/config.gradle | 4 ++-- .../com/{godot/game => rebeltoolbox/rebelapp}/GodotApp.java | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) rename platform/android/java/app/src/com/{godot/game => rebeltoolbox/rebelapp}/GodotApp.java (98%) diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index 904e93ac3d..a37d3076db 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -1985,7 +1985,7 @@ Error EditorExportPlatformAndroid::run(const Ref &p_preset, args.push_back("-a"); args.push_back("android.intent.action.MAIN"); args.push_back("-n"); - args.push_back(get_package_name(package_name) + "/com.godot.game.GodotApp"); + args.push_back(get_package_name(package_name) + "/com.rebeltoolbox.rebelapp.GodotApp"); output.clear(); err = OS::get_singleton()->execute(adb, args, true, nullptr, &output, &rv, true); diff --git a/platform/android/export/gradle_export_util.cpp b/platform/android/export/gradle_export_util.cpp index ddd0dde40e..bc9bb4481d 100644 --- a/platform/android/export/gradle_export_util.cpp +++ b/platform/android/export/gradle_export_util.cpp @@ -252,7 +252,7 @@ String _get_activity_tag(const Ref &p_preset) { String orientation = _get_android_orientation_label( OS::get_singleton()->get_screen_orientation_from_string(GLOBAL_GET("display/window/handheld/orientation"))); String manifest_activity_text = vformat( - " \n", diff --git a/platform/android/java/app/AndroidManifest.xml b/platform/android/java/app/AndroidManifest.xml index d38c2d6ed8..2392db7256 100644 --- a/platform/android/java/app/AndroidManifest.xml +++ b/platform/android/java/app/AndroidManifest.xml @@ -1,7 +1,7 @@ diff --git a/platform/android/java/app/config.gradle b/platform/android/java/app/config.gradle index 193228a13c..6b2baeaa4d 100644 --- a/platform/android/java/app/config.gradle +++ b/platform/android/java/app/config.gradle @@ -19,11 +19,11 @@ ext.libraries = [ ] ext.getExportPackageName = { -> - // Retrieve the app id from the project property set by the Godot build command. + // Retrieve the app id from the project export package unique name property. String appId = project.hasProperty("export_package_name") ? project.property("export_package_name") : "" // Check if the app id is valid, otherwise use the default. if (appId == null || appId.isEmpty()) { - appId = "com.godot.game" + appId = "com.rebeltoolbox.rebelapp" } return appId } diff --git a/platform/android/java/app/src/com/godot/game/GodotApp.java b/platform/android/java/app/src/com/rebeltoolbox/rebelapp/GodotApp.java similarity index 98% rename from platform/android/java/app/src/com/godot/game/GodotApp.java rename to platform/android/java/app/src/com/rebeltoolbox/rebelapp/GodotApp.java index 46195c4952..1d4a67ec3e 100644 --- a/platform/android/java/app/src/com/godot/game/GodotApp.java +++ b/platform/android/java/app/src/com/rebeltoolbox/rebelapp/GodotApp.java @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package com.godot.game; +package com.rebeltoolbox.rebelapp; import org.godotengine.godot.FullScreenGodotApp; From ba38c0c3105b5d45001884c71a2a82a335175d3f Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Thu, 8 Jun 2023 11:54:39 +1200 Subject: [PATCH 03/41] Rename godot_project_name_string to project_name_string and godot-project-name to project-name --- platform/android/export/export_plugin.cpp | 4 ++-- platform/android/export/gradle_export_util.cpp | 12 ++++++------ platform/android/export/gradle_export_util.h | 4 ++-- platform/android/java/app/AndroidManifest.xml | 4 ++-- platform/android/java/app/build.gradle | 2 +- .../app/res/values-ar/godot_project_name_string.xml | 5 ----- .../project_name_string.xml} | 2 +- ...oject_name_string.xml => project_name_string.xml} | 2 +- ...oject_name_string.xml => project_name_string.xml} | 2 +- ...oject_name_string.xml => project_name_string.xml} | 2 +- .../app/res/values-da/godot_project_name_string.xml | 5 ----- .../java/app/res/values-da/project_name_string.xml | 5 +++++ .../app/res/values-de/godot_project_name_string.xml | 5 ----- .../java/app/res/values-de/project_name_string.xml | 5 +++++ .../app/res/values-el/godot_project_name_string.xml | 5 ----- .../java/app/res/values-el/project_name_string.xml | 5 +++++ .../app/res/values-en/godot_project_name_string.xml | 5 ----- .../java/app/res/values-en/project_name_string.xml | 5 +++++ .../res/values-es-rES/godot_project_name_string.xml | 5 ----- .../app/res/values-es-rES/project_name_string.xml | 5 +++++ .../app/res/values-es/godot_project_name_string.xml | 5 ----- .../java/app/res/values-es/project_name_string.xml | 5 +++++ .../app/res/values-fa/godot_project_name_string.xml | 5 ----- .../java/app/res/values-fa/project_name_string.xml | 5 +++++ .../app/res/values-fi/godot_project_name_string.xml | 5 ----- .../java/app/res/values-fi/project_name_string.xml | 5 +++++ .../app/res/values-fr/godot_project_name_string.xml | 5 ----- .../java/app/res/values-fr/project_name_string.xml | 5 +++++ .../app/res/values-hi/godot_project_name_string.xml | 5 ----- .../java/app/res/values-hi/project_name_string.xml | 5 +++++ .../app/res/values-hr/godot_project_name_string.xml | 5 ----- .../java/app/res/values-hr/project_name_string.xml | 5 +++++ .../app/res/values-hu/godot_project_name_string.xml | 5 ----- .../java/app/res/values-hu/project_name_string.xml | 5 +++++ .../app/res/values-in/godot_project_name_string.xml | 5 ----- .../java/app/res/values-in/project_name_string.xml | 5 +++++ .../app/res/values-it/godot_project_name_string.xml | 5 ----- .../java/app/res/values-it/project_name_string.xml | 5 +++++ .../app/res/values-iw/godot_project_name_string.xml | 5 ----- .../java/app/res/values-iw/project_name_string.xml | 5 +++++ .../app/res/values-ja/godot_project_name_string.xml | 5 ----- .../java/app/res/values-ja/project_name_string.xml | 5 +++++ .../app/res/values-ko/godot_project_name_string.xml | 5 ----- .../java/app/res/values-ko/project_name_string.xml | 5 +++++ .../app/res/values-lt/godot_project_name_string.xml | 5 ----- .../java/app/res/values-lt/project_name_string.xml | 5 +++++ .../app/res/values-lv/godot_project_name_string.xml | 5 ----- .../java/app/res/values-lv/project_name_string.xml | 5 +++++ .../app/res/values-nb/godot_project_name_string.xml | 5 ----- .../java/app/res/values-nb/project_name_string.xml | 5 +++++ .../app/res/values-nl/godot_project_name_string.xml | 5 ----- .../java/app/res/values-nl/project_name_string.xml | 5 +++++ .../app/res/values-pl/godot_project_name_string.xml | 5 ----- .../java/app/res/values-pl/project_name_string.xml | 5 +++++ .../app/res/values-pt/godot_project_name_string.xml | 5 ----- .../java/app/res/values-pt/project_name_string.xml | 5 +++++ .../app/res/values-ro/godot_project_name_string.xml | 5 ----- .../java/app/res/values-ro/project_name_string.xml | 5 +++++ .../app/res/values-ru/godot_project_name_string.xml | 5 ----- .../java/app/res/values-ru/project_name_string.xml | 5 +++++ .../app/res/values-sk/godot_project_name_string.xml | 5 ----- .../java/app/res/values-sk/project_name_string.xml | 5 +++++ .../app/res/values-sl/godot_project_name_string.xml | 5 ----- .../java/app/res/values-sl/project_name_string.xml | 5 +++++ .../app/res/values-sr/godot_project_name_string.xml | 5 ----- .../java/app/res/values-sr/project_name_string.xml | 5 +++++ .../app/res/values-sv/godot_project_name_string.xml | 5 ----- .../java/app/res/values-sv/project_name_string.xml | 5 +++++ .../app/res/values-th/godot_project_name_string.xml | 5 ----- .../java/app/res/values-th/project_name_string.xml | 5 +++++ .../app/res/values-tl/godot_project_name_string.xml | 5 ----- .../java/app/res/values-tl/project_name_string.xml | 5 +++++ .../app/res/values-tr/godot_project_name_string.xml | 5 ----- .../java/app/res/values-tr/project_name_string.xml | 5 +++++ .../app/res/values-uk/godot_project_name_string.xml | 5 ----- .../java/app/res/values-uk/project_name_string.xml | 5 +++++ .../app/res/values-vi/godot_project_name_string.xml | 5 ----- .../java/app/res/values-vi/project_name_string.xml | 5 +++++ .../res/values-zh-rHK/godot_project_name_string.xml | 5 ----- .../app/res/values-zh-rHK/project_name_string.xml | 5 +++++ .../res/values-zh-rTW/godot_project_name_string.xml | 5 ----- .../app/res/values-zh-rTW/project_name_string.xml | 5 +++++ .../app/res/values-zh/godot_project_name_string.xml | 5 ----- .../java/app/res/values-zh/project_name_string.xml | 5 +++++ .../java/app/res/values/project_name_string.xml | 5 +++++ platform/android/java/lib/AndroidManifest.xml | 2 +- .../layout/status_bar_ongoing_event_progress_bar.xml | 2 +- platform/android/java/lib/res/values/strings.xml | 2 +- 88 files changed, 210 insertions(+), 210 deletions(-) delete mode 100644 platform/android/java/app/res/values-ar/godot_project_name_string.xml rename platform/android/java/app/res/{values/godot_project_name_string.xml => values-ar/project_name_string.xml} (63%) rename platform/android/java/app/res/values-bg/{godot_project_name_string.xml => project_name_string.xml} (62%) rename platform/android/java/app/res/values-ca/{godot_project_name_string.xml => project_name_string.xml} (62%) rename platform/android/java/app/res/values-cs/{godot_project_name_string.xml => project_name_string.xml} (62%) delete mode 100644 platform/android/java/app/res/values-da/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-da/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-de/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-de/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-el/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-el/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-en/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-en/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-es-rES/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-es-rES/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-es/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-es/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-fa/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-fa/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-fi/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-fi/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-fr/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-fr/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-hi/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-hi/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-hr/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-hr/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-hu/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-hu/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-in/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-in/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-it/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-it/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-iw/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-iw/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-ja/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-ja/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-ko/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-ko/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-lt/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-lt/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-lv/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-lv/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-nb/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-nb/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-nl/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-nl/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-pl/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-pl/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-pt/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-pt/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-ro/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-ro/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-ru/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-ru/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-sk/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-sk/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-sl/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-sl/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-sr/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-sr/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-sv/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-sv/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-th/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-th/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-tl/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-tl/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-tr/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-tr/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-uk/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-uk/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-vi/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-vi/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-zh-rHK/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-zh-rHK/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-zh-rTW/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-zh-rTW/project_name_string.xml delete mode 100644 platform/android/java/app/res/values-zh/godot_project_name_string.xml create mode 100644 platform/android/java/app/res/values-zh/project_name_string.xml create mode 100644 platform/android/java/app/res/values/project_name_string.xml diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index a37d3076db..12ed05090f 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -1405,8 +1405,8 @@ void EditorExportPlatformAndroid::_fix_resources(const Ref & String str = _parse_string(&r_manifest[offset], string_flags & UTF8_FLAG); - if (str.begins_with("godot-project-name")) { - if (str == "godot-project-name") { + if (str.begins_with("project-name")) { + if (str == "project-name") { //project name str = get_project_name(package_name); diff --git a/platform/android/export/gradle_export_util.cpp b/platform/android/export/gradle_export_util.cpp index bc9bb4481d..c26758f379 100644 --- a/platform/android/export/gradle_export_util.cpp +++ b/platform/android/export/gradle_export_util.cpp @@ -147,8 +147,8 @@ String _android_xml_escape(const String &p_string) { Error _create_project_name_strings_files(const Ref &p_preset, const String &project_name) { print_verbose("Creating strings resources for supported locales for project " + project_name); // Stores the string into the default values directory. - String processed_default_xml_string = vformat(godot_project_name_xml_string, _android_xml_escape(project_name)); - store_string_at_path("res://android/build/res/values/godot_project_name_string.xml", processed_default_xml_string); + String processed_default_xml_string = vformat(project_name_xml_string, _android_xml_escape(project_name)); + store_string_at_path("res://android/build/res/values/project_name_string.xml", processed_default_xml_string); // Searches the Gradle project res/ directory to find all supported locales DirAccessRef da = DirAccess::open("res://android/build/res"); @@ -170,10 +170,10 @@ Error _create_project_name_strings_files(const Ref &p_preset } String locale = file.replace("values-", "").replace("-r", "_"); String property_name = "application/config/name_" + locale; - String locale_directory = "res://android/build/res/" + file + "/godot_project_name_string.xml"; + String locale_directory = "res://android/build/res/" + file + "/project_name_string.xml"; if (ProjectSettings::get_singleton()->has_setting(property_name)) { String locale_project_name = ProjectSettings::get_singleton()->get(property_name); - String processed_xml_string = vformat(godot_project_name_xml_string, _android_xml_escape(locale_project_name)); + String processed_xml_string = vformat(project_name_xml_string, _android_xml_escape(locale_project_name)); print_verbose("Storing project name for locale " + locale + " under " + locale_directory); store_string_at_path(locale_directory, processed_xml_string); } else { @@ -240,7 +240,7 @@ String _get_instrumentation_tag(const Ref &p_preset) { " tools:node=\"replace\"\n" " android:name=\".GodotInstrumentation\"\n" " android:icon=\"@mipmap/icon\"\n" - " android:label=\"@string/godot_project_name_string\"\n" + " android:label=\"@string/project_name_string\"\n" " android:targetPackage=\"%s\" />\n", package_name); return manifest_instrumentation_text; @@ -271,7 +271,7 @@ String _get_application_tag(const Ref &p_preset, bool p_has_ int xr_mode_index = (int)(p_preset->get("xr_features/xr_mode")); bool uses_xr = xr_mode_index == XR_MODE_OVR || xr_mode_index == XR_MODE_OPENXR; String manifest_application_text = vformat( - " +const String project_name_xml_string = R"( - %s + %s )"; diff --git a/platform/android/java/app/AndroidManifest.xml b/platform/android/java/app/AndroidManifest.xml index 2392db7256..dbe8215af0 100644 --- a/platform/android/java/app/AndroidManifest.xml +++ b/platform/android/java/app/AndroidManifest.xml @@ -28,7 +28,7 @@ - + - - - godot-project-name-ar - diff --git a/platform/android/java/app/res/values/godot_project_name_string.xml b/platform/android/java/app/res/values-ar/project_name_string.xml similarity index 63% rename from platform/android/java/app/res/values/godot_project_name_string.xml rename to platform/android/java/app/res/values-ar/project_name_string.xml index 7ec2738896..328ec12961 100644 --- a/platform/android/java/app/res/values/godot_project_name_string.xml +++ b/platform/android/java/app/res/values-ar/project_name_string.xml @@ -1,5 +1,5 @@ - godot-project-name + project-name-ar diff --git a/platform/android/java/app/res/values-bg/godot_project_name_string.xml b/platform/android/java/app/res/values-bg/project_name_string.xml similarity index 62% rename from platform/android/java/app/res/values-bg/godot_project_name_string.xml rename to platform/android/java/app/res/values-bg/project_name_string.xml index dbb7e04ae5..b5a685e570 100644 --- a/platform/android/java/app/res/values-bg/godot_project_name_string.xml +++ b/platform/android/java/app/res/values-bg/project_name_string.xml @@ -1,5 +1,5 @@ - godot-project-name-bg + project-name-bg diff --git a/platform/android/java/app/res/values-ca/godot_project_name_string.xml b/platform/android/java/app/res/values-ca/project_name_string.xml similarity index 62% rename from platform/android/java/app/res/values-ca/godot_project_name_string.xml rename to platform/android/java/app/res/values-ca/project_name_string.xml index 709d0961e6..e7c7af6a45 100644 --- a/platform/android/java/app/res/values-ca/godot_project_name_string.xml +++ b/platform/android/java/app/res/values-ca/project_name_string.xml @@ -1,5 +1,5 @@ - godot-project-name-ca + project-name-ca diff --git a/platform/android/java/app/res/values-cs/godot_project_name_string.xml b/platform/android/java/app/res/values-cs/project_name_string.xml similarity index 62% rename from platform/android/java/app/res/values-cs/godot_project_name_string.xml rename to platform/android/java/app/res/values-cs/project_name_string.xml index ab248a8032..3fa9b5a208 100644 --- a/platform/android/java/app/res/values-cs/godot_project_name_string.xml +++ b/platform/android/java/app/res/values-cs/project_name_string.xml @@ -1,5 +1,5 @@ - godot-project-name-cs + project-name-cs diff --git a/platform/android/java/app/res/values-da/godot_project_name_string.xml b/platform/android/java/app/res/values-da/godot_project_name_string.xml deleted file mode 100644 index 906bf44f57..0000000000 --- a/platform/android/java/app/res/values-da/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-da - diff --git a/platform/android/java/app/res/values-da/project_name_string.xml b/platform/android/java/app/res/values-da/project_name_string.xml new file mode 100644 index 0000000000..547788edd9 --- /dev/null +++ b/platform/android/java/app/res/values-da/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-da + diff --git a/platform/android/java/app/res/values-de/godot_project_name_string.xml b/platform/android/java/app/res/values-de/godot_project_name_string.xml deleted file mode 100644 index 0cacb0175f..0000000000 --- a/platform/android/java/app/res/values-de/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-de - diff --git a/platform/android/java/app/res/values-de/project_name_string.xml b/platform/android/java/app/res/values-de/project_name_string.xml new file mode 100644 index 0000000000..f6363471e6 --- /dev/null +++ b/platform/android/java/app/res/values-de/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-de + diff --git a/platform/android/java/app/res/values-el/godot_project_name_string.xml b/platform/android/java/app/res/values-el/godot_project_name_string.xml deleted file mode 100644 index 047de616a5..0000000000 --- a/platform/android/java/app/res/values-el/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-el - diff --git a/platform/android/java/app/res/values-el/project_name_string.xml b/platform/android/java/app/res/values-el/project_name_string.xml new file mode 100644 index 0000000000..3a404c079f --- /dev/null +++ b/platform/android/java/app/res/values-el/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-el + diff --git a/platform/android/java/app/res/values-en/godot_project_name_string.xml b/platform/android/java/app/res/values-en/godot_project_name_string.xml deleted file mode 100644 index bb3a5dbef3..0000000000 --- a/platform/android/java/app/res/values-en/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-en - diff --git a/platform/android/java/app/res/values-en/project_name_string.xml b/platform/android/java/app/res/values-en/project_name_string.xml new file mode 100644 index 0000000000..20ab18338f --- /dev/null +++ b/platform/android/java/app/res/values-en/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-en + diff --git a/platform/android/java/app/res/values-es-rES/godot_project_name_string.xml b/platform/android/java/app/res/values-es-rES/godot_project_name_string.xml deleted file mode 100644 index d4537f3496..0000000000 --- a/platform/android/java/app/res/values-es-rES/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-es_ES - diff --git a/platform/android/java/app/res/values-es-rES/project_name_string.xml b/platform/android/java/app/res/values-es-rES/project_name_string.xml new file mode 100644 index 0000000000..dde5160130 --- /dev/null +++ b/platform/android/java/app/res/values-es-rES/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-es_ES + diff --git a/platform/android/java/app/res/values-es/godot_project_name_string.xml b/platform/android/java/app/res/values-es/godot_project_name_string.xml deleted file mode 100644 index d63a16022e..0000000000 --- a/platform/android/java/app/res/values-es/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-es - diff --git a/platform/android/java/app/res/values-es/project_name_string.xml b/platform/android/java/app/res/values-es/project_name_string.xml new file mode 100644 index 0000000000..71101dbe34 --- /dev/null +++ b/platform/android/java/app/res/values-es/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-es + diff --git a/platform/android/java/app/res/values-fa/godot_project_name_string.xml b/platform/android/java/app/res/values-fa/godot_project_name_string.xml deleted file mode 100644 index c303f13d5f..0000000000 --- a/platform/android/java/app/res/values-fa/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-fa - diff --git a/platform/android/java/app/res/values-fa/project_name_string.xml b/platform/android/java/app/res/values-fa/project_name_string.xml new file mode 100644 index 0000000000..7ec5e582ee --- /dev/null +++ b/platform/android/java/app/res/values-fa/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-fa + diff --git a/platform/android/java/app/res/values-fi/godot_project_name_string.xml b/platform/android/java/app/res/values-fi/godot_project_name_string.xml deleted file mode 100644 index bd6005574a..0000000000 --- a/platform/android/java/app/res/values-fi/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-fi - diff --git a/platform/android/java/app/res/values-fi/project_name_string.xml b/platform/android/java/app/res/values-fi/project_name_string.xml new file mode 100644 index 0000000000..eee951563b --- /dev/null +++ b/platform/android/java/app/res/values-fi/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-fi + diff --git a/platform/android/java/app/res/values-fr/godot_project_name_string.xml b/platform/android/java/app/res/values-fr/godot_project_name_string.xml deleted file mode 100644 index 2e94b65a20..0000000000 --- a/platform/android/java/app/res/values-fr/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-fr - diff --git a/platform/android/java/app/res/values-fr/project_name_string.xml b/platform/android/java/app/res/values-fr/project_name_string.xml new file mode 100644 index 0000000000..d32162dd6c --- /dev/null +++ b/platform/android/java/app/res/values-fr/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-fr + diff --git a/platform/android/java/app/res/values-hi/godot_project_name_string.xml b/platform/android/java/app/res/values-hi/godot_project_name_string.xml deleted file mode 100644 index 0bf75dcd56..0000000000 --- a/platform/android/java/app/res/values-hi/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-hi - diff --git a/platform/android/java/app/res/values-hi/project_name_string.xml b/platform/android/java/app/res/values-hi/project_name_string.xml new file mode 100644 index 0000000000..bc5eaad9c8 --- /dev/null +++ b/platform/android/java/app/res/values-hi/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-hi + diff --git a/platform/android/java/app/res/values-hr/godot_project_name_string.xml b/platform/android/java/app/res/values-hr/godot_project_name_string.xml deleted file mode 100644 index d3f75910f9..0000000000 --- a/platform/android/java/app/res/values-hr/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-hr - diff --git a/platform/android/java/app/res/values-hr/project_name_string.xml b/platform/android/java/app/res/values-hr/project_name_string.xml new file mode 100644 index 0000000000..3f97a30c4b --- /dev/null +++ b/platform/android/java/app/res/values-hr/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-hr + diff --git a/platform/android/java/app/res/values-hu/godot_project_name_string.xml b/platform/android/java/app/res/values-hu/godot_project_name_string.xml deleted file mode 100644 index 012b613af3..0000000000 --- a/platform/android/java/app/res/values-hu/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-hu - diff --git a/platform/android/java/app/res/values-hu/project_name_string.xml b/platform/android/java/app/res/values-hu/project_name_string.xml new file mode 100644 index 0000000000..94a0a7e92c --- /dev/null +++ b/platform/android/java/app/res/values-hu/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-hu + diff --git a/platform/android/java/app/res/values-in/godot_project_name_string.xml b/platform/android/java/app/res/values-in/godot_project_name_string.xml deleted file mode 100644 index eedecff7a1..0000000000 --- a/platform/android/java/app/res/values-in/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-in - diff --git a/platform/android/java/app/res/values-in/project_name_string.xml b/platform/android/java/app/res/values-in/project_name_string.xml new file mode 100644 index 0000000000..d48f1a9d42 --- /dev/null +++ b/platform/android/java/app/res/values-in/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-in + diff --git a/platform/android/java/app/res/values-it/godot_project_name_string.xml b/platform/android/java/app/res/values-it/godot_project_name_string.xml deleted file mode 100644 index 7e734047c4..0000000000 --- a/platform/android/java/app/res/values-it/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-it - diff --git a/platform/android/java/app/res/values-it/project_name_string.xml b/platform/android/java/app/res/values-it/project_name_string.xml new file mode 100644 index 0000000000..1dbb49d86c --- /dev/null +++ b/platform/android/java/app/res/values-it/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-it + diff --git a/platform/android/java/app/res/values-iw/godot_project_name_string.xml b/platform/android/java/app/res/values-iw/godot_project_name_string.xml deleted file mode 100644 index 03893f0cbb..0000000000 --- a/platform/android/java/app/res/values-iw/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-iw - diff --git a/platform/android/java/app/res/values-iw/project_name_string.xml b/platform/android/java/app/res/values-iw/project_name_string.xml new file mode 100644 index 0000000000..bf7a501c86 --- /dev/null +++ b/platform/android/java/app/res/values-iw/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-iw + diff --git a/platform/android/java/app/res/values-ja/godot_project_name_string.xml b/platform/android/java/app/res/values-ja/godot_project_name_string.xml deleted file mode 100644 index f9dd4fab0d..0000000000 --- a/platform/android/java/app/res/values-ja/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-ja - diff --git a/platform/android/java/app/res/values-ja/project_name_string.xml b/platform/android/java/app/res/values-ja/project_name_string.xml new file mode 100644 index 0000000000..a52406dad4 --- /dev/null +++ b/platform/android/java/app/res/values-ja/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-ja + diff --git a/platform/android/java/app/res/values-ko/godot_project_name_string.xml b/platform/android/java/app/res/values-ko/godot_project_name_string.xml deleted file mode 100644 index 26f5dac176..0000000000 --- a/platform/android/java/app/res/values-ko/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-ko - diff --git a/platform/android/java/app/res/values-ko/project_name_string.xml b/platform/android/java/app/res/values-ko/project_name_string.xml new file mode 100644 index 0000000000..34a9f06733 --- /dev/null +++ b/platform/android/java/app/res/values-ko/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-ko + diff --git a/platform/android/java/app/res/values-lt/godot_project_name_string.xml b/platform/android/java/app/res/values-lt/godot_project_name_string.xml deleted file mode 100644 index 1c2e976cc5..0000000000 --- a/platform/android/java/app/res/values-lt/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-lt - diff --git a/platform/android/java/app/res/values-lt/project_name_string.xml b/platform/android/java/app/res/values-lt/project_name_string.xml new file mode 100644 index 0000000000..9b866ececf --- /dev/null +++ b/platform/android/java/app/res/values-lt/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-lt + diff --git a/platform/android/java/app/res/values-lv/godot_project_name_string.xml b/platform/android/java/app/res/values-lv/godot_project_name_string.xml deleted file mode 100644 index b5e638ed73..0000000000 --- a/platform/android/java/app/res/values-lv/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-lv - diff --git a/platform/android/java/app/res/values-lv/project_name_string.xml b/platform/android/java/app/res/values-lv/project_name_string.xml new file mode 100644 index 0000000000..c67a265582 --- /dev/null +++ b/platform/android/java/app/res/values-lv/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-lv + diff --git a/platform/android/java/app/res/values-nb/godot_project_name_string.xml b/platform/android/java/app/res/values-nb/godot_project_name_string.xml deleted file mode 100644 index e6d89d6a3f..0000000000 --- a/platform/android/java/app/res/values-nb/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-nb - diff --git a/platform/android/java/app/res/values-nb/project_name_string.xml b/platform/android/java/app/res/values-nb/project_name_string.xml new file mode 100644 index 0000000000..ab908801ab --- /dev/null +++ b/platform/android/java/app/res/values-nb/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-nb + diff --git a/platform/android/java/app/res/values-nl/godot_project_name_string.xml b/platform/android/java/app/res/values-nl/godot_project_name_string.xml deleted file mode 100644 index 93cb3a3878..0000000000 --- a/platform/android/java/app/res/values-nl/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-nl - diff --git a/platform/android/java/app/res/values-nl/project_name_string.xml b/platform/android/java/app/res/values-nl/project_name_string.xml new file mode 100644 index 0000000000..7ae334d158 --- /dev/null +++ b/platform/android/java/app/res/values-nl/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-nl + diff --git a/platform/android/java/app/res/values-pl/godot_project_name_string.xml b/platform/android/java/app/res/values-pl/godot_project_name_string.xml deleted file mode 100644 index e5d6ac74fb..0000000000 --- a/platform/android/java/app/res/values-pl/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-pl - diff --git a/platform/android/java/app/res/values-pl/project_name_string.xml b/platform/android/java/app/res/values-pl/project_name_string.xml new file mode 100644 index 0000000000..18cc661fdb --- /dev/null +++ b/platform/android/java/app/res/values-pl/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-pl + diff --git a/platform/android/java/app/res/values-pt/godot_project_name_string.xml b/platform/android/java/app/res/values-pt/godot_project_name_string.xml deleted file mode 100644 index a4624655c5..0000000000 --- a/platform/android/java/app/res/values-pt/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-pt - diff --git a/platform/android/java/app/res/values-pt/project_name_string.xml b/platform/android/java/app/res/values-pt/project_name_string.xml new file mode 100644 index 0000000000..26eab6eea8 --- /dev/null +++ b/platform/android/java/app/res/values-pt/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-pt + diff --git a/platform/android/java/app/res/values-ro/godot_project_name_string.xml b/platform/android/java/app/res/values-ro/godot_project_name_string.xml deleted file mode 100644 index 19e026637e..0000000000 --- a/platform/android/java/app/res/values-ro/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-ro - diff --git a/platform/android/java/app/res/values-ro/project_name_string.xml b/platform/android/java/app/res/values-ro/project_name_string.xml new file mode 100644 index 0000000000..ead014a696 --- /dev/null +++ b/platform/android/java/app/res/values-ro/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-ro + diff --git a/platform/android/java/app/res/values-ru/godot_project_name_string.xml b/platform/android/java/app/res/values-ru/godot_project_name_string.xml deleted file mode 100644 index 284845241f..0000000000 --- a/platform/android/java/app/res/values-ru/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-ru - diff --git a/platform/android/java/app/res/values-ru/project_name_string.xml b/platform/android/java/app/res/values-ru/project_name_string.xml new file mode 100644 index 0000000000..75cd205cba --- /dev/null +++ b/platform/android/java/app/res/values-ru/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-ru + diff --git a/platform/android/java/app/res/values-sk/godot_project_name_string.xml b/platform/android/java/app/res/values-sk/godot_project_name_string.xml deleted file mode 100644 index f8ab4a5b59..0000000000 --- a/platform/android/java/app/res/values-sk/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-sk - diff --git a/platform/android/java/app/res/values-sk/project_name_string.xml b/platform/android/java/app/res/values-sk/project_name_string.xml new file mode 100644 index 0000000000..73e99548b6 --- /dev/null +++ b/platform/android/java/app/res/values-sk/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-sk + diff --git a/platform/android/java/app/res/values-sl/godot_project_name_string.xml b/platform/android/java/app/res/values-sl/godot_project_name_string.xml deleted file mode 100644 index 98bd53e8d2..0000000000 --- a/platform/android/java/app/res/values-sl/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-sl - diff --git a/platform/android/java/app/res/values-sl/project_name_string.xml b/platform/android/java/app/res/values-sl/project_name_string.xml new file mode 100644 index 0000000000..a0212340f7 --- /dev/null +++ b/platform/android/java/app/res/values-sl/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-sl + diff --git a/platform/android/java/app/res/values-sr/godot_project_name_string.xml b/platform/android/java/app/res/values-sr/godot_project_name_string.xml deleted file mode 100644 index 3f400f2a4d..0000000000 --- a/platform/android/java/app/res/values-sr/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-sr - diff --git a/platform/android/java/app/res/values-sr/project_name_string.xml b/platform/android/java/app/res/values-sr/project_name_string.xml new file mode 100644 index 0000000000..4e4b7a755f --- /dev/null +++ b/platform/android/java/app/res/values-sr/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-sr + diff --git a/platform/android/java/app/res/values-sv/godot_project_name_string.xml b/platform/android/java/app/res/values-sv/godot_project_name_string.xml deleted file mode 100644 index 8670b7c9aa..0000000000 --- a/platform/android/java/app/res/values-sv/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-sv - diff --git a/platform/android/java/app/res/values-sv/project_name_string.xml b/platform/android/java/app/res/values-sv/project_name_string.xml new file mode 100644 index 0000000000..a37f57206c --- /dev/null +++ b/platform/android/java/app/res/values-sv/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-sv + diff --git a/platform/android/java/app/res/values-th/godot_project_name_string.xml b/platform/android/java/app/res/values-th/godot_project_name_string.xml deleted file mode 100644 index a1cc1bcd49..0000000000 --- a/platform/android/java/app/res/values-th/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-th - diff --git a/platform/android/java/app/res/values-th/project_name_string.xml b/platform/android/java/app/res/values-th/project_name_string.xml new file mode 100644 index 0000000000..23f2264f47 --- /dev/null +++ b/platform/android/java/app/res/values-th/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-th + diff --git a/platform/android/java/app/res/values-tl/godot_project_name_string.xml b/platform/android/java/app/res/values-tl/godot_project_name_string.xml deleted file mode 100644 index 6d66d114cf..0000000000 --- a/platform/android/java/app/res/values-tl/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-tl - diff --git a/platform/android/java/app/res/values-tl/project_name_string.xml b/platform/android/java/app/res/values-tl/project_name_string.xml new file mode 100644 index 0000000000..7435bbbc66 --- /dev/null +++ b/platform/android/java/app/res/values-tl/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-tl + diff --git a/platform/android/java/app/res/values-tr/godot_project_name_string.xml b/platform/android/java/app/res/values-tr/godot_project_name_string.xml deleted file mode 100644 index ba3bd7de36..0000000000 --- a/platform/android/java/app/res/values-tr/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-tr - diff --git a/platform/android/java/app/res/values-tr/project_name_string.xml b/platform/android/java/app/res/values-tr/project_name_string.xml new file mode 100644 index 0000000000..a2d6297f67 --- /dev/null +++ b/platform/android/java/app/res/values-tr/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-tr + diff --git a/platform/android/java/app/res/values-uk/godot_project_name_string.xml b/platform/android/java/app/res/values-uk/godot_project_name_string.xml deleted file mode 100644 index 5f14ab25a0..0000000000 --- a/platform/android/java/app/res/values-uk/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-uk - diff --git a/platform/android/java/app/res/values-uk/project_name_string.xml b/platform/android/java/app/res/values-uk/project_name_string.xml new file mode 100644 index 0000000000..453aeef420 --- /dev/null +++ b/platform/android/java/app/res/values-uk/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-uk + diff --git a/platform/android/java/app/res/values-vi/godot_project_name_string.xml b/platform/android/java/app/res/values-vi/godot_project_name_string.xml deleted file mode 100644 index 295378e111..0000000000 --- a/platform/android/java/app/res/values-vi/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-vi - diff --git a/platform/android/java/app/res/values-vi/project_name_string.xml b/platform/android/java/app/res/values-vi/project_name_string.xml new file mode 100644 index 0000000000..09e1a0a23d --- /dev/null +++ b/platform/android/java/app/res/values-vi/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-vi + diff --git a/platform/android/java/app/res/values-zh-rHK/godot_project_name_string.xml b/platform/android/java/app/res/values-zh-rHK/godot_project_name_string.xml deleted file mode 100644 index 40ab0f285a..0000000000 --- a/platform/android/java/app/res/values-zh-rHK/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-zh_HK - diff --git a/platform/android/java/app/res/values-zh-rHK/project_name_string.xml b/platform/android/java/app/res/values-zh-rHK/project_name_string.xml new file mode 100644 index 0000000000..51f0a7277a --- /dev/null +++ b/platform/android/java/app/res/values-zh-rHK/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-zh_HK + diff --git a/platform/android/java/app/res/values-zh-rTW/godot_project_name_string.xml b/platform/android/java/app/res/values-zh-rTW/godot_project_name_string.xml deleted file mode 100644 index 095bd564e2..0000000000 --- a/platform/android/java/app/res/values-zh-rTW/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-zh_TW - diff --git a/platform/android/java/app/res/values-zh-rTW/project_name_string.xml b/platform/android/java/app/res/values-zh-rTW/project_name_string.xml new file mode 100644 index 0000000000..dfcd927df8 --- /dev/null +++ b/platform/android/java/app/res/values-zh-rTW/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-zh_TW + diff --git a/platform/android/java/app/res/values-zh/godot_project_name_string.xml b/platform/android/java/app/res/values-zh/godot_project_name_string.xml deleted file mode 100644 index 31aa8c273a..0000000000 --- a/platform/android/java/app/res/values-zh/godot_project_name_string.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - godot-project-name-zh - diff --git a/platform/android/java/app/res/values-zh/project_name_string.xml b/platform/android/java/app/res/values-zh/project_name_string.xml new file mode 100644 index 0000000000..3405b53b28 --- /dev/null +++ b/platform/android/java/app/res/values-zh/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name-zh + diff --git a/platform/android/java/app/res/values/project_name_string.xml b/platform/android/java/app/res/values/project_name_string.xml new file mode 100644 index 0000000000..489637cfb6 --- /dev/null +++ b/platform/android/java/app/res/values/project_name_string.xml @@ -0,0 +1,5 @@ + + + + project-name + diff --git a/platform/android/java/lib/AndroidManifest.xml b/platform/android/java/lib/AndroidManifest.xml index 0a717c7cfa..e45054cae4 100644 --- a/platform/android/java/lib/AndroidManifest.xml +++ b/platform/android/java/lib/AndroidManifest.xml @@ -21,7 +21,7 @@ diff --git a/platform/android/java/lib/res/layout/status_bar_ongoing_event_progress_bar.xml b/platform/android/java/lib/res/layout/status_bar_ongoing_event_progress_bar.xml index 426e1bd841..48bc62e0c5 100644 --- a/platform/android/java/lib/res/layout/status_bar_ongoing_event_progress_bar.xml +++ b/platform/android/java/lib/res/layout/status_bar_ongoing_event_progress_bar.xml @@ -37,7 +37,7 @@ android:layout_alignParentStart="true" android:layout_alignParentTop="true" android:src="@android:drawable/stat_sys_download" - android:contentDescription="@string/godot_project_name_string" /> + android:contentDescription="@string/project_name_string" /> - godot-project-name + project-name Would you like to enable downloading over cellular connections? Depending on your data plan, this may cost you money. If you choose not to enable downloading over cellular connections, the download will automatically resume when wi-fi is available. Resume download From 4a46268f378a4e40fb0110e4133f8a8a264e45ec Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sat, 10 Jun 2023 10:25:47 +1200 Subject: [PATCH 04/41] Fix Android lib patch files --- ...android.vending.expansion.downloader.patch | 42 +++++++++---------- ...com.google.android.vending.licensing.patch | 14 +++---- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/platform/android/java/lib/patches/com.google.android.vending.expansion.downloader.patch b/platform/android/java/lib/patches/com.google.android.vending.expansion.downloader.patch index 49cc41e817..07717f0c71 100644 --- a/platform/android/java/lib/patches/com.google.android.vending.expansion.downloader.patch +++ b/platform/android/java/lib/patches/com.google.android.vending.expansion.downloader.patch @@ -1,7 +1,7 @@ -diff --git a/platform/android/java/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java +diff --git a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java index ad6ea0de6..452c7d148 100644 ---- a/platform/android/java/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java -+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java +--- a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java ++++ b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java @@ -32,6 +32,9 @@ import android.os.Messenger; import android.os.RemoteException; import android.util.Log; @@ -78,10 +78,10 @@ index ad6ea0de6..452c7d148 100644 public Stub(IDownloaderClient itf, Class downloaderService) { mItf = itf; -diff --git a/platform/android/java/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java +diff --git a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java index 979352299..3771d19c9 100644 ---- a/platform/android/java/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java -+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java +--- a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java ++++ b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java @@ -25,6 +25,9 @@ import android.os.Message; import android.os.Messenger; import android.os.RemoteException; @@ -164,10 +164,10 @@ index 979352299..3771d19c9 100644 public Stub(IDownloaderService itf) { mItf = itf; -diff --git a/platform/android/java/src/com/google/android/vending/expansion/downloader/Helpers.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/Helpers.java +diff --git a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/Helpers.java b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/Helpers.java index e4b1b0f1c..36cd6aacf 100644 ---- a/platform/android/java/src/com/google/android/vending/expansion/downloader/Helpers.java -+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/Helpers.java +--- a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/Helpers.java ++++ b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/Helpers.java @@ -24,7 +24,10 @@ import android.os.StatFs; import android.os.SystemClock; import android.util.Log; @@ -208,10 +208,10 @@ index e4b1b0f1c..36cd6aacf 100644 } public static String getTimeRemaining(long durationInMilliseconds) { -diff --git a/platform/android/java/src/com/google/android/vending/expansion/downloader/SystemFacade.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/SystemFacade.java +diff --git a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/SystemFacade.java b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/SystemFacade.java index 12edd97ab..a0e1165cc 100644 ---- a/platform/android/java/src/com/google/android/vending/expansion/downloader/SystemFacade.java -+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/SystemFacade.java +--- a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/SystemFacade.java ++++ b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/SystemFacade.java @@ -26,6 +26,10 @@ import android.net.NetworkInfo; import android.telephony.TelephonyManager; import android.util.Log; @@ -239,10 +239,10 @@ index 12edd97ab..a0e1165cc 100644 NetworkInfo info = connectivity.getActiveNetworkInfo(); boolean isMobile = (info != null && info.getType() == ConnectivityManager.TYPE_MOBILE); TelephonyManager tm = (TelephonyManager) mContext -diff --git a/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java +diff --git a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java index f1536e80e..4b214b22d 100644 ---- a/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java -+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java +--- a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java ++++ b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java @@ -16,7 +16,11 @@ package com.google.android.vending.expansion.downloader.impl; @@ -256,10 +256,10 @@ index f1536e80e..4b214b22d 100644 import com.google.android.vending.expansion.downloader.DownloadProgressInfo; import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; import com.google.android.vending.expansion.downloader.Helpers; -diff --git a/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java +diff --git a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java index b2e0e7af0..c114b8a64 100644 ---- a/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java -+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java +--- a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java ++++ b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java @@ -146,8 +146,12 @@ public class DownloadThread { try { @@ -275,10 +275,10 @@ index b2e0e7af0..c114b8a64 100644 if (Constants.LOGV) { Log.v(Constants.TAG, "initiating download for " + mInfo.mFileName); -diff --git a/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java +diff --git a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java index 4babe476f..8d41a7690 100644 ---- a/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java -+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java +--- a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java ++++ b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java @@ -50,6 +50,10 @@ import android.provider.Settings.Secure; import android.telephony.TelephonyManager; import android.util.Log; diff --git a/platform/android/java/lib/patches/com.google.android.vending.licensing.patch b/platform/android/java/lib/patches/com.google.android.vending.licensing.patch index 4adb81d951..993c4806c2 100644 --- a/platform/android/java/lib/patches/com.google.android.vending.licensing.patch +++ b/platform/android/java/lib/patches/com.google.android.vending.licensing.patch @@ -1,7 +1,7 @@ -diff --git a/platform/android/java/src/com/google/android/vending/licensing/PreferenceObfuscator.java b/platform/android/java/src/com/google/android/vending/licensing/PreferenceObfuscator.java +diff --git a/platform/android/java/lib/src/com/google/android/vending/licensing/PreferenceObfuscator.java b/platform/android/java/lib/src/com/google/android/vending/licensing/PreferenceObfuscator.java index 7c42bfc28..feb579af0 100644 ---- a/platform/android/java/src/com/google/android/vending/licensing/PreferenceObfuscator.java -+++ b/platform/android/java/src/com/google/android/vending/licensing/PreferenceObfuscator.java +--- a/platform/android/java/lib/src/com/google/android/vending/licensing/PreferenceObfuscator.java ++++ b/platform/android/java/lib/src/com/google/android/vending/licensing/PreferenceObfuscator.java @@ -45,6 +45,9 @@ public class PreferenceObfuscator { public void putString(String key, String value) { if (mEditor == null) { @@ -12,16 +12,16 @@ index 7c42bfc28..feb579af0 100644 } String obfuscatedValue = mObfuscator.obfuscate(value, key); mEditor.putString(key, obfuscatedValue); -diff --git a/platform/android/java/src/com/google/android/vending/licensing/util/Base64.java b/platform/android/java/src/com/google/android/vending/licensing/util/Base64.java +diff --git a/platform/android/java/lib/src/com/google/android/vending/licensing/util/Base64.java b/platform/android/java/lib/src/com/google/android/vending/licensing/util/Base64.java index a0d2779af..a8bf65f9c 100644 ---- a/platform/android/java/src/com/google/android/vending/licensing/util/Base64.java -+++ b/platform/android/java/src/com/google/android/vending/licensing/util/Base64.java +--- a/platform/android/java/lib/src/com/google/android/vending/licensing/util/Base64.java ++++ b/platform/android/java/lib/src/com/google/android/vending/licensing/util/Base64.java @@ -31,6 +31,10 @@ package com.google.android.vending.licensing.util; * @version 1.3 */ +// -- GODOT start -- -import org.godotengine.godot.BuildConfig; ++import org.godotengine.godot.BuildConfig; +// -- GODOT end -- + /** From e8c89406895a45ba0a2d9eaf803e8127287039f8 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Fri, 9 Jun 2023 16:53:52 +1200 Subject: [PATCH 05/41] Rename Android lib package to com.rebeltoolbox.rebelengine --- .clang-format | 2 +- copyright | 4 ++-- misc/scripts/clang_format.sh | 2 +- platform/android/export/gradle_export_util.h | 2 +- .../com/rebeltoolbox/rebelapp/GodotApp.java | 2 +- platform/android/java/lib/AndroidManifest.xml | 4 ++-- platform/android/java/lib/build.gradle | 2 +- .../rebeltoolbox/rebelengine}/Dictionary.java | 2 +- .../rebelengine}/FullScreenGodotApp.java | 2 +- .../rebeltoolbox/rebelengine}/Godot.java | 14 +++++------ .../GodotDownloaderAlarmReceiver.java | 2 +- .../rebelengine}/GodotDownloaderService.java | 2 +- .../rebeltoolbox/rebelengine}/GodotHost.java | 2 +- .../rebeltoolbox/rebelengine}/GodotIO.java | 4 ++-- .../rebelengine}/GodotInstrumentation.java | 2 +- .../rebeltoolbox/rebelengine}/GodotLib.java | 2 +- .../rebelengine}/GodotRenderer.java | 8 +++---- .../rebeltoolbox/rebelengine}/GodotView.java | 24 +++++++++---------- .../rebelengine}/input/GodotEditText.java | 4 ++-- .../input/GodotGestureHandler.java | 6 ++--- .../rebelengine}/input/GodotInputHandler.java | 10 ++++---- .../input/GodotTextInputWrapper.java | 4 ++-- .../input/InputManagerCompat.java | 2 +- .../rebelengine}/input/InputManagerV16.java | 2 +- .../rebelengine}/input/Joystick.java | 2 +- .../rebelengine}/plugin/GodotPlugin.java | 8 +++---- .../plugin/GodotPluginInfoProvider.java | 2 +- .../plugin/GodotPluginRegistry.java | 4 ++-- .../rebelengine}/plugin/SignalInfo.java | 2 +- .../rebelengine}/plugin/UsedByGodot.java | 2 +- .../rebelengine}/utils/Crypt.java | 2 +- .../rebelengine}/utils/GLUtils.java | 2 +- .../rebelengine}/utils/GodotNetUtils.java | 2 +- .../rebelengine}/utils/PermissionsUtil.java | 2 +- .../rebeltoolbox/rebelengine}/xr/XRMode.java | 5 +--- .../rebelengine}/xr/ovr/OvrConfigChooser.java | 2 +- .../xr/ovr/OvrContextFactory.java | 2 +- .../xr/ovr/OvrWindowSurfaceFactory.java | 2 +- .../xr/regular/RegularConfigChooser.java | 4 ++-- .../xr/regular/RegularContextFactory.java | 6 ++--- .../regular/RegularFallbackConfigChooser.java | 4 ++-- platform/android/java_godot_io_wrapper.h | 2 +- platform/android/java_godot_lib_jni.cpp | 6 ++--- platform/android/java_godot_lib_jni.h | 2 +- platform/android/java_godot_wrapper.cpp | 2 +- platform/android/java_godot_wrapper.h | 2 +- platform/android/jni_utils.cpp | 4 ++-- 47 files changed, 89 insertions(+), 92 deletions(-) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/Dictionary.java (98%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/FullScreenGodotApp.java (99%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/Godot.java (98%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/GodotDownloaderAlarmReceiver.java (98%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/GodotDownloaderService.java (99%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/GodotHost.java (98%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/GodotIO.java (99%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/GodotInstrumentation.java (98%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/GodotLib.java (99%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/GodotRenderer.java (94%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/GodotView.java (91%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/input/GodotEditText.java (99%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/input/GodotGestureHandler.java (96%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/input/GodotInputHandler.java (98%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/input/GodotTextInputWrapper.java (98%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/input/InputManagerCompat.java (98%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/input/InputManagerV16.java (98%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/input/Joystick.java (98%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/plugin/GodotPlugin.java (98%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/plugin/GodotPluginInfoProvider.java (98%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/plugin/GodotPluginRegistry.java (98%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/plugin/SignalInfo.java (98%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/plugin/UsedByGodot.java (98%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/utils/Crypt.java (98%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/utils/GLUtils.java (99%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/utils/GodotNetUtils.java (98%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/utils/PermissionsUtil.java (99%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/xr/XRMode.java (97%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/xr/ovr/OvrConfigChooser.java (99%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/xr/ovr/OvrContextFactory.java (98%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/xr/ovr/OvrWindowSurfaceFactory.java (98%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/xr/regular/RegularConfigChooser.java (98%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/xr/regular/RegularContextFactory.java (96%) rename platform/android/java/lib/src/{org/godotengine/godot => com/rebeltoolbox/rebelengine}/xr/regular/RegularFallbackConfigChooser.java (96%) diff --git a/.clang-format b/.clang-format index 8cb33fb369..a25b5a8fef 100644 --- a/.clang-format +++ b/.clang-format @@ -185,5 +185,5 @@ ObjCBlockIndentWidth: 4 ### Java specific config ### Language: Java # BreakAfterJavaFieldAnnotations: false -JavaImportGroups: ['org.godotengine', 'android', 'androidx', 'com.android', 'com.google', 'java', 'javax'] +JavaImportGroups: ['com.rebeltoolbox', 'android', 'androidx', 'com.android', 'com.google', 'java', 'javax'] ... diff --git a/copyright b/copyright index d69bcb8b54..128273b059 100644 --- a/copyright +++ b/copyright @@ -73,8 +73,8 @@ Files: ./platform/android/java/lib/aidl/com/android/vending/licensing/ ./platform/android/java/lib/res/layout/status_bar_ongoing_event_progress_bar.xml ./platform/android/java/lib/src/com/google/android/vending/expansion/downloader/ ./platform/android/java/lib/src/com/google/android/vending/licensing/ - ./platform/android/java/lib/src/org/godotengine/godot/input/InputManagerCompat.java - ./platform/android/java/lib/src/org/godotengine/godot/input/InputManagerV16.java + ./platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/InputManagerCompat.java + ./platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/InputManagerV16.java Comment: The Android Open Source Project Copyright: 2008-2013, The Android Open Source Project License: Apache-2.0 diff --git a/misc/scripts/clang_format.sh b/misc/scripts/clang_format.sh index b0020da597..fee89812b0 100755 --- a/misc/scripts/clang_format.sh +++ b/misc/scripts/clang_format.sh @@ -31,7 +31,7 @@ while IFS= read -rd '' f; do continue 2 elif [[ "$f" == *"theme_data.h" ]]; then continue 2 - elif [[ "$f" == "platform/android/java/lib/src/org/godotengine/godot/input/InputManager"* ]]; then + elif [[ "$f" == "platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/InputManager"* ]]; then continue 2 fi python misc/scripts/copyright_headers.py "$f" diff --git a/platform/android/export/gradle_export_util.h b/platform/android/export/gradle_export_util.h index 1174ffe66e..89335a8f1a 100644 --- a/platform/android/export/gradle_export_util.h +++ b/platform/android/export/gradle_export_util.h @@ -45,7 +45,7 @@ const String project_name_xml_string = R"( )"; // Supported XR modes. -// This should match the entries in 'platform/android/java/lib/src/org/godotengine/godot/xr/XRMode.java' +// This should match the entries in 'platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/XRMode.java' static const int XR_MODE_REGULAR = 0; static const int XR_MODE_OVR = 1; static const int XR_MODE_OPENXR = 2; diff --git a/platform/android/java/app/src/com/rebeltoolbox/rebelapp/GodotApp.java b/platform/android/java/app/src/com/rebeltoolbox/rebelapp/GodotApp.java index 1d4a67ec3e..390b2ee013 100644 --- a/platform/android/java/app/src/com/rebeltoolbox/rebelapp/GodotApp.java +++ b/platform/android/java/app/src/com/rebeltoolbox/rebelapp/GodotApp.java @@ -30,7 +30,7 @@ package com.rebeltoolbox.rebelapp; -import org.godotengine.godot.FullScreenGodotApp; +import com.rebeltoolbox.rebelengine.FullScreenGodotApp; import android.os.Bundle; diff --git a/platform/android/java/lib/AndroidManifest.xml b/platform/android/java/lib/AndroidManifest.xml index e45054cae4..c11f6d2b5b 100644 --- a/platform/android/java/lib/AndroidManifest.xml +++ b/platform/android/java/lib/AndroidManifest.xml @@ -1,6 +1,6 @@ @@ -22,6 +22,6 @@ android:name=".GodotInstrumentation" android:icon="@mipmap/icon" android:label="@string/project_name_string" - android:targetPackage="org.godotengine.godot" /> + android:targetPackage="com.rebeltoolbox.rebelengine" /> diff --git a/platform/android/java/lib/build.gradle b/platform/android/java/lib/build.gradle index c6089f0fa2..9d928813d1 100644 --- a/platform/android/java/lib/build.gradle +++ b/platform/android/java/lib/build.gradle @@ -28,7 +28,7 @@ android { manifestPlaceholders = [godotLibraryVersion: getGodotLibraryVersion()] } - namespace = "org.godotengine.godot" + namespace = "com.rebeltoolbox.rebelengine" compileOptions { sourceCompatibility versions.javaVersion diff --git a/platform/android/java/lib/src/org/godotengine/godot/Dictionary.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/Dictionary.java similarity index 98% rename from platform/android/java/lib/src/org/godotengine/godot/Dictionary.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/Dictionary.java index 2be63e0d09..c58957415b 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/Dictionary.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/Dictionary.java @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot; +package com.rebeltoolbox.rebelengine; import java.util.HashMap; import java.util.Set; diff --git a/platform/android/java/lib/src/org/godotengine/godot/FullScreenGodotApp.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/FullScreenGodotApp.java similarity index 99% rename from platform/android/java/lib/src/org/godotengine/godot/FullScreenGodotApp.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/FullScreenGodotApp.java index 04711f560d..25a7767189 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/FullScreenGodotApp.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/FullScreenGodotApp.java @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot; +package com.rebeltoolbox.rebelengine; import android.content.ComponentName; import android.content.Intent; diff --git a/platform/android/java/lib/src/org/godotengine/godot/Godot.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/Godot.java similarity index 98% rename from platform/android/java/lib/src/org/godotengine/godot/Godot.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/Godot.java index 86aaa92b77..bdde7b22ff 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/Godot.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/Godot.java @@ -28,17 +28,17 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot; +package com.rebeltoolbox.rebelengine; import static android.content.Context.MODE_PRIVATE; import static android.content.Context.WINDOW_SERVICE; -import org.godotengine.godot.input.GodotEditText; -import org.godotengine.godot.plugin.GodotPlugin; -import org.godotengine.godot.plugin.GodotPluginRegistry; -import org.godotengine.godot.utils.GodotNetUtils; -import org.godotengine.godot.utils.PermissionsUtil; -import org.godotengine.godot.xr.XRMode; +import com.rebeltoolbox.rebelengine.input.GodotEditText; +import com.rebeltoolbox.rebelengine.plugin.GodotPlugin; +import com.rebeltoolbox.rebelengine.plugin.GodotPluginRegistry; +import com.rebeltoolbox.rebelengine.utils.GodotNetUtils; +import com.rebeltoolbox.rebelengine.utils.PermissionsUtil; +import com.rebeltoolbox.rebelengine.xr.XRMode; import android.annotation.SuppressLint; import android.app.Activity; diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotDownloaderAlarmReceiver.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotDownloaderAlarmReceiver.java similarity index 98% rename from platform/android/java/lib/src/org/godotengine/godot/GodotDownloaderAlarmReceiver.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotDownloaderAlarmReceiver.java index e74be3e0b3..009923ce53 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/GodotDownloaderAlarmReceiver.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotDownloaderAlarmReceiver.java @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot; +package com.rebeltoolbox.rebelengine; import android.content.BroadcastReceiver; import android.content.Context; diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotDownloaderService.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotDownloaderService.java similarity index 99% rename from platform/android/java/lib/src/org/godotengine/godot/GodotDownloaderService.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotDownloaderService.java index 66a4f4baab..10fbb2d365 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/GodotDownloaderService.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotDownloaderService.java @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot; +package com.rebeltoolbox.rebelengine; import android.content.Context; import android.content.SharedPreferences; diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotHost.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotHost.java similarity index 98% rename from platform/android/java/lib/src/org/godotengine/godot/GodotHost.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotHost.java index ce6cca3db6..fa36a43365 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/GodotHost.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotHost.java @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot; +package com.rebeltoolbox.rebelengine; import java.util.Collections; import java.util.List; diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotIO.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotIO.java similarity index 99% rename from platform/android/java/lib/src/org/godotengine/godot/GodotIO.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotIO.java index 83d59c0331..60bd9df8c7 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/GodotIO.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotIO.java @@ -28,9 +28,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot; +package com.rebeltoolbox.rebelengine; -import org.godotengine.godot.input.GodotEditText; +import com.rebeltoolbox.rebelengine.input.GodotEditText; import android.app.Activity; import android.content.ActivityNotFoundException; diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotInstrumentation.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotInstrumentation.java similarity index 98% rename from platform/android/java/lib/src/org/godotengine/godot/GodotInstrumentation.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotInstrumentation.java index 50b5d2baf3..6db96b143f 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/GodotInstrumentation.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotInstrumentation.java @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot; +package com.rebeltoolbox.rebelengine; import android.app.Instrumentation; import android.content.Intent; diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotLib.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotLib.java similarity index 99% rename from platform/android/java/lib/src/org/godotengine/godot/GodotLib.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotLib.java index 70ac812c23..bf960c880e 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/GodotLib.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotLib.java @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot; +package com.rebeltoolbox.rebelengine; import android.app.Activity; import android.hardware.SensorEvent; diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotRenderer.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotRenderer.java similarity index 94% rename from platform/android/java/lib/src/org/godotengine/godot/GodotRenderer.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotRenderer.java index 49e615dc2f..b7df866c78 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/GodotRenderer.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotRenderer.java @@ -28,11 +28,11 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot; +package com.rebeltoolbox.rebelengine; -import org.godotengine.godot.plugin.GodotPlugin; -import org.godotengine.godot.plugin.GodotPluginRegistry; -import org.godotengine.godot.utils.GLUtils; +import com.rebeltoolbox.rebelengine.plugin.GodotPlugin; +import com.rebeltoolbox.rebelengine.plugin.GodotPluginRegistry; +import com.rebeltoolbox.rebelengine.utils.GLUtils; import android.opengl.GLSurfaceView; diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotView.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotView.java similarity index 91% rename from platform/android/java/lib/src/org/godotengine/godot/GodotView.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotView.java index 9dab5c35ef..7bbba5db73 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/GodotView.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotView.java @@ -28,18 +28,18 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot; - -import org.godotengine.godot.input.GodotGestureHandler; -import org.godotengine.godot.input.GodotInputHandler; -import org.godotengine.godot.utils.GLUtils; -import org.godotengine.godot.xr.XRMode; -import org.godotengine.godot.xr.ovr.OvrConfigChooser; -import org.godotengine.godot.xr.ovr.OvrContextFactory; -import org.godotengine.godot.xr.ovr.OvrWindowSurfaceFactory; -import org.godotengine.godot.xr.regular.RegularConfigChooser; -import org.godotengine.godot.xr.regular.RegularContextFactory; -import org.godotengine.godot.xr.regular.RegularFallbackConfigChooser; +package com.rebeltoolbox.rebelengine; + +import com.rebeltoolbox.rebelengine.input.GodotGestureHandler; +import com.rebeltoolbox.rebelengine.input.GodotInputHandler; +import com.rebeltoolbox.rebelengine.utils.GLUtils; +import com.rebeltoolbox.rebelengine.xr.XRMode; +import com.rebeltoolbox.rebelengine.xr.ovr.OvrConfigChooser; +import com.rebeltoolbox.rebelengine.xr.ovr.OvrContextFactory; +import com.rebeltoolbox.rebelengine.xr.ovr.OvrWindowSurfaceFactory; +import com.rebeltoolbox.rebelengine.xr.regular.RegularConfigChooser; +import com.rebeltoolbox.rebelengine.xr.regular.RegularContextFactory; +import com.rebeltoolbox.rebelengine.xr.regular.RegularFallbackConfigChooser; import android.annotation.SuppressLint; import android.content.Context; diff --git a/platform/android/java/lib/src/org/godotengine/godot/input/GodotEditText.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotEditText.java similarity index 99% rename from platform/android/java/lib/src/org/godotengine/godot/input/GodotEditText.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotEditText.java index a5a704a807..e76cfcb6d6 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/input/GodotEditText.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotEditText.java @@ -28,9 +28,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.input; +package com.rebeltoolbox.rebelengine.input; -import org.godotengine.godot.*; +import com.rebeltoolbox.rebelengine.*; import android.content.Context; import android.os.Handler; diff --git a/platform/android/java/lib/src/org/godotengine/godot/input/GodotGestureHandler.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotGestureHandler.java similarity index 96% rename from platform/android/java/lib/src/org/godotengine/godot/input/GodotGestureHandler.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotGestureHandler.java index eec360645a..2a01a3c56f 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/input/GodotGestureHandler.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotGestureHandler.java @@ -28,10 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.input; +package com.rebeltoolbox.rebelengine.input; -import org.godotengine.godot.GodotLib; -import org.godotengine.godot.GodotView; +import com.rebeltoolbox.rebelengine.GodotLib; +import com.rebeltoolbox.rebelengine.GodotView; import android.view.GestureDetector; import android.view.MotionEvent; diff --git a/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotInputHandler.java similarity index 98% rename from platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotInputHandler.java index 7b9766bcee..be7abd37fc 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotInputHandler.java @@ -28,13 +28,13 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.input; +package com.rebeltoolbox.rebelengine.input; -import static org.godotengine.godot.utils.GLUtils.DEBUG; +import static com.rebeltoolbox.rebelengine.utils.GLUtils.DEBUG; -import org.godotengine.godot.GodotLib; -import org.godotengine.godot.GodotView; -import org.godotengine.godot.input.InputManagerCompat.InputDeviceListener; +import com.rebeltoolbox.rebelengine.GodotLib; +import com.rebeltoolbox.rebelengine.GodotView; +import com.rebeltoolbox.rebelengine.input.InputManagerCompat.InputDeviceListener; import android.os.Build; import android.util.Log; diff --git a/platform/android/java/lib/src/org/godotengine/godot/input/GodotTextInputWrapper.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotTextInputWrapper.java similarity index 98% rename from platform/android/java/lib/src/org/godotengine/godot/input/GodotTextInputWrapper.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotTextInputWrapper.java index aaf69e1aa8..115a82b975 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/input/GodotTextInputWrapper.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotTextInputWrapper.java @@ -28,9 +28,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.input; +package com.rebeltoolbox.rebelengine.input; -import org.godotengine.godot.*; +import com.rebeltoolbox.rebelengine.*; import android.content.Context; import android.text.Editable; diff --git a/platform/android/java/lib/src/org/godotengine/godot/input/InputManagerCompat.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/InputManagerCompat.java similarity index 98% rename from platform/android/java/lib/src/org/godotengine/godot/input/InputManagerCompat.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/InputManagerCompat.java index 21fdc658bb..0d73399925 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/input/InputManagerCompat.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/InputManagerCompat.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.godotengine.godot.input; +package com.rebeltoolbox.rebelengine.input; import android.content.Context; import android.os.Handler; diff --git a/platform/android/java/lib/src/org/godotengine/godot/input/InputManagerV16.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/InputManagerV16.java similarity index 98% rename from platform/android/java/lib/src/org/godotengine/godot/input/InputManagerV16.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/InputManagerV16.java index 0dbc13c77b..827eca9b2d 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/input/InputManagerV16.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/InputManagerV16.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.godotengine.godot.input; +package com.rebeltoolbox.rebelengine.input; import android.annotation.TargetApi; import android.content.Context; diff --git a/platform/android/java/lib/src/org/godotengine/godot/input/Joystick.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/Joystick.java similarity index 98% rename from platform/android/java/lib/src/org/godotengine/godot/input/Joystick.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/Joystick.java index a434336991..1b3fe7cbd6 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/input/Joystick.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/Joystick.java @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.input; +package com.rebeltoolbox.rebelengine.input; import android.util.SparseArray; diff --git a/platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPlugin.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPlugin.java similarity index 98% rename from platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPlugin.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPlugin.java index 25cb2416eb..8ad6f67f45 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPlugin.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPlugin.java @@ -28,10 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.plugin; +package com.rebeltoolbox.rebelengine.plugin; -import org.godotengine.godot.BuildConfig; -import org.godotengine.godot.Godot; +import com.rebeltoolbox.rebelengine.BuildConfig; +import com.rebeltoolbox.rebelengine.Godot; import android.app.Activity; import android.content.Intent; @@ -185,7 +185,7 @@ private static Map registerPluginWithGodotNative(Object plug /** * Invoked once during the Godot Android initialization process after creation of the - * {@link org.godotengine.godot.GodotView} view. + * {@link com.rebeltoolbox.rebelengine.GodotView} view. *

* The plugin can return a non-null {@link View} layout in order to add it to the Godot view * hierarchy. diff --git a/platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPluginInfoProvider.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPluginInfoProvider.java similarity index 98% rename from platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPluginInfoProvider.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPluginInfoProvider.java index 341da4cb6c..4e2b886c2e 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPluginInfoProvider.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPluginInfoProvider.java @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.plugin; +package com.rebeltoolbox.rebelengine.plugin; import androidx.annotation.NonNull; diff --git a/platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPluginRegistry.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPluginRegistry.java similarity index 98% rename from platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPluginRegistry.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPluginRegistry.java index efdbeb5f3e..7a20019e0b 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPluginRegistry.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPluginRegistry.java @@ -28,9 +28,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.plugin; +package com.rebeltoolbox.rebelengine.plugin; -import org.godotengine.godot.Godot; +import com.rebeltoolbox.rebelengine.Godot; import android.app.Activity; import android.content.pm.ApplicationInfo; diff --git a/platform/android/java/lib/src/org/godotengine/godot/plugin/SignalInfo.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/SignalInfo.java similarity index 98% rename from platform/android/java/lib/src/org/godotengine/godot/plugin/SignalInfo.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/SignalInfo.java index 36b1b2ebfd..ebba103e71 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/plugin/SignalInfo.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/SignalInfo.java @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.plugin; +package com.rebeltoolbox.rebelengine.plugin; import android.text.TextUtils; diff --git a/platform/android/java/lib/src/org/godotengine/godot/plugin/UsedByGodot.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/UsedByGodot.java similarity index 98% rename from platform/android/java/lib/src/org/godotengine/godot/plugin/UsedByGodot.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/UsedByGodot.java index c41b081df0..e566e28bd0 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/plugin/UsedByGodot.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/UsedByGodot.java @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.plugin; +package com.rebeltoolbox.rebelengine.plugin; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/platform/android/java/lib/src/org/godotengine/godot/utils/Crypt.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/utils/Crypt.java similarity index 98% rename from platform/android/java/lib/src/org/godotengine/godot/utils/Crypt.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/utils/Crypt.java index c4bd9a6353..b98771b6cf 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/utils/Crypt.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/utils/Crypt.java @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.utils; +package com.rebeltoolbox.rebelengine.utils; import java.security.MessageDigest; import java.util.Random; diff --git a/platform/android/java/lib/src/org/godotengine/godot/utils/GLUtils.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/utils/GLUtils.java similarity index 99% rename from platform/android/java/lib/src/org/godotengine/godot/utils/GLUtils.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/utils/GLUtils.java index 7c4d92bd79..240b1cfdcc 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/utils/GLUtils.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/utils/GLUtils.java @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.utils; +package com.rebeltoolbox.rebelengine.utils; import android.util.Log; diff --git a/platform/android/java/lib/src/org/godotengine/godot/utils/GodotNetUtils.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/utils/GodotNetUtils.java similarity index 98% rename from platform/android/java/lib/src/org/godotengine/godot/utils/GodotNetUtils.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/utils/GodotNetUtils.java index 64ce8b31cd..4b9dee2dd6 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/utils/GodotNetUtils.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/utils/GodotNetUtils.java @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.utils; +package com.rebeltoolbox.rebelengine.utils; import android.app.Activity; import android.content.Context; diff --git a/platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/utils/PermissionsUtil.java similarity index 99% rename from platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/utils/PermissionsUtil.java index 158e763956..f359b04659 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/utils/PermissionsUtil.java @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.utils; +package com.rebeltoolbox.rebelengine.utils; import android.Manifest; import android.app.Activity; diff --git a/platform/android/java/lib/src/org/godotengine/godot/xr/XRMode.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/XRMode.java similarity index 97% rename from platform/android/java/lib/src/org/godotengine/godot/xr/XRMode.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/XRMode.java index 8e5e8c27f1..646f7723f1 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/xr/XRMode.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/XRMode.java @@ -28,11 +28,8 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.xr; +package com.rebeltoolbox.rebelengine.xr; -/** - * Godot available XR modes. - */ public enum XRMode { REGULAR(0, "Regular", "--xr_mode_regular", "Default Android Gamepad"), // Regular/flatscreen OVR(1, "Oculus Mobile VrApi (Deprecated)", "--xr_mode_ovr", ""), diff --git a/platform/android/java/lib/src/org/godotengine/godot/xr/ovr/OvrConfigChooser.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/ovr/OvrConfigChooser.java similarity index 99% rename from platform/android/java/lib/src/org/godotengine/godot/xr/ovr/OvrConfigChooser.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/ovr/OvrConfigChooser.java index 88647a069b..1661b048b8 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/xr/ovr/OvrConfigChooser.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/ovr/OvrConfigChooser.java @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.xr.ovr; +package com.rebeltoolbox.rebelengine.xr.ovr; import android.opengl.EGLExt; import android.opengl.GLSurfaceView; diff --git a/platform/android/java/lib/src/org/godotengine/godot/xr/ovr/OvrContextFactory.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/ovr/OvrContextFactory.java similarity index 98% rename from platform/android/java/lib/src/org/godotengine/godot/xr/ovr/OvrContextFactory.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/ovr/OvrContextFactory.java index dbc67ecfd5..91dc5de177 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/xr/ovr/OvrContextFactory.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/ovr/OvrContextFactory.java @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.xr.ovr; +package com.rebeltoolbox.rebelengine.xr.ovr; import android.opengl.EGL14; import android.opengl.GLSurfaceView; diff --git a/platform/android/java/lib/src/org/godotengine/godot/xr/ovr/OvrWindowSurfaceFactory.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/ovr/OvrWindowSurfaceFactory.java similarity index 98% rename from platform/android/java/lib/src/org/godotengine/godot/xr/ovr/OvrWindowSurfaceFactory.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/ovr/OvrWindowSurfaceFactory.java index f2947b99ab..468c231e61 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/xr/ovr/OvrWindowSurfaceFactory.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/ovr/OvrWindowSurfaceFactory.java @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.xr.ovr; +package com.rebeltoolbox.rebelengine.xr.ovr; import android.opengl.GLSurfaceView; diff --git a/platform/android/java/lib/src/org/godotengine/godot/xr/regular/RegularConfigChooser.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/regular/RegularConfigChooser.java similarity index 98% rename from platform/android/java/lib/src/org/godotengine/godot/xr/regular/RegularConfigChooser.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/regular/RegularConfigChooser.java index 74594c4c08..c9add38a03 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/xr/regular/RegularConfigChooser.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/regular/RegularConfigChooser.java @@ -28,9 +28,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.xr.regular; +package com.rebeltoolbox.rebelengine.xr.regular; -import org.godotengine.godot.utils.GLUtils; +import com.rebeltoolbox.rebelengine.utils.GLUtils; import android.opengl.GLSurfaceView; diff --git a/platform/android/java/lib/src/org/godotengine/godot/xr/regular/RegularContextFactory.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/regular/RegularContextFactory.java similarity index 96% rename from platform/android/java/lib/src/org/godotengine/godot/xr/regular/RegularContextFactory.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/regular/RegularContextFactory.java index 0f06757d86..2f8da4ef5d 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/xr/regular/RegularContextFactory.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/regular/RegularContextFactory.java @@ -28,10 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.xr.regular; +package com.rebeltoolbox.rebelengine.xr.regular; -import org.godotengine.godot.GodotLib; -import org.godotengine.godot.utils.GLUtils; +import com.rebeltoolbox.rebelengine.GodotLib; +import com.rebeltoolbox.rebelengine.utils.GLUtils; import android.opengl.GLSurfaceView; import android.util.Log; diff --git a/platform/android/java/lib/src/org/godotengine/godot/xr/regular/RegularFallbackConfigChooser.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/regular/RegularFallbackConfigChooser.java similarity index 96% rename from platform/android/java/lib/src/org/godotengine/godot/xr/regular/RegularFallbackConfigChooser.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/regular/RegularFallbackConfigChooser.java index 72ab60c1fd..dbba826b18 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/xr/regular/RegularFallbackConfigChooser.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/regular/RegularFallbackConfigChooser.java @@ -28,9 +28,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.xr.regular; +package com.rebeltoolbox.rebelengine.xr.regular; -import org.godotengine.godot.utils.GLUtils; +import com.rebeltoolbox.rebelengine.utils.GLUtils; import android.util.Log; diff --git a/platform/android/java_godot_io_wrapper.h b/platform/android/java_godot_io_wrapper.h index 94395c20d8..08e4faecca 100644 --- a/platform/android/java_godot_io_wrapper.h +++ b/platform/android/java_godot_io_wrapper.h @@ -39,7 +39,7 @@ #include "string_android.h" -// Class that makes functions in java/src/org/godotengine/godot/GodotIO.java callable from C++ +// Class that makes functions in java/src/com/rebeltoolbox/rebelengine/GodotIO.java callable from C++ class GodotIOJavaWrapper { private: jobject godot_io_instance; diff --git a/platform/android/java_godot_lib_jni.cpp b/platform/android/java_godot_lib_jni.cpp index c57dcb180a..92c9edad4a 100644 --- a/platform/android/java_godot_lib_jni.cpp +++ b/platform/android/java_godot_lib_jni.cpp @@ -102,7 +102,7 @@ static void _initialize_java_modules() { jclass singletonClass = (jclass)env->CallObjectMethod(cls, findClass, strClassName); ERR_CONTINUE_MSG(!singletonClass, "Couldn't find singleton for class: " + m + "."); - jmethodID initialize = env->GetStaticMethodID(singletonClass, "initialize", "(Landroid/app/Activity;)Lorg/godotengine/godot/Godot$SingletonBase;"); + jmethodID initialize = env->GetStaticMethodID(singletonClass, "initialize", "(Landroid/app/Activity;)Lcom/rebeltoolbox/rebelengine/Godot$SingletonBase;"); ERR_CONTINUE_MSG(!initialize, "Couldn't find proper initialize function 'public static Godot.SingletonBase Class::initialize(Activity p_activity)' initializer for singleton class: " + m + "."); jobject obj = env->CallStaticObjectMethod(singletonClass, initialize, godot_java->get_activity()); @@ -127,7 +127,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *en // create our wrapper classes godot_java = new GodotJavaWrapper(env, activity, godot_instance); - godot_io_java = new GodotIOJavaWrapper(env, godot_java->get_member_object("io", "Lorg/godotengine/godot/GodotIO;", env)); + godot_io_java = new GodotIOJavaWrapper(env, godot_java->get_member_object("io", "Lcom/rebeltoolbox/rebelengine/GodotIO;", env)); init_thread_jandroid(jvm, env); @@ -136,7 +136,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *en FileAccessAndroid::asset_manager = AAssetManager_fromJava(env, amgr); DirAccessJAndroid::setup(godot_io_java->get_instance()); - NetSocketAndroid::setup(godot_java->get_member_object("netUtils", "Lorg/godotengine/godot/utils/GodotNetUtils;", env)); + NetSocketAndroid::setup(godot_java->get_member_object("netUtils", "Lcom/rebeltoolbox/rebelengine/utils/GodotNetUtils;", env)); os_android = new OS_Android(godot_java, godot_io_java, p_use_apk_expansion); diff --git a/platform/android/java_godot_lib_jni.h b/platform/android/java_godot_lib_jni.h index 358f203eca..0fef9cf98b 100644 --- a/platform/android/java_godot_lib_jni.h +++ b/platform/android/java_godot_lib_jni.h @@ -35,7 +35,7 @@ #include // These functions can be called from within JAVA and are the means by which our JAVA implementation calls back into our C++ code. -// See java/src/org/godotengine/godot/GodotLib.java for the JAVA side of this (yes that's why we have the long names) +// See java/lib/src/com/rebeltoolbox/rebelengine/GodotLib.java for the JAVA side of this (yes that's why we have the long names) extern "C" { JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *env, jclass clazz, jobject activity, jobject godot_instance, jobject p_asset_manager, jboolean p_use_apk_expansion); JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_ondestroy(JNIEnv *env, jclass clazz); diff --git a/platform/android/java_godot_wrapper.cpp b/platform/android/java_godot_wrapper.cpp index 5a405a45b0..f6943af399 100644 --- a/platform/android/java_godot_wrapper.cpp +++ b/platform/android/java_godot_wrapper.cpp @@ -42,7 +42,7 @@ GodotJavaWrapper::GodotJavaWrapper(JNIEnv *p_env, jobject p_activity, jobject p_ activity = p_env->NewGlobalRef(p_activity); // get info about our Godot class so we can get pointers and stuff... - godot_class = p_env->FindClass("org/godotengine/godot/Godot"); + godot_class = p_env->FindClass("com/rebeltoolbox/rebelengine/Godot"); if (godot_class) { godot_class = (jclass)p_env->NewGlobalRef(godot_class); } else { diff --git a/platform/android/java_godot_wrapper.h b/platform/android/java_godot_wrapper.h index 78a8a49331..53f8ef8800 100644 --- a/platform/android/java_godot_wrapper.h +++ b/platform/android/java_godot_wrapper.h @@ -39,7 +39,7 @@ #include "string_android.h" -// Class that makes functions in java/src/org/godotengine/godot/Godot.java callable from C++ +// Class that makes functions in java/src/lib/com/rebeltoolbox/rebelengine/Godot.java callable from C++ class GodotJavaWrapper { private: jobject godot_instance; diff --git a/platform/android/jni_utils.cpp b/platform/android/jni_utils.cpp index e12969266c..fa256b540f 100644 --- a/platform/android/jni_utils.cpp +++ b/platform/android/jni_utils.cpp @@ -100,7 +100,7 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant *p_a case Variant::DICTIONARY: { Dictionary dict = *p_arg; - jclass dclass = env->FindClass("org/godotengine/godot/Dictionary"); + jclass dclass = env->FindClass("com/rebeltoolbox/rebelengine/Dictionary"); jmethodID ctor = env->GetMethodID(dclass, "", "()V"); jobject jdict = env->NewObject(dclass, ctor); @@ -377,7 +377,7 @@ const char *get_jni_sig(const String &p_type) { { "float", "F" }, { "double", "D" }, { "java.lang.String", "Ljava/lang/String;" }, - { "org.godotengine.godot.Dictionary", "Lorg/godotengine/godot/Dictionary;" }, + { "com.rebeltoolbox.rebelengine.Dictionary", "Lcom/rebeltoolbox/rebelengine/Dictionary;" }, { "[I", "[I" }, { "[B", "[B" }, { "[F", "[F" }, From 581fd55e8beb0298b099feb71b64fc7f9dcb47c0 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sat, 10 Jun 2023 11:37:07 +1200 Subject: [PATCH 06/41] Update Android Vending Expansion patch --- ...android.vending.expansion.downloader.patch | 48 +++++++++---------- .../DownloaderClientMarshaller.java | 8 ++-- .../DownloaderServiceMarshaller.java | 8 ++-- .../vending/expansion/downloader/Helpers.java | 14 +++--- .../expansion/downloader/SystemFacade.java | 4 +- .../downloader/impl/DownloadNotification.java | 6 +-- .../downloader/impl/DownloadThread.java | 4 +- .../downloader/impl/DownloaderService.java | 4 +- 8 files changed, 48 insertions(+), 48 deletions(-) diff --git a/platform/android/java/lib/patches/com.google.android.vending.expansion.downloader.patch b/platform/android/java/lib/patches/com.google.android.vending.expansion.downloader.patch index 07717f0c71..9790ca43fe 100644 --- a/platform/android/java/lib/patches/com.google.android.vending.expansion.downloader.patch +++ b/platform/android/java/lib/patches/com.google.android.vending.expansion.downloader.patch @@ -6,9 +6,9 @@ index ad6ea0de6..452c7d148 100644 import android.os.RemoteException; import android.util.Log; -+// -- GODOT start -- ++// -- REBEL start -- +import java.lang.ref.WeakReference; -+// -- GODOT end -- ++// -- REBEL end -- /** @@ -17,7 +17,7 @@ index ad6ea0de6..452c7d148 100644 * Target we publish for clients to send messages to IncomingHandler. */ - final Messenger mMessenger = new Messenger(new Handler() { -+ // -- GODOT start -- ++ // -- REBEL start -- + private final MessengerHandlerClient mMsgHandler = new MessengerHandlerClient(this); + final Messenger mMessenger = new Messenger(mMsgHandler); + @@ -74,7 +74,7 @@ index ad6ea0de6..452c7d148 100644 + break; + } + } -+ // -- GODOT end -- ++ // -- REBEL end -- public Stub(IDownloaderClient itf, Class downloaderService) { mItf = itf; @@ -86,9 +86,9 @@ index 979352299..3771d19c9 100644 import android.os.Messenger; import android.os.RemoteException; -+// -- GODOT start -- ++// -- REBEL start -- +import java.lang.ref.WeakReference; -+// -- GODOT end -- ++// -- REBEL end -- /** @@ -97,7 +97,7 @@ index 979352299..3771d19c9 100644 private static class Stub implements IStub { private IDownloaderService mItf = null; - final Messenger mMessenger = new Messenger(new Handler() { -+ // -- GODOT start -- ++ // -- REBEL start -- + private final MessengerHandlerServer mMsgHandler = new MessengerHandlerServer(this); + final Messenger mMessenger = new Messenger(mMsgHandler); + @@ -160,7 +160,7 @@ index 979352299..3771d19c9 100644 + break; + } + } -+ // -- GODOT end -- ++ // -- REBEL end -- public Stub(IDownloaderService itf) { mItf = itf; @@ -173,10 +173,10 @@ index e4b1b0f1c..36cd6aacf 100644 import android.util.Log; -import com.android.vending.expansion.downloader.R; -+// -- GODOT start -- ++// -- REBEL start -- +//import com.android.vending.expansion.downloader.R; -+import org.godotengine.godot.R; -+// -- GODOT end -- ++import com.rebeltoolbox.rebelengine.R; ++// -- REBEL end -- import java.io.File; import java.text.SimpleDateFormat; @@ -185,7 +185,7 @@ index e4b1b0f1c..36cd6aacf 100644 return ""; } - return String.format("%.2f", -+ // -- GODOT start -- ++ // -- REBEL start -- + return String.format(Locale.ENGLISH, "%.2f", (float) overallProgress / (1024.0f * 1024.0f)) + "MB /" + @@ -193,7 +193,7 @@ index e4b1b0f1c..36cd6aacf 100644 + String.format(Locale.ENGLISH, "%.2f", (float) overallTotal / (1024.0f * 1024.0f)) + "MB"; -+ // -- GODOT end -- ++ // -- REBEL end -- } /** @@ -202,9 +202,9 @@ index e4b1b0f1c..36cd6aacf 100644 public static String getSpeedString(float bytesPerMillisecond) { - return String.format("%.2f", bytesPerMillisecond * 1000 / 1024); -+ // -- GODOT start -- ++ // -- REBEL start -- + return String.format(Locale.ENGLISH, "%.2f", bytesPerMillisecond * 1000 / 1024); -+ // -- GODOT end -- ++ // -- REBEL end -- } public static String getTimeRemaining(long durationInMilliseconds) { @@ -216,9 +216,9 @@ index 12edd97ab..a0e1165cc 100644 import android.telephony.TelephonyManager; import android.util.Log; -+// -- GODOT start -- ++// -- REBEL start -- +import android.annotation.SuppressLint; -+// -- GODOT end -- ++// -- REBEL end -- + /** * Contains useful helper functions, typically tied to the application context. @@ -248,10 +248,10 @@ index f1536e80e..4b214b22d 100644 package com.google.android.vending.expansion.downloader.impl; -import com.android.vending.expansion.downloader.R; -+// -- GODOT start -- ++// -- REBEL start -- +//import com.android.vending.expansion.downloader.R; -+import org.godotengine.godot.R; -+// -- GODOT end -- ++import com.rebeltoolbox.rebelengine.R; ++// -- REBEL end -- + import com.google.android.vending.expansion.downloader.DownloadProgressInfo; import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; @@ -266,12 +266,12 @@ index b2e0e7af0..c114b8a64 100644 PowerManager pm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); - wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, Constants.TAG); - wakeLock.acquire(); -+ // -- GODOT start -- ++ // -- REBEL start -- + //wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, Constants.TAG); + //wakeLock.acquire(); + wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "org.godot.game:wakelock"); + wakeLock.acquire(20 * 60 * 1000L /*20 minutes*/); -+ // -- GODOT end -- ++ // -- REBEL end -- if (Constants.LOGV) { Log.v(Constants.TAG, "initiating download for " + mInfo.mFileName); @@ -283,9 +283,9 @@ index 4babe476f..8d41a7690 100644 import android.telephony.TelephonyManager; import android.util.Log; -+// -- GODOT start -- ++// -- REBEL start -- +import android.annotation.SuppressLint; -+// -- GODOT end -- ++// -- REBEL end -- + import java.io.File; diff --git a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java index 452c7d1483..ab395ea2ca 100644 --- a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java +++ b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java @@ -32,9 +32,9 @@ import android.os.RemoteException; import android.util.Log; -// -- GODOT start -- +// -- REBEL start -- import java.lang.ref.WeakReference; -// -- GODOT end -- +// -- REBEL end -- /** @@ -121,7 +121,7 @@ private static class Stub implements IStub { /** * Target we publish for clients to send messages to IncomingHandler. */ - // -- GODOT start -- + // -- REBEL start -- private final MessengerHandlerClient mMsgHandler = new MessengerHandlerClient(this); final Messenger mMessenger = new Messenger(mMsgHandler); @@ -160,7 +160,7 @@ private void handleMessage(Message msg) { break; } } - // -- GODOT end -- + // -- REBEL end -- public Stub(IDownloaderClient itf, Class downloaderService) { mItf = itf; diff --git a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java index 3771d19c9b..28404b3ed5 100644 --- a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java +++ b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java @@ -25,9 +25,9 @@ import android.os.Messenger; import android.os.RemoteException; -// -- GODOT start -- +// -- REBEL start -- import java.lang.ref.WeakReference; -// -- GODOT end -- +// -- REBEL end -- /** @@ -111,7 +111,7 @@ public void onClientUpdated(Messenger clientMessenger) { private static class Stub implements IStub { private IDownloaderService mItf = null; - // -- GODOT start -- + // -- REBEL start -- private final MessengerHandlerServer mMsgHandler = new MessengerHandlerServer(this); final Messenger mMessenger = new Messenger(mMsgHandler); @@ -153,7 +153,7 @@ private void handleMessage(Message msg) { break; } } - // -- GODOT end -- + // -- REBEL end -- public Stub(IDownloaderService itf) { mItf = itf; diff --git a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/Helpers.java b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/Helpers.java index 2a72c9818d..49e71bf184 100644 --- a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/Helpers.java +++ b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/Helpers.java @@ -24,10 +24,10 @@ import android.os.SystemClock; import android.util.Log; -// -- GODOT start -- +// -- REBEL start -- //import com.android.vending.expansion.downloader.R; -import org.godotengine.godot.R; -// -- GODOT end -- +import com.rebeltoolbox.rebelengine.R; +// -- REBEL end -- import java.io.File; import java.text.SimpleDateFormat; @@ -149,14 +149,14 @@ static public String getDownloadProgressString(long overallProgress, long overal } return ""; } - // -- GODOT start -- + // -- REBEL start -- return String.format(Locale.ENGLISH, "%.2f", (float) overallProgress / (1024.0f * 1024.0f)) + "MB /" + String.format(Locale.ENGLISH, "%.2f", (float) overallTotal / (1024.0f * 1024.0f)) + "MB"; - // -- GODOT end -- + // -- REBEL end -- } /** @@ -189,9 +189,9 @@ public static String getDownloadProgressPercent(long overallProgress, long overa } public static String getSpeedString(float bytesPerMillisecond) { - // -- GODOT start -- + // -- REBEL start -- return String.format(Locale.ENGLISH, "%.2f", bytesPerMillisecond * 1000 / 1024); - // -- GODOT end -- + // -- REBEL end -- } public static String getTimeRemaining(long durationInMilliseconds) { diff --git a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/SystemFacade.java b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/SystemFacade.java index a0e1165cc4..6cfd8133a4 100644 --- a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/SystemFacade.java +++ b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/SystemFacade.java @@ -26,9 +26,9 @@ import android.telephony.TelephonyManager; import android.util.Log; -// -- GODOT start -- +// -- REBEL start -- import android.annotation.SuppressLint; -// -- GODOT end -- +// -- REBEL end -- /** * Contains useful helper functions, typically tied to the application context. diff --git a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java index d481c22204..7998d2f25f 100644 --- a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java +++ b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java @@ -16,10 +16,10 @@ package com.google.android.vending.expansion.downloader.impl; -// -- GODOT start -- +// -- REBEL start -- //import com.android.vending.expansion.downloader.R; -import org.godotengine.godot.R; -// -- GODOT end -- +import com.rebeltoolbox.rebelengine.R; +// -- REBEL end -- import com.google.android.vending.expansion.downloader.DownloadProgressInfo; import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; diff --git a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java index c114b8a64a..e0b3fa5ab0 100644 --- a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java +++ b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java @@ -146,12 +146,12 @@ public void run() { try { PowerManager pm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); - // -- GODOT start -- + // -- REBEL start -- //wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, Constants.TAG); //wakeLock.acquire(); wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "org.godot.game:wakelock"); wakeLock.acquire(20 * 60 * 1000L /*20 minutes*/); - // -- GODOT end -- + // -- REBEL end -- if (Constants.LOGV) { Log.v(Constants.TAG, "initiating download for " + mInfo.mFileName); diff --git a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java index 8d41a76900..f91813c5ae 100644 --- a/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java +++ b/platform/android/java/lib/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java @@ -50,9 +50,9 @@ import android.telephony.TelephonyManager; import android.util.Log; -// -- GODOT start -- +// -- REBEL start -- import android.annotation.SuppressLint; -// -- GODOT end -- +// -- REBEL end -- import java.io.File; From d01a65ffd73e9a7d43c7c694e4433eec230456b3 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sat, 10 Jun 2023 11:55:48 +1200 Subject: [PATCH 07/41] Update Android Vending Licensing patch --- .../com.google.android.vending.licensing.patch | 14 +++++++------- .../vending/licensing/PreferenceObfuscator.java | 4 ++-- .../android/vending/licensing/util/Base64.java | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/platform/android/java/lib/patches/com.google.android.vending.licensing.patch b/platform/android/java/lib/patches/com.google.android.vending.licensing.patch index 993c4806c2..aa94c516fa 100644 --- a/platform/android/java/lib/patches/com.google.android.vending.licensing.patch +++ b/platform/android/java/lib/patches/com.google.android.vending.licensing.patch @@ -6,9 +6,9 @@ index 7c42bfc28..feb579af0 100644 public void putString(String key, String value) { if (mEditor == null) { mEditor = mPreferences.edit(); -+ // -- GODOT start -- ++ // -- REBEL start -- + mEditor.apply(); -+ // -- GODOT end -- ++ // -- REBEL end -- } String obfuscatedValue = mObfuscator.obfuscate(value, key); mEditor.putString(key, obfuscatedValue); @@ -20,9 +20,9 @@ index a0d2779af..a8bf65f9c 100644 * @version 1.3 */ -+// -- GODOT start -- -+import org.godotengine.godot.BuildConfig; -+// -- GODOT end -- ++// -- REBEL start -- ++import com.rebeltoolbox.rebelengine.BuildConfig; ++// -- REBEL end -- + /** * Base64 converter class. This code is not a full-blown MIME encoder; @@ -32,11 +32,11 @@ index a0d2779af..a8bf65f9c 100644 } - assert (e == outBuff.length); -+ // -- GODOT start -- ++ // -- REBEL start -- + //assert (e == outBuff.length); + if (BuildConfig.DEBUG && e != outBuff.length) + throw new RuntimeException(); -+ // -- GODOT end -- ++ // -- REBEL end -- return outBuff; } diff --git a/platform/android/java/lib/src/com/google/android/vending/licensing/PreferenceObfuscator.java b/platform/android/java/lib/src/com/google/android/vending/licensing/PreferenceObfuscator.java index feb579af04..dd243348cd 100644 --- a/platform/android/java/lib/src/com/google/android/vending/licensing/PreferenceObfuscator.java +++ b/platform/android/java/lib/src/com/google/android/vending/licensing/PreferenceObfuscator.java @@ -45,9 +45,9 @@ public PreferenceObfuscator(SharedPreferences sp, Obfuscator o) { public void putString(String key, String value) { if (mEditor == null) { mEditor = mPreferences.edit(); - // -- GODOT start -- + // -- REBEL start -- mEditor.apply(); - // -- GODOT end -- + // -- REBEL end -- } String obfuscatedValue = mObfuscator.obfuscate(value, key); mEditor.putString(key, obfuscatedValue); diff --git a/platform/android/java/lib/src/com/google/android/vending/licensing/util/Base64.java b/platform/android/java/lib/src/com/google/android/vending/licensing/util/Base64.java index 79efca9621..77120f737e 100644 --- a/platform/android/java/lib/src/com/google/android/vending/licensing/util/Base64.java +++ b/platform/android/java/lib/src/com/google/android/vending/licensing/util/Base64.java @@ -31,9 +31,9 @@ * @version 1.3 */ -// -- GODOT start -- -import org.godotengine.godot.BuildConfig; -// -- GODOT end -- +// -- REBEL start -- +import com.rebeltoolbox.rebelengine.BuildConfig; +// -- REBEL end -- /** * Base64 converter class. This code is not a full-blown MIME encoder; @@ -345,11 +345,11 @@ public static byte[] encode(byte[] source, int off, int len, byte[] alphabet, e += 4; } - // -- GODOT start -- + // -- REBEL start -- //assert (e == outBuff.length); if (BuildConfig.DEBUG && e != outBuff.length) throw new RuntimeException(); - // -- GODOT end -- + // -- REBEL end -- return outBuff; } From 11865be4a986974758b446099146b41c84c04877 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sat, 10 Jun 2023 14:50:44 +1200 Subject: [PATCH 08/41] Update Java Native Interface method names --- platform/android/api/api.cpp | 2 +- platform/android/java_godot_lib_jni.cpp | 62 ++++++++++---------- platform/android/java_godot_lib_jni.h | 62 ++++++++++---------- platform/android/plugin/godot_plugin_jni.cpp | 10 ++-- platform/android/plugin/godot_plugin_jni.h | 10 ++-- 5 files changed, 73 insertions(+), 73 deletions(-) diff --git a/platform/android/api/api.cpp b/platform/android/api/api.cpp index 07eaa2b8be..ac58691bde 100644 --- a/platform/android/api/api.cpp +++ b/platform/android/api/api.cpp @@ -42,7 +42,7 @@ void register_android_api() { #if !defined(ANDROID_ENABLED) // On Android platforms, the `java_class_wrapper` instantiation and the // `JNISingleton` registration occurs in - // `platform/android/java_godot_lib_jni.cpp#Java_org_godotengine_godot_GodotLib_setup` + // `platform/android/java_godot_lib_jni.cpp#Java_com_rebeltoolbox_rebelengine_GodotLib_setup` java_class_wrapper = memnew(JavaClassWrapper); // Dummy ClassDB::register_class(); #endif diff --git a/platform/android/java_godot_lib_jni.cpp b/platform/android/java_godot_lib_jni.cpp index 92c9edad4a..cd15fbbba3 100644 --- a/platform/android/java_godot_lib_jni.cpp +++ b/platform/android/java_godot_lib_jni.cpp @@ -113,13 +113,13 @@ static void _initialize_java_modules() { extern "C" { -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_setVirtualKeyboardHeight(JNIEnv *env, jclass clazz, jint p_height) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_setVirtualKeyboardHeight(JNIEnv *env, jclass clazz, jint p_height) { if (godot_io_java) { godot_io_java->set_vk_height(p_height); } } -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *env, jclass clazz, jobject activity, jobject godot_instance, jobject p_asset_manager, jboolean p_use_apk_expansion) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_initialize(JNIEnv *env, jclass clazz, jobject activity, jobject godot_instance, jobject p_asset_manager, jboolean p_use_apk_expansion) { initialized = true; JavaVM *jvm; @@ -146,7 +146,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *en godot_java->on_video_init(env); } -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_ondestroy(JNIEnv *env, jclass clazz) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_ondestroy(JNIEnv *env, jclass clazz) { // lets cleanup if (godot_io_java) { delete godot_io_java; @@ -162,7 +162,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_ondestroy(JNIEnv *env } } -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_setup(JNIEnv *env, jclass clazz, jobjectArray p_cmdline) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_setup(JNIEnv *env, jclass clazz, jobjectArray p_cmdline) { setup_android_thread(); const char **cmdline = NULL; @@ -207,12 +207,12 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_setup(JNIEnv *env, jc _initialize_java_modules(); } -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_resize(JNIEnv *env, jclass clazz, jint width, jint height) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_resize(JNIEnv *env, jclass clazz, jint width, jint height) { if (os_android) os_android->set_display_size(Size2(width, height)); } -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_newcontext(JNIEnv *env, jclass clazz, jboolean p_32_bits) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_newcontext(JNIEnv *env, jclass clazz, jboolean p_32_bits) { if (os_android) { if (step.get() == 0) { // During startup @@ -226,7 +226,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_newcontext(JNIEnv *en } } -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_back(JNIEnv *env, jclass clazz) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_back(JNIEnv *env, jclass clazz) { if (step.get() == 0) return; @@ -235,7 +235,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_back(JNIEnv *env, jcl } } -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv *env, jclass clazz) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_step(JNIEnv *env, jclass clazz) { if (step.get() == -1) return; @@ -291,22 +291,22 @@ void touch_preprocessing(JNIEnv *env, jclass clazz, jint input_device, jint ev, } // Called on the UI thread -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_touch__IIII_3F(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray position) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_touch__IIII_3F(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray position) { touch_preprocessing(env, clazz, input_device, ev, pointer, pointer_count, position); } // Called on the UI thread -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_touch__IIII_3FI(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray position, jint buttons_mask) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_touch__IIII_3FI(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray position, jint buttons_mask) { touch_preprocessing(env, clazz, input_device, ev, pointer, pointer_count, position, buttons_mask); } // Called on the UI thread -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_touch__IIII_3FIFF(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray position, jint buttons_mask, jfloat vertical_factor, jfloat horizontal_factor) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_touch__IIII_3FIFF(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray position, jint buttons_mask, jfloat vertical_factor, jfloat horizontal_factor) { touch_preprocessing(env, clazz, input_device, ev, pointer, pointer_count, position, buttons_mask, vertical_factor, horizontal_factor); } // Called on the UI thread -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_hover(JNIEnv *env, jclass clazz, jint p_type, jfloat p_x, jfloat p_y) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_hover(JNIEnv *env, jclass clazz, jint p_type, jfloat p_x, jfloat p_y) { if (step.get() <= 0) return; @@ -314,7 +314,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_hover(JNIEnv *env, jc } // Called on the UI thread -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_doubleTap(JNIEnv *env, jclass clazz, jint p_button_mask, jint p_x, jint p_y) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_doubleTap(JNIEnv *env, jclass clazz, jint p_button_mask, jint p_x, jint p_y) { if (step.get() <= 0) return; @@ -322,7 +322,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_doubleTap(JNIEnv *env } // Called on the UI thread -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_scroll(JNIEnv *env, jclass clazz, jint p_x, jint p_y) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_scroll(JNIEnv *env, jclass clazz, jint p_x, jint p_y) { if (step.get() <= 0) return; @@ -330,7 +330,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_scroll(JNIEnv *env, j } // Called on the UI thread -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joybutton(JNIEnv *env, jclass clazz, jint p_device, jint p_button, jboolean p_pressed) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_joybutton(JNIEnv *env, jclass clazz, jint p_device, jint p_button, jboolean p_pressed) { if (step.get() <= 0) return; @@ -344,7 +344,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joybutton(JNIEnv *env } // Called on the UI thread -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joyaxis(JNIEnv *env, jclass clazz, jint p_device, jint p_axis, jfloat p_value) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_joyaxis(JNIEnv *env, jclass clazz, jint p_device, jint p_axis, jfloat p_value) { if (step.get() <= 0) return; @@ -358,7 +358,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joyaxis(JNIEnv *env, } // Called on the UI thread -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joyhat(JNIEnv *env, jclass clazz, jint p_device, jint p_hat_x, jint p_hat_y) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_joyhat(JNIEnv *env, jclass clazz, jint p_device, jint p_hat_x, jint p_hat_y) { if (step.get() <= 0) return; @@ -384,7 +384,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joyhat(JNIEnv *env, j } // Called on the UI thread -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joyconnectionchanged(JNIEnv *env, jclass clazz, jint p_device, jboolean p_connected, jstring p_name) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_joyconnectionchanged(JNIEnv *env, jclass clazz, jint p_device, jboolean p_connected, jstring p_name) { if (step.get() <= 0) return; @@ -393,50 +393,50 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joyconnectionchanged( } // Called on the UI thread -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_key(JNIEnv *env, jclass clazz, jint p_keycode, jint p_scancode, jint p_unicode_char, jboolean p_pressed) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_key(JNIEnv *env, jclass clazz, jint p_keycode, jint p_scancode, jint p_unicode_char, jboolean p_pressed) { if (step.get() <= 0) return; input_handler->process_key_event(p_keycode, p_scancode, p_unicode_char, p_pressed); } -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_accelerometer(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_accelerometer(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z) { accelerometer = Vector3(x, y, z); } -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_gravity(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_gravity(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z) { gravity = Vector3(x, y, z); } -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_magnetometer(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_magnetometer(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z) { magnetometer = Vector3(x, y, z); } -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_gyroscope(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_gyroscope(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z) { gyroscope = Vector3(x, y, z); } -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_focusin(JNIEnv *env, jclass clazz) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_focusin(JNIEnv *env, jclass clazz) { if (step.get() <= 0) return; os_android->main_loop_focusin(); } -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_focusout(JNIEnv *env, jclass clazz) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_focusout(JNIEnv *env, jclass clazz) { if (step.get() <= 0) return; os_android->main_loop_focusout(); } -JNIEXPORT jstring JNICALL Java_org_godotengine_godot_GodotLib_getGlobal(JNIEnv *env, jclass clazz, jstring path) { +JNIEXPORT jstring JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_getGlobal(JNIEnv *env, jclass clazz, jstring path) { String js = jstring_to_string(path, env); return env->NewStringUTF(ProjectSettings::get_singleton()->get(js).operator String().utf8().get_data()); } -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_callobject(JNIEnv *env, jclass clazz, jlong ID, jstring method, jobjectArray params) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_callobject(JNIEnv *env, jclass clazz, jlong ID, jstring method, jobjectArray params) { Object *obj = ObjectDB::get_instance(ID); ERR_FAIL_COND(!obj); @@ -466,7 +466,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_callobject(JNIEnv *en env->PopLocalFrame(NULL); } -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_calldeferred(JNIEnv *env, jclass clazz, jlong ID, jstring method, jobjectArray params) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_calldeferred(JNIEnv *env, jclass clazz, jlong ID, jstring method, jobjectArray params) { Object *obj = ObjectDB::get_instance(ID); ERR_FAIL_COND(!obj); @@ -490,7 +490,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_calldeferred(JNIEnv * env->PopLocalFrame(NULL); } -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_requestPermissionResult(JNIEnv *env, jclass clazz, jstring p_permission, jboolean p_result) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_requestPermissionResult(JNIEnv *env, jclass clazz, jstring p_permission, jboolean p_result) { String permission = jstring_to_string(p_permission, env); if (permission == "android.permission.RECORD_AUDIO" && p_result) { AudioDriver::get_singleton()->capture_start(); @@ -501,7 +501,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_requestPermissionResu } } -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_onRendererResumed(JNIEnv *env, jclass clazz) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_onRendererResumed(JNIEnv *env, jclass clazz) { if (step.get() <= 0) return; @@ -510,7 +510,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_onRendererResumed(JNI } } -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_onRendererPaused(JNIEnv *env, jclass clazz) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_onRendererPaused(JNIEnv *env, jclass clazz) { if (step.get() <= 0) return; diff --git a/platform/android/java_godot_lib_jni.h b/platform/android/java_godot_lib_jni.h index 0fef9cf98b..1f15b817ae 100644 --- a/platform/android/java_godot_lib_jni.h +++ b/platform/android/java_godot_lib_jni.h @@ -37,38 +37,38 @@ // These functions can be called from within JAVA and are the means by which our JAVA implementation calls back into our C++ code. // See java/lib/src/com/rebeltoolbox/rebelengine/GodotLib.java for the JAVA side of this (yes that's why we have the long names) extern "C" { -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *env, jclass clazz, jobject activity, jobject godot_instance, jobject p_asset_manager, jboolean p_use_apk_expansion); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_ondestroy(JNIEnv *env, jclass clazz); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_setup(JNIEnv *env, jclass clazz, jobjectArray p_cmdline); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_resize(JNIEnv *env, jclass clazz, jint width, jint height); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_newcontext(JNIEnv *env, jclass clazz, jboolean p_32_bits); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv *env, jclass clazz); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_back(JNIEnv *env, jclass clazz); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_initialize(JNIEnv *env, jclass clazz, jobject activity, jobject godot_instance, jobject p_asset_manager, jboolean p_use_apk_expansion); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_ondestroy(JNIEnv *env, jclass clazz); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_setup(JNIEnv *env, jclass clazz, jobjectArray p_cmdline); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_resize(JNIEnv *env, jclass clazz, jint width, jint height); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_newcontext(JNIEnv *env, jclass clazz, jboolean p_32_bits); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_step(JNIEnv *env, jclass clazz); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_back(JNIEnv *env, jclass clazz); void touch_preprocessing(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray positions, jint buttons_mask = 0, jfloat vertical_factor = 0, jfloat horizontal_factor = 0); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_touch__IIII_3F(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray positions); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_touch__IIII_3FI(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray positions, jint buttons_mask); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_touch__IIII_3FIFF(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray positions, jint buttons_mask, jfloat vertical_factor, jfloat horizontal_factor); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_hover(JNIEnv *env, jclass clazz, jint p_type, jfloat p_x, jfloat p_y); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_doubleTap(JNIEnv *env, jclass clazz, jint p_button_mask, jint p_x, jint p_y); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_scroll(JNIEnv *env, jclass clazz, jint p_x, jint p_y); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_key(JNIEnv *env, jclass clazz, jint p_keycode, jint p_scancode, jint p_unicode_char, jboolean p_pressed); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joybutton(JNIEnv *env, jclass clazz, jint p_device, jint p_button, jboolean p_pressed); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joyaxis(JNIEnv *env, jclass clazz, jint p_device, jint p_axis, jfloat p_value); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joyhat(JNIEnv *env, jclass clazz, jint p_device, jint p_hat_x, jint p_hat_y); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joyconnectionchanged(JNIEnv *env, jclass clazz, jint p_device, jboolean p_connected, jstring p_name); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_accelerometer(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_gravity(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_magnetometer(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_gyroscope(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_focusin(JNIEnv *env, jclass clazz); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_focusout(JNIEnv *env, jclass clazz); -JNIEXPORT jstring JNICALL Java_org_godotengine_godot_GodotLib_getGlobal(JNIEnv *env, jclass clazz, jstring path); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_callobject(JNIEnv *env, jclass clazz, jlong ID, jstring method, jobjectArray params); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_calldeferred(JNIEnv *env, jclass clazz, jlong ID, jstring method, jobjectArray params); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_setVirtualKeyboardHeight(JNIEnv *env, jclass clazz, jint p_height); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_requestPermissionResult(JNIEnv *env, jclass clazz, jstring p_permission, jboolean p_result); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_onRendererResumed(JNIEnv *env, jclass clazz); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_onRendererPaused(JNIEnv *env, jclass clazz); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_touch__IIII_3F(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray positions); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_touch__IIII_3FI(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray positions, jint buttons_mask); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_touch__IIII_3FIFF(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray positions, jint buttons_mask, jfloat vertical_factor, jfloat horizontal_factor); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_hover(JNIEnv *env, jclass clazz, jint p_type, jfloat p_x, jfloat p_y); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_doubleTap(JNIEnv *env, jclass clazz, jint p_button_mask, jint p_x, jint p_y); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_scroll(JNIEnv *env, jclass clazz, jint p_x, jint p_y); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_key(JNIEnv *env, jclass clazz, jint p_keycode, jint p_scancode, jint p_unicode_char, jboolean p_pressed); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_joybutton(JNIEnv *env, jclass clazz, jint p_device, jint p_button, jboolean p_pressed); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_joyaxis(JNIEnv *env, jclass clazz, jint p_device, jint p_axis, jfloat p_value); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_joyhat(JNIEnv *env, jclass clazz, jint p_device, jint p_hat_x, jint p_hat_y); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_joyconnectionchanged(JNIEnv *env, jclass clazz, jint p_device, jboolean p_connected, jstring p_name); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_accelerometer(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_gravity(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_magnetometer(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_gyroscope(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_focusin(JNIEnv *env, jclass clazz); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_focusout(JNIEnv *env, jclass clazz); +JNIEXPORT jstring JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_getGlobal(JNIEnv *env, jclass clazz, jstring path); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_callobject(JNIEnv *env, jclass clazz, jlong ID, jstring method, jobjectArray params); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_calldeferred(JNIEnv *env, jclass clazz, jlong ID, jstring method, jobjectArray params); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_setVirtualKeyboardHeight(JNIEnv *env, jclass clazz, jint p_height); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_requestPermissionResult(JNIEnv *env, jclass clazz, jstring p_permission, jboolean p_result); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_onRendererResumed(JNIEnv *env, jclass clazz); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_onRendererPaused(JNIEnv *env, jclass clazz); } #endif /* !JAVA_GODOT_LIB_JNI_H */ diff --git a/platform/android/plugin/godot_plugin_jni.cpp b/platform/android/plugin/godot_plugin_jni.cpp index 0dba8eb575..c4ed879bcf 100644 --- a/platform/android/plugin/godot_plugin_jni.cpp +++ b/platform/android/plugin/godot_plugin_jni.cpp @@ -41,7 +41,7 @@ static HashMap jni_singletons; extern "C" { -JNIEXPORT void JNICALL Java_org_godotengine_godot_plugin_GodotPlugin_nativeRegisterSingleton(JNIEnv *env, jclass clazz, jstring name, jobject obj) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nativeRegisterSingleton(JNIEnv *env, jclass clazz, jstring name, jobject obj) { String singname = jstring_to_string(name, env); JNISingleton *s = (JNISingleton *)ClassDB::instance("JNISingleton"); s->set_instance(env->NewGlobalRef(obj)); @@ -51,7 +51,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_plugin_GodotPlugin_nativeRegis ProjectSettings::get_singleton()->set(singname, s); } -JNIEXPORT void JNICALL Java_org_godotengine_godot_plugin_GodotPlugin_nativeRegisterMethod(JNIEnv *env, jclass clazz, jstring sname, jstring name, jstring ret, jobjectArray args) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nativeRegisterMethod(JNIEnv *env, jclass clazz, jstring sname, jstring name, jstring ret, jobjectArray args) { String singname = jstring_to_string(sname, env); ERR_FAIL_COND(!jni_singletons.has(singname)); @@ -83,7 +83,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_plugin_GodotPlugin_nativeRegis s->add_method(mname, mid, types, get_jni_type(retval)); } -JNIEXPORT void JNICALL Java_org_godotengine_godot_plugin_GodotPlugin_nativeRegisterSignal(JNIEnv *env, jclass clazz, jstring j_plugin_name, jstring j_signal_name, jobjectArray j_signal_param_types) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nativeRegisterSignal(JNIEnv *env, jclass clazz, jstring j_plugin_name, jstring j_signal_name, jobjectArray j_signal_param_types) { String singleton_name = jstring_to_string(j_plugin_name, env); ERR_FAIL_COND(!jni_singletons.has(singleton_name)); @@ -104,7 +104,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_plugin_GodotPlugin_nativeRegis singleton->add_signal(signal_name, types); } -JNIEXPORT void JNICALL Java_org_godotengine_godot_plugin_GodotPlugin_nativeEmitSignal(JNIEnv *env, jclass clazz, jstring j_plugin_name, jstring j_signal_name, jobjectArray j_signal_params) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nativeEmitSignal(JNIEnv *env, jclass clazz, jstring j_plugin_name, jstring j_signal_name, jobjectArray j_signal_params) { String singleton_name = jstring_to_string(j_plugin_name, env); ERR_FAIL_COND(!jni_singletons.has(singleton_name)); @@ -129,7 +129,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_plugin_GodotPlugin_nativeEmitS singleton->emit_signal(signal_name, args, count); } -JNIEXPORT void JNICALL Java_org_godotengine_godot_plugin_GodotPlugin_nativeRegisterGDNativeLibraries(JNIEnv *env, jclass clazz, jobjectArray gdnlib_paths) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nativeRegisterGDNativeLibraries(JNIEnv *env, jclass clazz, jobjectArray gdnlib_paths) { int gdnlib_count = env->GetArrayLength(gdnlib_paths); if (gdnlib_count == 0) { return; diff --git a/platform/android/plugin/godot_plugin_jni.h b/platform/android/plugin/godot_plugin_jni.h index 829a8c9fbb..332c79404a 100644 --- a/platform/android/plugin/godot_plugin_jni.h +++ b/platform/android/plugin/godot_plugin_jni.h @@ -35,11 +35,11 @@ #include extern "C" { -JNIEXPORT void JNICALL Java_org_godotengine_godot_plugin_GodotPlugin_nativeRegisterSingleton(JNIEnv *env, jclass clazz, jstring name, jobject obj); -JNIEXPORT void JNICALL Java_org_godotengine_godot_plugin_GodotPlugin_nativeRegisterMethod(JNIEnv *env, jclass clazz, jstring sname, jstring name, jstring ret, jobjectArray args); -JNIEXPORT void JNICALL Java_org_godotengine_godot_plugin_GodotPlugin_nativeRegisterSignal(JNIEnv *env, jclass clazz, jstring j_plugin_name, jstring j_signal_name, jobjectArray j_signal_param_types); -JNIEXPORT void JNICALL Java_org_godotengine_godot_plugin_GodotPlugin_nativeEmitSignal(JNIEnv *env, jclass clazz, jstring j_plugin_name, jstring j_signal_name, jobjectArray j_signal_params); -JNIEXPORT void JNICALL Java_org_godotengine_godot_plugin_GodotPlugin_nativeRegisterGDNativeLibraries(JNIEnv *env, jclass clazz, jobjectArray gdnlib_paths); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nativeRegisterSingleton(JNIEnv *env, jclass clazz, jstring name, jobject obj); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nativeRegisterMethod(JNIEnv *env, jclass clazz, jstring sname, jstring name, jstring ret, jobjectArray args); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nativeRegisterSignal(JNIEnv *env, jclass clazz, jstring j_plugin_name, jstring j_signal_name, jobjectArray j_signal_param_types); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nativeEmitSignal(JNIEnv *env, jclass clazz, jstring j_plugin_name, jstring j_signal_name, jobjectArray j_signal_params); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nativeRegisterGDNativeLibraries(JNIEnv *env, jclass clazz, jobjectArray gdnlib_paths); } #endif // GODOT_PLUGIN_JNI_H From eca15c4f75ff2fc8852bda57d72a6af9f9c6411a Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Fri, 23 Jun 2023 15:04:00 +1200 Subject: [PATCH 09/41] Rename GodotApp to RebelApp --- platform/android/export/export_plugin.cpp | 2 +- platform/android/export/gradle_export_util.cpp | 2 +- platform/android/java/app/AndroidManifest.xml | 2 +- .../rebeltoolbox/rebelapp/{GodotApp.java => RebelApp.java} | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) rename platform/android/java/app/src/com/rebeltoolbox/rebelapp/{GodotApp.java => RebelApp.java} (93%) diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index 12ed05090f..f467ada381 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -1985,7 +1985,7 @@ Error EditorExportPlatformAndroid::run(const Ref &p_preset, args.push_back("-a"); args.push_back("android.intent.action.MAIN"); args.push_back("-n"); - args.push_back(get_package_name(package_name) + "/com.rebeltoolbox.rebelapp.GodotApp"); + args.push_back(get_package_name(package_name) + "/com.rebeltoolbox.rebelapp.RebelApp"); output.clear(); err = OS::get_singleton()->execute(adb, args, true, nullptr, &output, &rv, true); diff --git a/platform/android/export/gradle_export_util.cpp b/platform/android/export/gradle_export_util.cpp index c26758f379..947652113a 100644 --- a/platform/android/export/gradle_export_util.cpp +++ b/platform/android/export/gradle_export_util.cpp @@ -252,7 +252,7 @@ String _get_activity_tag(const Ref &p_preset) { String orientation = _get_android_orientation_label( OS::get_singleton()->get_screen_orientation_from_string(GLOBAL_GET("display/window/handheld/orientation"))); String manifest_activity_text = vformat( - " \n", diff --git a/platform/android/java/app/AndroidManifest.xml b/platform/android/java/app/AndroidManifest.xml index dbe8215af0..f311599eeb 100644 --- a/platform/android/java/app/AndroidManifest.xml +++ b/platform/android/java/app/AndroidManifest.xml @@ -64,7 +64,7 @@ android:value="all" /> Date: Fri, 23 Jun 2023 15:04:31 +1200 Subject: [PATCH 10/41] Rename Godot to RebelFragment --- .../rebelengine/FullScreenGodotApp.java | 56 +++++++++---------- .../rebeltoolbox/rebelengine/GodotHost.java | 6 +- .../rebeltoolbox/rebelengine/GodotLib.java | 2 +- .../rebelengine/GodotRenderer.java | 8 +-- .../rebeltoolbox/rebelengine/GodotView.java | 8 +-- .../{Godot.java => RebelFragment.java} | 12 ++-- .../rebelengine/plugin/GodotPlugin.java | 28 +++++----- .../plugin/GodotPluginRegistry.java | 22 ++++---- platform/android/java_godot_wrapper.cpp | 52 ++++++++--------- platform/android/java_godot_wrapper.h | 4 +- 10 files changed, 97 insertions(+), 101 deletions(-) rename platform/android/java/lib/src/com/rebeltoolbox/rebelengine/{Godot.java => RebelFragment.java} (98%) diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/FullScreenGodotApp.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/FullScreenGodotApp.java index 25a7767189..f6bc9fbe68 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/FullScreenGodotApp.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/FullScreenGodotApp.java @@ -42,16 +42,15 @@ import androidx.fragment.app.FragmentActivity; /** - * Base activity for Android apps intending to use Godot as the primary and only screen. - * - * It's also a reference implementation for how to setup and use the {@link Godot} fragment + * Base activity for Android apps intending to use a Rebel Game as the primary and only screen. + * It's also a reference implementation for how to setup and use the {@link RebelFragment} * within an Android app. */ public abstract class FullScreenGodotApp extends FragmentActivity implements GodotHost { private static final String TAG = FullScreenGodotApp.class.getSimpleName(); @Nullable - private Godot godotFragment; + private RebelFragment rebelFragment; @Override public void onCreate(Bundle savedInstanceState) { @@ -59,36 +58,33 @@ public void onCreate(Bundle savedInstanceState) { setContentView(R.layout.godot_app_layout); Fragment currentFragment = getSupportFragmentManager().findFragmentById(R.id.godot_fragment_container); - if (currentFragment instanceof Godot) { - Log.v(TAG, "Reusing existing Godot fragment instance."); - godotFragment = (Godot)currentFragment; + if (currentFragment instanceof RebelFragment) { + Log.v(TAG, "Reusing existing Rebel Fragment."); + rebelFragment = (RebelFragment)currentFragment; } else { - Log.v(TAG, "Creating new Godot fragment instance."); - godotFragment = initGodotInstance(); - if (godotFragment == null) { - throw new IllegalStateException("Godot instance must be non-null."); - } + Log.v(TAG, "Creating new Rebel Fragment."); + rebelFragment = createRebelFragment(); - getSupportFragmentManager().beginTransaction().replace(R.id.godot_fragment_container, godotFragment).setPrimaryNavigationFragment(godotFragment).commitNowAllowingStateLoss(); + getSupportFragmentManager().beginTransaction().replace(R.id.godot_fragment_container, rebelFragment).setPrimaryNavigationFragment(rebelFragment).commitNowAllowingStateLoss(); } } @Override public void onDestroy() { super.onDestroy(); - onGodotForceQuit(godotFragment); + onGodotForceQuit(rebelFragment); } @Override - public final void onGodotForceQuit(Godot instance) { - if (instance == godotFragment) { + public final void onGodotForceQuit(RebelFragment quitFragment) { + if (rebelFragment == quitFragment) { System.exit(0); } } @Override - public final void onGodotRestartRequested(Godot instance) { - if (instance == godotFragment) { + public final void onGodotRestartRequested(RebelFragment restartFragment) { + if (rebelFragment == restartFragment) { // HACK: // // Currently it's very hard to properly deinitialize Godot on Android to restart the game @@ -109,8 +105,8 @@ public final void onGodotRestartRequested(Godot instance) { @Override public void onNewIntent(Intent intent) { super.onNewIntent(intent); - if (godotFragment != null) { - godotFragment.onNewIntent(intent); + if (rebelFragment != null) { + rebelFragment.onNewIntent(intent); } } @@ -118,8 +114,8 @@ public void onNewIntent(Intent intent) { @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); - if (godotFragment != null) { - godotFragment.onActivityResult(requestCode, resultCode, data); + if (rebelFragment != null) { + rebelFragment.onActivityResult(requestCode, resultCode, data); } } @@ -127,15 +123,15 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { @Override public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); - if (godotFragment != null) { - godotFragment.onRequestPermissionsResult(requestCode, permissions, grantResults); + if (rebelFragment != null) { + rebelFragment.onRequestPermissionsResult(requestCode, permissions, grantResults); } } @Override public void onBackPressed() { - if (godotFragment != null) { - godotFragment.onBackPressed(); + if (rebelFragment != null) { + rebelFragment.onBackPressed(); } else { super.onBackPressed(); } @@ -145,12 +141,12 @@ public void onBackPressed() { * Used to initialize the Godot fragment instance in {@link FullScreenGodotApp#onCreate(Bundle)}. */ @NonNull - protected Godot initGodotInstance() { - return new Godot(); + protected RebelFragment createRebelFragment() { + return new RebelFragment(); } @Nullable - protected final Godot getGodotFragment() { - return godotFragment; + protected final RebelFragment getRebelFragment() { + return rebelFragment; } } diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotHost.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotHost.java index fa36a43365..73a9629e2e 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotHost.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotHost.java @@ -34,7 +34,7 @@ import java.util.List; /** - * Denotate a component (e.g: Activity, Fragment) that hosts the {@link Godot} fragment. + * Denotes a component (e.g: Activity, Fragment) that hosts the {@link RebelFragment} fragment. */ public interface GodotHost { /** @@ -57,11 +57,11 @@ default void onGodotMainLoopStarted() {} /** * Invoked on the UI thread as the last step of the Godot instance clean up phase. */ - default void onGodotForceQuit(Godot instance) {} + default void onGodotForceQuit(RebelFragment quitFragment) {} /** * Invoked on the GL thread when the Godot instance wants to be restarted. It's up to the host * to perform the appropriate action(s). */ - default void onGodotRestartRequested(Godot instance) {} + default void onGodotRestartRequested(RebelFragment restartFragment) {} } diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotLib.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotLib.java index bf960c880e..cddc7df83c 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotLib.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotLib.java @@ -48,7 +48,7 @@ public class GodotLib { /** * Invoked on the main thread to initialize Godot native layer. */ - public static native void initialize(Activity activity, Godot p_instance, Object p_asset_manager, boolean use_apk_expansion); + public static native void initialize(Activity activity, RebelFragment p_instance, Object p_asset_manager, boolean use_apk_expansion); /** * Invoked on the main thread to clean up Godot native layer. diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotRenderer.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotRenderer.java index b7df866c78..ec57cdb1be 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotRenderer.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotRenderer.java @@ -57,8 +57,8 @@ public void onDrawFrame(GL10 gl) { } GodotLib.step(); - for (int i = 0; i < Godot.singleton_count; i++) { - Godot.singletons[i].onGLDrawFrame(gl); + for (int i = 0; i < RebelFragment.singleton_count; i++) { + RebelFragment.singletons[i].onGLDrawFrame(gl); } for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) { plugin.onGLDrawFrame(gl); @@ -67,8 +67,8 @@ public void onDrawFrame(GL10 gl) { public void onSurfaceChanged(GL10 gl, int width, int height) { GodotLib.resize(width, height); - for (int i = 0; i < Godot.singleton_count; i++) { - Godot.singletons[i].onGLSurfaceChanged(gl, width, height); + for (int i = 0; i < RebelFragment.singleton_count; i++) { + RebelFragment.singletons[i].onGLSurfaceChanged(gl, width, height); } for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) { plugin.onGLSurfaceChanged(gl, width, height); diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotView.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotView.java index 7bbba5db73..674dbf107c 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotView.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotView.java @@ -70,19 +70,19 @@ public class GodotView extends GLSurfaceView { private static String TAG = GodotView.class.getSimpleName(); - private final Godot godot; + private final RebelFragment rebelFragment; private final GodotInputHandler inputHandler; private final GestureDetector detector; private final GodotRenderer godotRenderer; - public GodotView(Context context, Godot godot, XRMode xrMode, boolean p_use_gl3, + public GodotView(Context context, RebelFragment rebelFragment, XRMode xrMode, boolean p_use_gl3, boolean p_use_32_bits, boolean p_use_debug_opengl, boolean p_translucent) { super(context); GLUtils.use_gl3 = p_use_gl3; GLUtils.use_32 = p_use_32_bits; GLUtils.use_debug_opengl = p_use_debug_opengl; - this.godot = godot; + this.rebelFragment = rebelFragment; this.inputHandler = new GodotInputHandler(this); this.detector = new GestureDetector(context, new GodotGestureHandler(this)); this.godotRenderer = new GodotRenderer(); @@ -176,7 +176,7 @@ private void init(XRMode xrMode, boolean translucent, int depth, int stencil) { } public void onBackPressed() { - godot.onBackPressed(); + rebelFragment.onBackPressed(); } public GodotInputHandler getInputHandler() { diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/Godot.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java similarity index 98% rename from platform/android/java/lib/src/com/rebeltoolbox/rebelengine/Godot.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java index bdde7b22ff..e50cc8ed76 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/Godot.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java @@ -1,5 +1,5 @@ /*************************************************************************/ -/* Godot.java */ +/* RebelFragment.java */ /*************************************************************************/ /* This file is part of: */ /* REBEL ENGINE */ @@ -47,7 +47,6 @@ import android.app.PendingIntent; import android.content.ClipData; import android.content.ClipboardManager; -import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; @@ -109,7 +108,7 @@ import javax.microedition.khronos.opengles.GL10; -public class Godot extends Fragment implements SensorEventListener, IDownloaderClient { +public class RebelFragment extends Fragment implements SensorEventListener, IDownloaderClient { static final int MAX_SINGLETONS = 64; private IStub mDownloaderClientStub; private TextView mStatusText; @@ -195,7 +194,7 @@ protected void registerClass(String p_name, String[] p_methods) { GodotPlugin.nativeRegisterMethod(p_name, method.getName(), method.getReturnType().getName(), pt); } - Godot.singletons[Godot.singleton_count++] = this; + RebelFragment.singletons[RebelFragment.singleton_count++] = this; } /** @@ -946,8 +945,9 @@ public final void runOnUiThread(@NonNull Runnable action) { } private void forceQuit() { - // TODO: This is a temp solution. The proper fix will involve tracking down and properly shutting down each - // native Godot components that is started in Godot#onVideoInit. + // TODO: This is a temp solution. + // The proper fix will involve tracking down and properly shutting down each + // Rebel Engine component that is started in onVideoInit. if (godotHost != null) { godotHost.onGodotForceQuit(this); } diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPlugin.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPlugin.java index 8ad6f67f45..f112176f03 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPlugin.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPlugin.java @@ -31,7 +31,7 @@ package com.rebeltoolbox.rebelengine.plugin; import com.rebeltoolbox.rebelengine.BuildConfig; -import com.rebeltoolbox.rebelengine.Godot; +import com.rebeltoolbox.rebelengine.RebelFragment; import android.app.Activity; import android.content.Intent; @@ -81,18 +81,18 @@ public abstract class GodotPlugin { private static final String TAG = GodotPlugin.class.getSimpleName(); - private final Godot godot; + private final RebelFragment rebelFragment; private final ConcurrentHashMap registeredSignals = new ConcurrentHashMap<>(); - public GodotPlugin(Godot godot) { - this.godot = godot; + public GodotPlugin(RebelFragment rebelFragment) { + this.rebelFragment = rebelFragment; } /** - * Provides access to the Godot engine. + * Provides access to the Rebel Fragment. */ - protected Godot getGodot() { - return godot; + protected RebelFragment getRebelFragment() { + return rebelFragment; } /** @@ -100,7 +100,7 @@ protected Godot getGodot() { */ @Nullable protected Activity getActivity() { - return godot.getActivity(); + return rebelFragment.getActivity(); } /** @@ -315,7 +315,7 @@ public boolean shouldBeOnTop() { * @param action the action to run on the UI thread */ protected void runOnUiThread(Runnable action) { - godot.runOnUiThread(action); + rebelFragment.runOnUiThread(action); } /** @@ -324,7 +324,7 @@ protected void runOnUiThread(Runnable action) { * @param action the action to run on the render thread */ protected void runOnRenderThread(Runnable action) { - godot.runOnRenderThread(action); + rebelFragment.runOnRenderThread(action); } /** @@ -340,7 +340,7 @@ protected void emitSignal(final String signalName, final Object... signalArgs) { throw new IllegalArgumentException( "Signal " + signalName + " is not registered for this plugin."); } - emitSignal(getGodot(), getPluginName(), signalInfo, signalArgs); + emitSignal(getRebelFragment(), getPluginName(), signalInfo, signalArgs); } catch (IllegalArgumentException exception) { Log.w(TAG, exception.getMessage()); if (BuildConfig.DEBUG) { @@ -351,12 +351,12 @@ protected void emitSignal(final String signalName, final Object... signalArgs) { /** * Emit a Godot signal. - * @param godot + * @param rebelFragment * @param pluginName Name of the Godot plugin the signal will be emitted from. The plugin must already be registered with the Godot engine. * @param signalInfo Information about the signal to emit. * @param signalArgs Arguments used to populate the emitted signal. The arguments will be validated against the given {@link SignalInfo} parameter. */ - public static void emitSignal(Godot godot, String pluginName, SignalInfo signalInfo, final Object... signalArgs) { + public static void emitSignal(RebelFragment rebelFragment, String pluginName, SignalInfo signalInfo, final Object... signalArgs) { try { if (signalInfo == null) { throw new IllegalArgumentException("Signal must be non null."); @@ -377,7 +377,7 @@ public static void emitSignal(Godot godot, String pluginName, SignalInfo signalI } } - godot.runOnRenderThread(() -> nativeEmitSignal(pluginName, signalInfo.getName(), signalArgs)); + rebelFragment.runOnRenderThread(() -> nativeEmitSignal(pluginName, signalInfo.getName(), signalArgs)); } catch (IllegalArgumentException exception) { Log.w(TAG, exception.getMessage()); diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPluginRegistry.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPluginRegistry.java index 7a20019e0b..b99d8c8b25 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPluginRegistry.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPluginRegistry.java @@ -30,7 +30,7 @@ package com.rebeltoolbox.rebelengine.plugin; -import com.rebeltoolbox.rebelengine.Godot; +import com.rebeltoolbox.rebelengine.RebelFragment; import android.app.Activity; import android.content.pm.ApplicationInfo; @@ -57,9 +57,9 @@ public final class GodotPluginRegistry { private static GodotPluginRegistry instance; private final ConcurrentHashMap registry; - private GodotPluginRegistry(Godot godot) { + private GodotPluginRegistry(RebelFragment rebelFragment) { registry = new ConcurrentHashMap<>(); - loadPlugins(godot); + loadPlugins(rebelFragment); } /** @@ -85,13 +85,13 @@ public Collection getAllPlugins() { * A plugin manifest entry is a '' tag setup as described in the {@link GodotPlugin} * documentation. * - * @param godot Godot instance + * @param rebelFragment Rebel Fragment * @return A singleton instance of {@link GodotPluginRegistry}. This ensures that only one instance * of each Godot Android plugins is available at runtime. */ - public static GodotPluginRegistry initializePluginRegistry(Godot godot) { + public static GodotPluginRegistry initializePluginRegistry(RebelFragment rebelFragment) { if (instance == null) { - instance = new GodotPluginRegistry(godot); + instance = new GodotPluginRegistry(rebelFragment); } return instance; @@ -101,7 +101,7 @@ public static GodotPluginRegistry initializePluginRegistry(Godot godot) { * Return the plugin registry if it's initialized. * Throws a {@link IllegalStateException} exception if not. * - * @throws IllegalStateException if {@link GodotPluginRegistry#initializePluginRegistry(Godot)} has not been called prior to calling this method. + * @throws IllegalStateException if {@link GodotPluginRegistry#initializePluginRegistry(RebelFragment)} has not been called prior to calling this method. */ public static GodotPluginRegistry getPluginRegistry() throws IllegalStateException { if (instance == null) { @@ -111,9 +111,9 @@ public static GodotPluginRegistry getPluginRegistry() throws IllegalStateExcepti return instance; } - private void loadPlugins(Godot godot) { + private void loadPlugins(RebelFragment rebelFragment) { try { - final Activity activity = godot.getActivity(); + final Activity activity = rebelFragment.getActivity(); ApplicationInfo appInfo = activity .getPackageManager() .getApplicationInfo(activity.getPackageName(), @@ -139,8 +139,8 @@ private void loadPlugins(Godot godot) { Class pluginClass = (Class)Class .forName(pluginHandleClassFullName); Constructor pluginConstructor = pluginClass - .getConstructor(Godot.class); - GodotPlugin pluginHandle = pluginConstructor.newInstance(godot); + .getConstructor(RebelFragment.class); + GodotPlugin pluginHandle = pluginConstructor.newInstance(rebelFragment); // Load the plugin initializer into the registry using the plugin name as key. if (!pluginName.equals(pluginHandle.getPluginName())) { diff --git a/platform/android/java_godot_wrapper.cpp b/platform/android/java_godot_wrapper.cpp index f6943af399..e5d647b40b 100644 --- a/platform/android/java_godot_wrapper.cpp +++ b/platform/android/java_godot_wrapper.cpp @@ -32,7 +32,7 @@ // JNIEnv is only valid within the thread it belongs to, in a multi threading environment // we can't cache it. -// For Godot we call most access methods from our thread and we thus get a valid JNIEnv +// For RebelFragment we call most access methods from our thread and we thus get a valid JNIEnv // from ThreadAndroid. For one or two we expect to pass the environment // TODO we could probably create a base class for this... @@ -41,10 +41,10 @@ GodotJavaWrapper::GodotJavaWrapper(JNIEnv *p_env, jobject p_activity, jobject p_ godot_instance = p_env->NewGlobalRef(p_godot_instance); activity = p_env->NewGlobalRef(p_activity); - // get info about our Godot class so we can get pointers and stuff... - godot_class = p_env->FindClass("com/rebeltoolbox/rebelengine/Godot"); - if (godot_class) { - godot_class = (jclass)p_env->NewGlobalRef(godot_class); + // Get the RebelFragment class that contains all the java methods that are called + java_method_class = p_env->FindClass("com/rebeltoolbox/rebelengine/RebelFragment"); + if (java_method_class) { + java_method_class = (jclass)p_env->NewGlobalRef(java_method_class); } else { // this is a pretty serious fail.. bail... pointers will stay 0 return; @@ -58,24 +58,24 @@ GodotJavaWrapper::GodotJavaWrapper(JNIEnv *p_env, jobject p_activity, jobject p_ } // get some Godot method pointers... - _on_video_init = p_env->GetMethodID(godot_class, "onVideoInit", "()V"); - _restart = p_env->GetMethodID(godot_class, "restart", "()V"); - _finish = p_env->GetMethodID(godot_class, "forceQuit", "()V"); - _set_keep_screen_on = p_env->GetMethodID(godot_class, "setKeepScreenOn", "(Z)V"); - _alert = p_env->GetMethodID(godot_class, "alert", "(Ljava/lang/String;Ljava/lang/String;)V"); - _get_GLES_version_code = p_env->GetMethodID(godot_class, "getGLESVersionCode", "()I"); - _get_clipboard = p_env->GetMethodID(godot_class, "getClipboard", "()Ljava/lang/String;"); - _set_clipboard = p_env->GetMethodID(godot_class, "setClipboard", "(Ljava/lang/String;)V"); - _request_permission = p_env->GetMethodID(godot_class, "requestPermission", "(Ljava/lang/String;)Z"); - _request_permissions = p_env->GetMethodID(godot_class, "requestPermissions", "()Z"); - _get_granted_permissions = p_env->GetMethodID(godot_class, "getGrantedPermissions", "()[Ljava/lang/String;"); - _init_input_devices = p_env->GetMethodID(godot_class, "initInputDevices", "()V"); - _get_surface = p_env->GetMethodID(godot_class, "getSurface", "()Landroid/view/Surface;"); - _is_activity_resumed = p_env->GetMethodID(godot_class, "isActivityResumed", "()Z"); - _vibrate = p_env->GetMethodID(godot_class, "vibrate", "(I)V"); - _get_input_fallback_mapping = p_env->GetMethodID(godot_class, "getInputFallbackMapping", "()Ljava/lang/String;"); - _on_godot_setup_completed = p_env->GetMethodID(godot_class, "onGodotSetupCompleted", "()V"); - _on_godot_main_loop_started = p_env->GetMethodID(godot_class, "onGodotMainLoopStarted", "()V"); + _on_video_init = p_env->GetMethodID(java_method_class, "onVideoInit", "()V"); + _restart = p_env->GetMethodID(java_method_class, "restart", "()V"); + _finish = p_env->GetMethodID(java_method_class, "forceQuit", "()V"); + _set_keep_screen_on = p_env->GetMethodID(java_method_class, "setKeepScreenOn", "(Z)V"); + _alert = p_env->GetMethodID(java_method_class, "alert", "(Ljava/lang/String;Ljava/lang/String;)V"); + _get_GLES_version_code = p_env->GetMethodID(java_method_class, "getGLESVersionCode", "()I"); + _get_clipboard = p_env->GetMethodID(java_method_class, "getClipboard", "()Ljava/lang/String;"); + _set_clipboard = p_env->GetMethodID(java_method_class, "setClipboard", "(Ljava/lang/String;)V"); + _request_permission = p_env->GetMethodID(java_method_class, "requestPermission", "(Ljava/lang/String;)Z"); + _request_permissions = p_env->GetMethodID(java_method_class, "requestPermissions", "()Z"); + _get_granted_permissions = p_env->GetMethodID(java_method_class, "getGrantedPermissions", "()[Ljava/lang/String;"); + _init_input_devices = p_env->GetMethodID(java_method_class, "initInputDevices", "()V"); + _get_surface = p_env->GetMethodID(java_method_class, "getSurface", "()Landroid/view/Surface;"); + _is_activity_resumed = p_env->GetMethodID(java_method_class, "isActivityResumed", "()Z"); + _vibrate = p_env->GetMethodID(java_method_class, "vibrate", "(I)V"); + _get_input_fallback_mapping = p_env->GetMethodID(java_method_class, "getInputFallbackMapping", "()Ljava/lang/String;"); + _on_godot_setup_completed = p_env->GetMethodID(java_method_class, "onGodotSetupCompleted", "()V"); + _on_godot_main_loop_started = p_env->GetMethodID(java_method_class, "onGodotMainLoopStarted", "()V"); // get some Activity method pointers... _get_class_loader = p_env->GetMethodID(activity_class, "getClassLoader", "()Ljava/lang/ClassLoader;"); @@ -90,14 +90,14 @@ jobject GodotJavaWrapper::get_activity() { } jobject GodotJavaWrapper::get_member_object(const char *p_name, const char *p_class, JNIEnv *p_env) { - if (godot_class) { + if (java_method_class) { if (p_env == NULL) p_env = get_jni_env(); ERR_FAIL_COND_V(p_env == nullptr, nullptr); - jfieldID fid = p_env->GetStaticFieldID(godot_class, p_name, p_class); - return p_env->GetStaticObjectField(godot_class, fid); + jfieldID fid = p_env->GetStaticFieldID(java_method_class, p_name, p_class); + return p_env->GetStaticObjectField(java_method_class, fid); } else { return NULL; } diff --git a/platform/android/java_godot_wrapper.h b/platform/android/java_godot_wrapper.h index 53f8ef8800..7c53cd3a85 100644 --- a/platform/android/java_godot_wrapper.h +++ b/platform/android/java_godot_wrapper.h @@ -39,12 +39,12 @@ #include "string_android.h" -// Class that makes functions in java/src/lib/com/rebeltoolbox/rebelengine/Godot.java callable from C++ +// Class that makes methods in java/src/lib/com/rebeltoolbox/rebelengine/RebelFragment.java class callable from C++ class GodotJavaWrapper { private: jobject godot_instance; jobject activity; - jclass godot_class; + jclass java_method_class; jclass activity_class; jmethodID _on_video_init = 0; From 537d95125e7786c30946a8a4dd84abfcb92b01ae Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sun, 11 Jun 2023 09:08:26 +1200 Subject: [PATCH 11/41] Rename java interface GodotHost to RebelHost --- .../rebelengine/FullScreenGodotApp.java | 2 +- .../rebelengine/RebelFragment.java | 30 +++++++++---------- .../{GodotHost.java => RebelHost.java} | 4 +-- 3 files changed, 18 insertions(+), 18 deletions(-) rename platform/android/java/lib/src/com/rebeltoolbox/rebelengine/{GodotHost.java => RebelHost.java} (97%) diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/FullScreenGodotApp.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/FullScreenGodotApp.java index f6bc9fbe68..7525a8ec3a 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/FullScreenGodotApp.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/FullScreenGodotApp.java @@ -46,7 +46,7 @@ * It's also a reference implementation for how to setup and use the {@link RebelFragment} * within an Android app. */ -public abstract class FullScreenGodotApp extends FragmentActivity implements GodotHost { +public abstract class FullScreenGodotApp extends FragmentActivity implements RebelHost { private static final String TAG = FullScreenGodotApp.class.getSimpleName(); @Nullable diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java index e50cc8ed76..d8e98b1112 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java @@ -137,7 +137,7 @@ public class RebelFragment extends Fragment implements SensorEventListener, IDow // Used to dispatch events to the main thread. private final Handler mainThreadHandler = new Handler(Looper.getMainLooper()); - private GodotHost godotHost; + private RebelHost rebelHost; private GodotPluginRegistry pluginRegistry; static private Intent mCurrentIntent; @@ -265,17 +265,17 @@ public interface ResultCallback { @Override public void onAttach(Context context) { super.onAttach(context); - if (getParentFragment() instanceof GodotHost) { - godotHost = (GodotHost)getParentFragment(); - } else if (getActivity() instanceof GodotHost) { - godotHost = (GodotHost)getActivity(); + if (getParentFragment() instanceof RebelHost) { + rebelHost = (RebelHost)getParentFragment(); + } else if (getActivity() instanceof RebelHost) { + rebelHost = (RebelHost)getActivity(); } } @Override public void onDetach() { super.onDetach(); - godotHost = null; + rebelHost = null; } @CallSuper @@ -320,8 +320,8 @@ protected void onGodotSetupCompleted() { plugin.onGodotSetupCompleted(); } - if (godotHost != null) { - godotHost.onGodotSetupCompleted(); + if (rebelHost != null) { + rebelHost.onGodotSetupCompleted(); } } @@ -334,8 +334,8 @@ protected void onGodotMainLoopStarted() { plugin.onGodotMainLoopStarted(); } - if (godotHost != null) { - godotHost.onGodotMainLoopStarted(); + if (rebelHost != null) { + rebelHost.onGodotMainLoopStarted(); } } @@ -437,8 +437,8 @@ private void vibrate(int durationMs) { } public void restart() { - if (godotHost != null) { - godotHost.onGodotRestartRequested(this); + if (rebelHost != null) { + rebelHost.onGodotRestartRequested(this); } } @@ -465,7 +465,7 @@ public int getGLESVersionCode() { protected String[] getCommandLine() { String[] original = parseCommandLine(); String[] updated; - List hostCommandLine = godotHost != null ? godotHost.getCommandLine() : null; + List hostCommandLine = rebelHost != null ? rebelHost.getCommandLine() : null; if (hostCommandLine == null || hostCommandLine.isEmpty()) { updated = original; } else { @@ -948,8 +948,8 @@ private void forceQuit() { // TODO: This is a temp solution. // The proper fix will involve tracking down and properly shutting down each // Rebel Engine component that is started in onVideoInit. - if (godotHost != null) { - godotHost.onGodotForceQuit(this); + if (rebelHost != null) { + rebelHost.onGodotForceQuit(this); } } diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotHost.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelHost.java similarity index 97% rename from platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotHost.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelHost.java index 73a9629e2e..4352243b59 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotHost.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelHost.java @@ -1,5 +1,5 @@ /*************************************************************************/ -/* GodotHost.java */ +/* RebelHost.java */ /*************************************************************************/ /* This file is part of: */ /* REBEL ENGINE */ @@ -36,7 +36,7 @@ /** * Denotes a component (e.g: Activity, Fragment) that hosts the {@link RebelFragment} fragment. */ -public interface GodotHost { +public interface RebelHost { /** * Provides a set of command line parameters to setup the engine. */ From 5d30bc8c1c1c264a2b6ec468503736f89e0066f8 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sun, 11 Jun 2023 09:23:27 +1200 Subject: [PATCH 12/41] Rename java abstract class FullScreenGodotApp to RebelActivity --- .../app/src/com/rebeltoolbox/rebelapp/RebelApp.java | 4 ++-- .../{FullScreenGodotApp.java => RebelActivity.java} | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) rename platform/android/java/lib/src/com/rebeltoolbox/rebelengine/{FullScreenGodotApp.java => RebelActivity.java} (92%) diff --git a/platform/android/java/app/src/com/rebeltoolbox/rebelapp/RebelApp.java b/platform/android/java/app/src/com/rebeltoolbox/rebelapp/RebelApp.java index 13a60c8cea..dbf23e71e4 100644 --- a/platform/android/java/app/src/com/rebeltoolbox/rebelapp/RebelApp.java +++ b/platform/android/java/app/src/com/rebeltoolbox/rebelapp/RebelApp.java @@ -30,7 +30,7 @@ package com.rebeltoolbox.rebelapp; -import com.rebeltoolbox.rebelengine.FullScreenGodotApp; +import com.rebeltoolbox.rebelengine.RebelActivity; import android.os.Bundle; @@ -38,7 +38,7 @@ * Template activity for Android custom builds. * Feel free to extend and modify this class for your custom logic. */ -public class RebelApp extends FullScreenGodotApp { +public class RebelApp extends RebelActivity { @Override public void onCreate(Bundle savedInstanceState) { setTheme(R.style.GodotAppMainTheme); diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/FullScreenGodotApp.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelActivity.java similarity index 92% rename from platform/android/java/lib/src/com/rebeltoolbox/rebelengine/FullScreenGodotApp.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelActivity.java index 7525a8ec3a..7ae2a6385f 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/FullScreenGodotApp.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelActivity.java @@ -1,5 +1,5 @@ /*************************************************************************/ -/* FullScreenGodotApp.java */ +/* RebelActivity.java */ /*************************************************************************/ /* This file is part of: */ /* REBEL ENGINE */ @@ -46,8 +46,8 @@ * It's also a reference implementation for how to setup and use the {@link RebelFragment} * within an Android app. */ -public abstract class FullScreenGodotApp extends FragmentActivity implements RebelHost { - private static final String TAG = FullScreenGodotApp.class.getSimpleName(); +public abstract class RebelActivity extends FragmentActivity implements RebelHost { + private static final String TAG = RebelActivity.class.getSimpleName(); @Nullable private RebelFragment rebelFragment; @@ -87,7 +87,7 @@ public final void onGodotRestartRequested(RebelFragment restartFragment) { if (rebelFragment == restartFragment) { // HACK: // - // Currently it's very hard to properly deinitialize Godot on Android to restart the game + // Currently it's very hard to properly terminate Rebel Engine on Android to restart the game // from scratch. Therefore, we need to kill the whole app process and relaunch it. // // Restarting only the activity, wouldn't be enough unless it did proper cleanup (including @@ -138,7 +138,7 @@ public void onBackPressed() { } /** - * Used to initialize the Godot fragment instance in {@link FullScreenGodotApp#onCreate(Bundle)}. + * Used to initialize the Rebel Engine instance in {@link RebelActivity#onCreate(Bundle)}. */ @NonNull protected RebelFragment createRebelFragment() { From 4358a809113c0dd51949b61455153f5eeedcd0d7 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sun, 11 Jun 2023 10:15:34 +1200 Subject: [PATCH 13/41] Rename java class GodotLib to RebelEngine --- platform/android/api/api.cpp | 2 +- .../rebelengine/GodotRenderer.java | 12 ++-- .../rebeltoolbox/rebelengine/GodotView.java | 4 +- .../{GodotLib.java => RebelEngine.java} | 22 +++---- .../rebelengine/RebelFragment.java | 32 +++++----- .../input/GodotGestureHandler.java | 6 +- .../rebelengine/input/GodotInputHandler.java | 28 ++++---- .../input/GodotTextInputWrapper.java | 16 ++--- .../xr/regular/RegularContextFactory.java | 4 +- platform/android/java_godot_lib_jni.cpp | 62 +++++++++--------- platform/android/java_godot_lib_jni.h | 64 +++++++++---------- 11 files changed, 126 insertions(+), 126 deletions(-) rename platform/android/java/lib/src/com/rebeltoolbox/rebelengine/{GodotLib.java => RebelEngine.java} (92%) diff --git a/platform/android/api/api.cpp b/platform/android/api/api.cpp index ac58691bde..06ef232911 100644 --- a/platform/android/api/api.cpp +++ b/platform/android/api/api.cpp @@ -42,7 +42,7 @@ void register_android_api() { #if !defined(ANDROID_ENABLED) // On Android platforms, the `java_class_wrapper` instantiation and the // `JNISingleton` registration occurs in - // `platform/android/java_godot_lib_jni.cpp#Java_com_rebeltoolbox_rebelengine_GodotLib_setup` + // `platform/android/java_godot_lib_jni.cpp#Java_com_rebeltoolbox_rebelengine_RebelEngine_setup` java_class_wrapper = memnew(JavaClassWrapper); // Dummy ClassDB::register_class(); #endif diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotRenderer.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotRenderer.java index ec57cdb1be..73d8f1f466 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotRenderer.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotRenderer.java @@ -52,11 +52,11 @@ class GodotRenderer implements GLSurfaceView.Renderer { public void onDrawFrame(GL10 gl) { if (activityJustResumed) { - GodotLib.onRendererResumed(); + RebelEngine.onRendererResumed(); activityJustResumed = false; } - GodotLib.step(); + RebelEngine.step(); for (int i = 0; i < RebelFragment.singleton_count; i++) { RebelFragment.singletons[i].onGLDrawFrame(gl); } @@ -66,7 +66,7 @@ public void onDrawFrame(GL10 gl) { } public void onSurfaceChanged(GL10 gl, int width, int height) { - GodotLib.resize(width, height); + RebelEngine.resize(width, height); for (int i = 0; i < RebelFragment.singleton_count; i++) { RebelFragment.singletons[i].onGLSurfaceChanged(gl, width, height); } @@ -76,19 +76,19 @@ public void onSurfaceChanged(GL10 gl, int width, int height) { } public void onSurfaceCreated(GL10 gl, EGLConfig config) { - GodotLib.newcontext(GLUtils.use_32); + RebelEngine.newcontext(GLUtils.use_32); for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) { plugin.onGLSurfaceCreated(gl, config); } } void onActivityResumed() { - // We defer invoking GodotLib.onRendererResumed() until the first draw frame call. + // We defer invoking RebelEngine.onRendererResumed() until the first draw frame call. // This ensures we have a valid GL context and surface when we do so. activityJustResumed = true; } void onActivityPaused() { - GodotLib.onRendererPaused(); + RebelEngine.onRendererPaused(); } } diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotView.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotView.java index 674dbf107c..36b4c5503a 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotView.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotView.java @@ -190,7 +190,7 @@ public void onResume() { queueEvent(() -> { // Resume the renderer godotRenderer.onActivityResumed(); - GodotLib.focusin(); + RebelEngine.focusin(); }); } @@ -199,7 +199,7 @@ public void onPause() { super.onPause(); queueEvent(() -> { - GodotLib.focusout(); + RebelEngine.focusout(); // Pause the renderer godotRenderer.onActivityPaused(); }); diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotLib.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelEngine.java similarity index 92% rename from platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotLib.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelEngine.java index cddc7df83c..2c622f2461 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotLib.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelEngine.java @@ -1,5 +1,5 @@ /*************************************************************************/ -/* GodotLib.java */ +/* RebelEngine.java */ /*************************************************************************/ /* This file is part of: */ /* REBEL ENGINE */ @@ -38,7 +38,7 @@ /** * Wrapper for native library */ -public class GodotLib { +public class RebelEngine { public static GodotIO io; static { @@ -46,19 +46,19 @@ public class GodotLib { } /** - * Invoked on the main thread to initialize Godot native layer. + * Invoked on the main thread to initialize Rebel Engine. */ public static native void initialize(Activity activity, RebelFragment p_instance, Object p_asset_manager, boolean use_apk_expansion); /** - * Invoked on the main thread to clean up Godot native layer. + * Invoked on the main thread to terminate the Rebel Engine. * @see androidx.fragment.app.Fragment#onDestroy() */ public static native void ondestroy(); /** - * Invoked on the GL thread to complete setup for the Godot native layer logic. - * @param p_cmdline Command line arguments used to configure Godot native layer components. + * Invoked on the GL thread to setup Rebel Engine. + * @param p_cmdline Command line arguments used to configure Rebel Engine. */ public static native void setup(String[] p_cmdline); @@ -172,23 +172,23 @@ public class GodotLib { public static native void focusout(); /** - * Used to access Godot global properties. + * Used to access global properties. * @param p_key Property key * @return String value of the property */ public static native String getGlobal(String p_key); /** - * Invoke method |p_method| on the Godot object specified by |p_id| - * @param p_id Id of the Godot object to invoke + * Invoke method |p_method| on the Rebel object specified by |p_id| + * @param p_id Id of the Rebel object to invoke the method on * @param p_method Name of the method to invoke * @param p_params Parameters to use for method invocation */ public static native void callobject(long p_id, String p_method, Object[] p_params); /** - * Invoke method |p_method| on the Godot object specified by |p_id| during idle time. - * @param p_id Id of the Godot object to invoke + * Invoke method |p_method| on the Rebel object specified by |p_id| during idle time. + * @param p_id Id of the Rebel object to invoke the method on * @param p_method Name of the method to invoke * @param p_params Parameters to use for method invocation */ diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java index d8e98b1112..a0c0ddb25d 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java @@ -224,7 +224,7 @@ protected void onMainDestroy() {} protected void onGLDrawFrame(GL10 gl) {} protected void onGLSurfaceChanged(GL10 gl, int width, int height) {} // singletons will always miss first onGLSurfaceChanged call - // protected void onGLSurfaceCreated(GL10 gl, EGLConfig config) {} // singletons won't be ready until first GodotLib.step() + // protected void onGLSurfaceCreated(GL10 gl, EGLConfig config) {} // singletons won't be ready until first RebelEngine.step() public void registerMethods() {} } @@ -307,7 +307,7 @@ public void onRequestPermissionsResult(int requestCode, String[] permissions, in } for (int i = 0; i < permissions.length; i++) { - GodotLib.requestPermissionResult(permissions[i], grantResults[i] == PackageManager.PERMISSION_GRANTED); + RebelEngine.requestPermissionResult(permissions[i], grantResults[i] == PackageManager.PERMISSION_GRANTED); } } @@ -368,20 +368,20 @@ private void onVideoInit() { Rect gameSize = new Rect(); mView.getWindowVisibleDisplayFrame(gameSize); final int keyboardHeight = fullSize.y - gameSize.bottom; - GodotLib.setVirtualKeyboardHeight(keyboardHeight); + RebelEngine.setVirtualKeyboardHeight(keyboardHeight); }); final String[] current_command_line = command_line; mView.queueEvent(() -> { - GodotLib.setup(current_command_line); + RebelEngine.setup(current_command_line); - // Must occur after GodotLib.setup has completed. + // Must occur after RebelEngine.setup has completed. for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) { plugin.onRegisterPluginWithGodotNative(); } - setKeepScreenOn("True".equals(GodotLib.getGlobal("display/window/energy_saving/keep_screen_on"))); + setKeepScreenOn("True".equals(RebelEngine.getGlobal("display/window/energy_saving/keep_screen_on"))); - // The Godot Android plugins are setup on completion of GodotLib.setup + // The Godot Android plugins are setup on completion of RebelEngine.setup mainThreadHandler.post(() -> { // Include the non-null views returned in the Godot view hierarchy. for (int i = 0; i < singleton_count; i++) { @@ -559,7 +559,7 @@ private void initializeGodot() { final Activity activity = getActivity(); io = new GodotIO(activity); - GodotLib.io = io; + RebelEngine.io = io; netUtils = new GodotNetUtils(activity); mSensorManager = (SensorManager)activity.getSystemService(Context.SENSOR_SERVICE); mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); @@ -571,7 +571,7 @@ private void initializeGodot() { mGyroscope = mSensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE); mSensorManager.registerListener(this, mGyroscope, SensorManager.SENSOR_DELAY_GAME); - GodotLib.initialize(activity, this, activity.getAssets(), use_apk_expansion); + RebelEngine.initialize(activity, this, activity.getAssets(), use_apk_expansion); result_callback = null; @@ -746,7 +746,7 @@ public void onDestroy() { plugin.onMainDestroy(); } - GodotLib.ondestroy(); + RebelEngine.ondestroy(); super.onDestroy(); @@ -872,16 +872,16 @@ public void onSensorChanged(SensorEvent event) { if (mView != null) { mView.queueEvent(() -> { if (typeOfSensor == Sensor.TYPE_ACCELEROMETER) { - GodotLib.accelerometer(-x, y, -z); + RebelEngine.accelerometer(-x, y, -z); } if (typeOfSensor == Sensor.TYPE_GRAVITY) { - GodotLib.gravity(-x, y, -z); + RebelEngine.gravity(-x, y, -z); } if (typeOfSensor == Sensor.TYPE_MAGNETIC_FIELD) { - GodotLib.magnetometer(-x, y, -z); + RebelEngine.magnetometer(-x, y, -z); } if (typeOfSensor == Sensor.TYPE_GYROSCOPE) { - GodotLib.gyroscope(x, -y, z); + RebelEngine.gyroscope(x, -y, z); } }); } @@ -899,7 +899,7 @@ public final void onAccuracyChanged(Sensor sensor, int accuracy) { System.out.printf("** BACK REQUEST!\n"); - GodotLib.quit(); + RebelEngine.quit(); return true; } System.out.printf("** OTHER KEY!\n"); @@ -923,7 +923,7 @@ public void onBackPressed() { } if (shouldQuit && mView != null) { - mView.queueEvent(GodotLib::back); + mView.queueEvent(RebelEngine::back); } } diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotGestureHandler.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotGestureHandler.java index 2a01a3c56f..06d7ace66e 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotGestureHandler.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotGestureHandler.java @@ -30,8 +30,8 @@ package com.rebeltoolbox.rebelengine.input; -import com.rebeltoolbox.rebelengine.GodotLib; import com.rebeltoolbox.rebelengine.GodotView; +import com.rebeltoolbox.rebelengine.RebelEngine; import android.view.GestureDetector; import android.view.MotionEvent; @@ -75,7 +75,7 @@ public boolean onDoubleTap(MotionEvent event) { final int x = Math.round(event.getX()); final int y = Math.round(event.getY()); final int buttonMask = event.getButtonState(); - GodotLib.doubleTap(buttonMask, x, y); + RebelEngine.doubleTap(buttonMask, x, y); return true; } @@ -84,7 +84,7 @@ public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float d //Log.i("GodotGesture", "onScroll"); final int x = Math.round(distanceX); final int y = Math.round(distanceY); - GodotLib.scroll(x, y); + RebelEngine.scroll(x, y); return true; } diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotInputHandler.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotInputHandler.java index be7abd37fc..6e1e4b9aea 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotInputHandler.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotInputHandler.java @@ -32,8 +32,8 @@ import static com.rebeltoolbox.rebelengine.utils.GLUtils.DEBUG; -import com.rebeltoolbox.rebelengine.GodotLib; import com.rebeltoolbox.rebelengine.GodotView; +import com.rebeltoolbox.rebelengine.RebelEngine; import com.rebeltoolbox.rebelengine.input.InputManagerCompat.InputDeviceListener; import android.os.Build; @@ -92,12 +92,12 @@ public boolean onKeyUp(final int keyCode, KeyEvent event) { if (mJoystickIds.indexOfKey(deviceId) >= 0) { final int button = getGodotButton(keyCode); final int godotJoyId = mJoystickIds.get(deviceId); - GodotLib.joybutton(godotJoyId, button, false); + RebelEngine.joybutton(godotJoyId, button, false); } } else { final int scanCode = event.getScanCode(); final int chr = event.getUnicodeChar(0); - GodotLib.key(keyCode, scanCode, chr, false); + RebelEngine.key(keyCode, scanCode, chr, false); }; return true; @@ -127,12 +127,12 @@ public boolean onKeyDown(final int keyCode, KeyEvent event) { if (mJoystickIds.indexOfKey(deviceId) >= 0) { final int button = getGodotButton(keyCode); final int godotJoyId = mJoystickIds.get(deviceId); - GodotLib.joybutton(godotJoyId, button, true); + RebelEngine.joybutton(godotJoyId, button, true); } } else { final int scanCode = event.getScanCode(); final int chr = event.getUnicodeChar(0); - GodotLib.key(keyCode, scanCode, chr, true); + RebelEngine.key(keyCode, scanCode, chr, true); } return true; @@ -171,7 +171,7 @@ public boolean onTouchEvent(final MotionEvent event) { case MotionEvent.ACTION_MOVE: case MotionEvent.ACTION_POINTER_UP: case MotionEvent.ACTION_POINTER_DOWN: { - GodotLib.touch(event.getSource(), action, pointer_idx, evcount, arr); + RebelEngine.touch(event.getSource(), action, pointer_idx, evcount, arr); } break; } } @@ -197,7 +197,7 @@ public boolean onGenericMotionEvent(MotionEvent event) { // save value to prevent repeats joystick.axesValues.put(axis, value); final int godotAxisIdx = i; - GodotLib.joyaxis(godotJoyId, godotAxisIdx, value); + RebelEngine.joyaxis(godotJoyId, godotAxisIdx, value); } } @@ -207,7 +207,7 @@ public boolean onGenericMotionEvent(MotionEvent event) { if (joystick.hatX != hatX || joystick.hatY != hatY) { joystick.hatX = hatX; joystick.hatY = hatY; - GodotLib.joyhat(godotJoyId, hatX, hatY); + RebelEngine.joyhat(godotJoyId, hatX, hatY); } } return true; @@ -216,7 +216,7 @@ public boolean onGenericMotionEvent(MotionEvent event) { final float x = event.getX(); final float y = event.getY(); final int type = event.getAction(); - GodotLib.hover(type, x, y); + RebelEngine.hover(type, x, y); return true; } else if ((event.isFromSource(InputDevice.SOURCE_MOUSE))) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { @@ -307,7 +307,7 @@ public void onInputDeviceAdded(int deviceId) { } mJoysticksDevices.put(deviceId, joystick); - GodotLib.joyconnectionchanged(id, true, joystick.name); + RebelEngine.joyconnectionchanged(id, true, joystick.name); } @Override @@ -319,7 +319,7 @@ public void onInputDeviceRemoved(int deviceId) { final int godotJoyId = mJoystickIds.get(deviceId); mJoystickIds.delete(deviceId); mJoysticksDevices.delete(deviceId); - GodotLib.joyconnectionchanged(godotJoyId, false, ""); + RebelEngine.joyconnectionchanged(godotJoyId, false, ""); } @Override @@ -408,7 +408,7 @@ private boolean handleMouseEvent(final MotionEvent event) { final float x = event.getX(); final float y = event.getY(); final int type = event.getAction(); - GodotLib.hover(type, x, y); + RebelEngine.hover(type, x, y); return true; } case MotionEvent.ACTION_BUTTON_PRESS: @@ -418,7 +418,7 @@ private boolean handleMouseEvent(final MotionEvent event) { final float y = event.getY(); final int buttonsMask = event.getButtonState(); final int action = event.getAction(); - GodotLib.touch(event.getSource(), action, 0, 1, new float[] { 0, x, y }, buttonsMask); + RebelEngine.touch(event.getSource(), action, 0, 1, new float[] { 0, x, y }, buttonsMask); return true; } case MotionEvent.ACTION_SCROLL: { @@ -428,7 +428,7 @@ private boolean handleMouseEvent(final MotionEvent event) { final int action = event.getAction(); final float verticalFactor = event.getAxisValue(MotionEvent.AXIS_VSCROLL); final float horizontalFactor = event.getAxisValue(MotionEvent.AXIS_HSCROLL); - GodotLib.touch(event.getSource(), action, 0, 1, new float[] { 0, x, y }, buttonsMask, verticalFactor, horizontalFactor); + RebelEngine.touch(event.getSource(), action, 0, 1, new float[] { 0, x, y }, buttonsMask, verticalFactor, horizontalFactor); } } return false; diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotTextInputWrapper.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotTextInputWrapper.java index 115a82b975..d005f6d3ed 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotTextInputWrapper.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotTextInputWrapper.java @@ -95,8 +95,8 @@ public void beforeTextChanged(final CharSequence pCharSequence, final int start, //Log.d(TAG, "beforeTextChanged(" + pCharSequence + ")start: " + start + ",count: " + count + ",after: " + after); for (int i = 0; i < count; ++i) { - GodotLib.key(KeyEvent.KEYCODE_DEL, KeyEvent.KEYCODE_DEL, 0, true); - GodotLib.key(KeyEvent.KEYCODE_DEL, KeyEvent.KEYCODE_DEL, 0, false); + RebelEngine.key(KeyEvent.KEYCODE_DEL, KeyEvent.KEYCODE_DEL, 0, true); + RebelEngine.key(KeyEvent.KEYCODE_DEL, KeyEvent.KEYCODE_DEL, 0, false); if (mHasSelection) { mHasSelection = false; @@ -119,8 +119,8 @@ public void onTextChanged(final CharSequence pCharSequence, final int start, fin // Return keys are handled through action events continue; } - GodotLib.key(0, 0, key, true); - GodotLib.key(0, 0, key, false); + RebelEngine.key(0, 0, key, true); + RebelEngine.key(0, 0, key, false); } } @@ -131,16 +131,16 @@ public boolean onEditorAction(final TextView pTextView, final int pActionID, fin for (int i = 0; i < characters.length(); i++) { final int ch = characters.codePointAt(i); - GodotLib.key(0, 0, ch, true); - GodotLib.key(0, 0, ch, false); + RebelEngine.key(0, 0, ch, true); + RebelEngine.key(0, 0, ch, false); } } if (pActionID == EditorInfo.IME_ACTION_DONE) { // Enter key has been pressed mView.queueEvent(() -> { - GodotLib.key(KeyEvent.KEYCODE_ENTER, KeyEvent.KEYCODE_ENTER, 0, true); - GodotLib.key(KeyEvent.KEYCODE_ENTER, KeyEvent.KEYCODE_ENTER, 0, false); + RebelEngine.key(KeyEvent.KEYCODE_ENTER, KeyEvent.KEYCODE_ENTER, 0, true); + RebelEngine.key(KeyEvent.KEYCODE_ENTER, KeyEvent.KEYCODE_ENTER, 0, false); }); mView.requestFocus(); return true; diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/regular/RegularContextFactory.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/regular/RegularContextFactory.java index 2f8da4ef5d..dd4ec66c0a 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/regular/RegularContextFactory.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/xr/regular/RegularContextFactory.java @@ -30,7 +30,7 @@ package com.rebeltoolbox.rebelengine.xr.regular; -import com.rebeltoolbox.rebelengine.GodotLib; +import com.rebeltoolbox.rebelengine.RebelEngine; import com.rebeltoolbox.rebelengine.utils.GLUtils; import android.opengl.GLSurfaceView; @@ -53,7 +53,7 @@ public class RegularContextFactory implements GLSurfaceView.EGLContextFactory { private static int EGL_CONTEXT_CLIENT_VERSION = 0x3098; public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) { - String driver_name = GodotLib.getGlobal("rendering/quality/driver/driver_name"); + String driver_name = RebelEngine.getGlobal("rendering/quality/driver/driver_name"); if (GLUtils.use_gl3 && !driver_name.equals("GLES3")) { GLUtils.use_gl3 = false; } diff --git a/platform/android/java_godot_lib_jni.cpp b/platform/android/java_godot_lib_jni.cpp index cd15fbbba3..083f2be452 100644 --- a/platform/android/java_godot_lib_jni.cpp +++ b/platform/android/java_godot_lib_jni.cpp @@ -113,13 +113,13 @@ static void _initialize_java_modules() { extern "C" { -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_setVirtualKeyboardHeight(JNIEnv *env, jclass clazz, jint p_height) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_setVirtualKeyboardHeight(JNIEnv *env, jclass clazz, jint p_height) { if (godot_io_java) { godot_io_java->set_vk_height(p_height); } } -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_initialize(JNIEnv *env, jclass clazz, jobject activity, jobject godot_instance, jobject p_asset_manager, jboolean p_use_apk_expansion) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_initialize(JNIEnv *env, jclass clazz, jobject activity, jobject godot_instance, jobject p_asset_manager, jboolean p_use_apk_expansion) { initialized = true; JavaVM *jvm; @@ -146,7 +146,7 @@ JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_initialize(JNI godot_java->on_video_init(env); } -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_ondestroy(JNIEnv *env, jclass clazz) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_ondestroy(JNIEnv *env, jclass clazz) { // lets cleanup if (godot_io_java) { delete godot_io_java; @@ -162,7 +162,7 @@ JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_ondestroy(JNIE } } -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_setup(JNIEnv *env, jclass clazz, jobjectArray p_cmdline) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_setup(JNIEnv *env, jclass clazz, jobjectArray p_cmdline) { setup_android_thread(); const char **cmdline = NULL; @@ -207,12 +207,12 @@ JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_setup(JNIEnv * _initialize_java_modules(); } -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_resize(JNIEnv *env, jclass clazz, jint width, jint height) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_resize(JNIEnv *env, jclass clazz, jint width, jint height) { if (os_android) os_android->set_display_size(Size2(width, height)); } -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_newcontext(JNIEnv *env, jclass clazz, jboolean p_32_bits) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_newcontext(JNIEnv *env, jclass clazz, jboolean p_32_bits) { if (os_android) { if (step.get() == 0) { // During startup @@ -226,7 +226,7 @@ JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_newcontext(JNI } } -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_back(JNIEnv *env, jclass clazz) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_back(JNIEnv *env, jclass clazz) { if (step.get() == 0) return; @@ -235,7 +235,7 @@ JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_back(JNIEnv *e } } -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_step(JNIEnv *env, jclass clazz) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_step(JNIEnv *env, jclass clazz) { if (step.get() == -1) return; @@ -291,22 +291,22 @@ void touch_preprocessing(JNIEnv *env, jclass clazz, jint input_device, jint ev, } // Called on the UI thread -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_touch__IIII_3F(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray position) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_touch__IIII_3F(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray position) { touch_preprocessing(env, clazz, input_device, ev, pointer, pointer_count, position); } // Called on the UI thread -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_touch__IIII_3FI(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray position, jint buttons_mask) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_touch__IIII_3FI(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray position, jint buttons_mask) { touch_preprocessing(env, clazz, input_device, ev, pointer, pointer_count, position, buttons_mask); } // Called on the UI thread -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_touch__IIII_3FIFF(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray position, jint buttons_mask, jfloat vertical_factor, jfloat horizontal_factor) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_touch__IIII_3FIFF(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray position, jint buttons_mask, jfloat vertical_factor, jfloat horizontal_factor) { touch_preprocessing(env, clazz, input_device, ev, pointer, pointer_count, position, buttons_mask, vertical_factor, horizontal_factor); } // Called on the UI thread -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_hover(JNIEnv *env, jclass clazz, jint p_type, jfloat p_x, jfloat p_y) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_hover(JNIEnv *env, jclass clazz, jint p_type, jfloat p_x, jfloat p_y) { if (step.get() <= 0) return; @@ -314,7 +314,7 @@ JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_hover(JNIEnv * } // Called on the UI thread -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_doubleTap(JNIEnv *env, jclass clazz, jint p_button_mask, jint p_x, jint p_y) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_doubleTap(JNIEnv *env, jclass clazz, jint p_button_mask, jint p_x, jint p_y) { if (step.get() <= 0) return; @@ -322,7 +322,7 @@ JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_doubleTap(JNIE } // Called on the UI thread -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_scroll(JNIEnv *env, jclass clazz, jint p_x, jint p_y) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_scroll(JNIEnv *env, jclass clazz, jint p_x, jint p_y) { if (step.get() <= 0) return; @@ -330,7 +330,7 @@ JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_scroll(JNIEnv } // Called on the UI thread -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_joybutton(JNIEnv *env, jclass clazz, jint p_device, jint p_button, jboolean p_pressed) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_joybutton(JNIEnv *env, jclass clazz, jint p_device, jint p_button, jboolean p_pressed) { if (step.get() <= 0) return; @@ -344,7 +344,7 @@ JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_joybutton(JNIE } // Called on the UI thread -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_joyaxis(JNIEnv *env, jclass clazz, jint p_device, jint p_axis, jfloat p_value) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_joyaxis(JNIEnv *env, jclass clazz, jint p_device, jint p_axis, jfloat p_value) { if (step.get() <= 0) return; @@ -358,7 +358,7 @@ JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_joyaxis(JNIEnv } // Called on the UI thread -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_joyhat(JNIEnv *env, jclass clazz, jint p_device, jint p_hat_x, jint p_hat_y) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_joyhat(JNIEnv *env, jclass clazz, jint p_device, jint p_hat_x, jint p_hat_y) { if (step.get() <= 0) return; @@ -384,7 +384,7 @@ JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_joyhat(JNIEnv } // Called on the UI thread -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_joyconnectionchanged(JNIEnv *env, jclass clazz, jint p_device, jboolean p_connected, jstring p_name) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_joyconnectionchanged(JNIEnv *env, jclass clazz, jint p_device, jboolean p_connected, jstring p_name) { if (step.get() <= 0) return; @@ -393,50 +393,50 @@ JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_joyconnectionc } // Called on the UI thread -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_key(JNIEnv *env, jclass clazz, jint p_keycode, jint p_scancode, jint p_unicode_char, jboolean p_pressed) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_key(JNIEnv *env, jclass clazz, jint p_keycode, jint p_scancode, jint p_unicode_char, jboolean p_pressed) { if (step.get() <= 0) return; input_handler->process_key_event(p_keycode, p_scancode, p_unicode_char, p_pressed); } -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_accelerometer(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_accelerometer(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z) { accelerometer = Vector3(x, y, z); } -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_gravity(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_gravity(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z) { gravity = Vector3(x, y, z); } -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_magnetometer(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_magnetometer(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z) { magnetometer = Vector3(x, y, z); } -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_gyroscope(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_gyroscope(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z) { gyroscope = Vector3(x, y, z); } -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_focusin(JNIEnv *env, jclass clazz) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_focusin(JNIEnv *env, jclass clazz) { if (step.get() <= 0) return; os_android->main_loop_focusin(); } -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_focusout(JNIEnv *env, jclass clazz) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_focusout(JNIEnv *env, jclass clazz) { if (step.get() <= 0) return; os_android->main_loop_focusout(); } -JNIEXPORT jstring JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_getGlobal(JNIEnv *env, jclass clazz, jstring path) { +JNIEXPORT jstring JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_getGlobal(JNIEnv *env, jclass clazz, jstring path) { String js = jstring_to_string(path, env); return env->NewStringUTF(ProjectSettings::get_singleton()->get(js).operator String().utf8().get_data()); } -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_callobject(JNIEnv *env, jclass clazz, jlong ID, jstring method, jobjectArray params) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_callobject(JNIEnv *env, jclass clazz, jlong ID, jstring method, jobjectArray params) { Object *obj = ObjectDB::get_instance(ID); ERR_FAIL_COND(!obj); @@ -466,7 +466,7 @@ JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_callobject(JNI env->PopLocalFrame(NULL); } -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_calldeferred(JNIEnv *env, jclass clazz, jlong ID, jstring method, jobjectArray params) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_calldeferred(JNIEnv *env, jclass clazz, jlong ID, jstring method, jobjectArray params) { Object *obj = ObjectDB::get_instance(ID); ERR_FAIL_COND(!obj); @@ -490,7 +490,7 @@ JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_calldeferred(J env->PopLocalFrame(NULL); } -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_requestPermissionResult(JNIEnv *env, jclass clazz, jstring p_permission, jboolean p_result) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_requestPermissionResult(JNIEnv *env, jclass clazz, jstring p_permission, jboolean p_result) { String permission = jstring_to_string(p_permission, env); if (permission == "android.permission.RECORD_AUDIO" && p_result) { AudioDriver::get_singleton()->capture_start(); @@ -501,7 +501,7 @@ JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_requestPermiss } } -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_onRendererResumed(JNIEnv *env, jclass clazz) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_onRendererResumed(JNIEnv *env, jclass clazz) { if (step.get() <= 0) return; @@ -510,7 +510,7 @@ JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_onRendererResu } } -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_onRendererPaused(JNIEnv *env, jclass clazz) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_onRendererPaused(JNIEnv *env, jclass clazz) { if (step.get() <= 0) return; diff --git a/platform/android/java_godot_lib_jni.h b/platform/android/java_godot_lib_jni.h index 1f15b817ae..5c5e7b0c7d 100644 --- a/platform/android/java_godot_lib_jni.h +++ b/platform/android/java_godot_lib_jni.h @@ -35,40 +35,40 @@ #include // These functions can be called from within JAVA and are the means by which our JAVA implementation calls back into our C++ code. -// See java/lib/src/com/rebeltoolbox/rebelengine/GodotLib.java for the JAVA side of this (yes that's why we have the long names) +// See java/lib/src/com/rebeltoolbox/rebelengine/RebelEngine.java for the JAVA side of this (yes that's why we have the long names) extern "C" { -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_initialize(JNIEnv *env, jclass clazz, jobject activity, jobject godot_instance, jobject p_asset_manager, jboolean p_use_apk_expansion); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_ondestroy(JNIEnv *env, jclass clazz); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_setup(JNIEnv *env, jclass clazz, jobjectArray p_cmdline); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_resize(JNIEnv *env, jclass clazz, jint width, jint height); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_newcontext(JNIEnv *env, jclass clazz, jboolean p_32_bits); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_step(JNIEnv *env, jclass clazz); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_back(JNIEnv *env, jclass clazz); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_initialize(JNIEnv *env, jclass clazz, jobject activity, jobject godot_instance, jobject p_asset_manager, jboolean p_use_apk_expansion); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_ondestroy(JNIEnv *env, jclass clazz); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_setup(JNIEnv *env, jclass clazz, jobjectArray p_cmdline); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_resize(JNIEnv *env, jclass clazz, jint width, jint height); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_newcontext(JNIEnv *env, jclass clazz, jboolean p_32_bits); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_step(JNIEnv *env, jclass clazz); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_back(JNIEnv *env, jclass clazz); void touch_preprocessing(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray positions, jint buttons_mask = 0, jfloat vertical_factor = 0, jfloat horizontal_factor = 0); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_touch__IIII_3F(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray positions); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_touch__IIII_3FI(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray positions, jint buttons_mask); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_touch__IIII_3FIFF(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray positions, jint buttons_mask, jfloat vertical_factor, jfloat horizontal_factor); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_hover(JNIEnv *env, jclass clazz, jint p_type, jfloat p_x, jfloat p_y); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_doubleTap(JNIEnv *env, jclass clazz, jint p_button_mask, jint p_x, jint p_y); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_scroll(JNIEnv *env, jclass clazz, jint p_x, jint p_y); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_key(JNIEnv *env, jclass clazz, jint p_keycode, jint p_scancode, jint p_unicode_char, jboolean p_pressed); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_joybutton(JNIEnv *env, jclass clazz, jint p_device, jint p_button, jboolean p_pressed); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_joyaxis(JNIEnv *env, jclass clazz, jint p_device, jint p_axis, jfloat p_value); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_joyhat(JNIEnv *env, jclass clazz, jint p_device, jint p_hat_x, jint p_hat_y); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_joyconnectionchanged(JNIEnv *env, jclass clazz, jint p_device, jboolean p_connected, jstring p_name); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_accelerometer(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_gravity(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_magnetometer(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_gyroscope(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_focusin(JNIEnv *env, jclass clazz); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_focusout(JNIEnv *env, jclass clazz); -JNIEXPORT jstring JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_getGlobal(JNIEnv *env, jclass clazz, jstring path); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_callobject(JNIEnv *env, jclass clazz, jlong ID, jstring method, jobjectArray params); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_calldeferred(JNIEnv *env, jclass clazz, jlong ID, jstring method, jobjectArray params); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_setVirtualKeyboardHeight(JNIEnv *env, jclass clazz, jint p_height); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_requestPermissionResult(JNIEnv *env, jclass clazz, jstring p_permission, jboolean p_result); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_onRendererResumed(JNIEnv *env, jclass clazz); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_GodotLib_onRendererPaused(JNIEnv *env, jclass clazz); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_touch__IIII_3F(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray positions); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_touch__IIII_3FI(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray positions, jint buttons_mask); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_touch__IIII_3FIFF(JNIEnv *env, jclass clazz, jint input_device, jint ev, jint pointer, jint pointer_count, jfloatArray positions, jint buttons_mask, jfloat vertical_factor, jfloat horizontal_factor); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_hover(JNIEnv *env, jclass clazz, jint p_type, jfloat p_x, jfloat p_y); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_doubleTap(JNIEnv *env, jclass clazz, jint p_button_mask, jint p_x, jint p_y); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_scroll(JNIEnv *env, jclass clazz, jint p_x, jint p_y); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_key(JNIEnv *env, jclass clazz, jint p_keycode, jint p_scancode, jint p_unicode_char, jboolean p_pressed); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_joybutton(JNIEnv *env, jclass clazz, jint p_device, jint p_button, jboolean p_pressed); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_joyaxis(JNIEnv *env, jclass clazz, jint p_device, jint p_axis, jfloat p_value); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_joyhat(JNIEnv *env, jclass clazz, jint p_device, jint p_hat_x, jint p_hat_y); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_joyconnectionchanged(JNIEnv *env, jclass clazz, jint p_device, jboolean p_connected, jstring p_name); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_accelerometer(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_gravity(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_magnetometer(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_gyroscope(JNIEnv *env, jclass clazz, jfloat x, jfloat y, jfloat z); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_focusin(JNIEnv *env, jclass clazz); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_focusout(JNIEnv *env, jclass clazz); +JNIEXPORT jstring JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_getGlobal(JNIEnv *env, jclass clazz, jstring path); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_callobject(JNIEnv *env, jclass clazz, jlong ID, jstring method, jobjectArray params); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_calldeferred(JNIEnv *env, jclass clazz, jlong ID, jstring method, jobjectArray params); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_setVirtualKeyboardHeight(JNIEnv *env, jclass clazz, jint p_height); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_requestPermissionResult(JNIEnv *env, jclass clazz, jstring p_permission, jboolean p_result); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_onRendererResumed(JNIEnv *env, jclass clazz); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_onRendererPaused(JNIEnv *env, jclass clazz); } #endif /* !JAVA_GODOT_LIB_JNI_H */ From b12d62bc84260059f2b6d1a57dead0cf0c579cab Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sun, 11 Jun 2023 10:34:31 +1200 Subject: [PATCH 14/41] Rename java class GodotIO to RebelIO --- .../rebeltoolbox/rebelengine/RebelEngine.java | 2 +- .../rebelengine/RebelFragment.java | 4 +- .../{GodotIO.java => RebelIO.java} | 8 ++-- platform/android/java_godot_io_wrapper.cpp | 38 +++++++++---------- platform/android/java_godot_io_wrapper.h | 4 +- 5 files changed, 28 insertions(+), 28 deletions(-) rename platform/android/java/lib/src/com/rebeltoolbox/rebelengine/{GodotIO.java => RebelIO.java} (98%) diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelEngine.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelEngine.java index 2c622f2461..1a49917874 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelEngine.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelEngine.java @@ -39,7 +39,7 @@ * Wrapper for native library */ public class RebelEngine { - public static GodotIO io; + public static RebelIO io; static { System.loadLibrary("godot_android"); diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java index a0c0ddb25d..42267133da 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java @@ -251,7 +251,7 @@ protected void instanceSingleton(SingletonBase s) { private Sensor mMagnetometer; private Sensor mGyroscope; - public static GodotIO io; + public static RebelIO io; public static GodotNetUtils netUtils; static SingletonBase[] singletons = new SingletonBase[MAX_SINGLETONS]; @@ -558,7 +558,7 @@ private void initializeGodot() { } final Activity activity = getActivity(); - io = new GodotIO(activity); + io = new RebelIO(activity); RebelEngine.io = io; netUtils = new GodotNetUtils(activity); mSensorManager = (SensorManager)activity.getSystemService(Context.SENSOR_SERVICE); diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotIO.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelIO.java similarity index 98% rename from platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotIO.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelIO.java index 60bd9df8c7..0b17422f4d 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotIO.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelIO.java @@ -1,5 +1,5 @@ /*************************************************************************/ -/* GodotIO.java */ +/* RebelIO.java */ /*************************************************************************/ /* This file is part of: */ /* REBEL ENGINE */ @@ -55,8 +55,8 @@ // Wrapper for native library -public class GodotIO { - private static final String TAG = GodotIO.class.getSimpleName(); +public class RebelIO { + private static final String TAG = RebelIO.class.getSimpleName(); private final AssetManager am; private final Activity activity; @@ -161,7 +161,7 @@ public void dir_close(int id) { dirs.remove(id); } - GodotIO(Activity p_activity) { + RebelIO(Activity p_activity) { am = p_activity.getAssets(); activity = p_activity; dirs = new SparseArray<>(); diff --git a/platform/android/java_godot_io_wrapper.cpp b/platform/android/java_godot_io_wrapper.cpp index 3bb4cfa012..2a03237db9 100644 --- a/platform/android/java_godot_io_wrapper.cpp +++ b/platform/android/java_godot_io_wrapper.cpp @@ -33,13 +33,13 @@ // JNIEnv is only valid within the thread it belongs to, in a multi threading environment // we can't cache it. -// For GodotIO we call all access methods from our thread and we thus get a valid JNIEnv +// For IO we call all access methods from our thread and we thus get a valid JNIEnv // from ThreadAndroid. -GodotIOJavaWrapper::GodotIOJavaWrapper(JNIEnv *p_env, jobject p_godot_io_instance) { - godot_io_instance = p_env->NewGlobalRef(p_godot_io_instance); - if (godot_io_instance) { - cls = p_env->GetObjectClass(godot_io_instance); +GodotIOJavaWrapper::GodotIOJavaWrapper(JNIEnv *p_env, jobject io_object) { + io_object = p_env->NewGlobalRef(io_object); + if (io_object) { + cls = p_env->GetObjectClass(io_object); if (cls) { cls = (jclass)p_env->NewGlobalRef(cls); } else { @@ -68,7 +68,7 @@ GodotIOJavaWrapper::~GodotIOJavaWrapper() { } jobject GodotIOJavaWrapper::get_instance() { - return godot_io_instance; + return io_object; } Error GodotIOJavaWrapper::open_uri(const String &p_uri) { @@ -76,7 +76,7 @@ Error GodotIOJavaWrapper::open_uri(const String &p_uri) { JNIEnv *env = get_jni_env(); ERR_FAIL_COND_V(env == nullptr, ERR_UNAVAILABLE); jstring jStr = env->NewStringUTF(p_uri.utf8().get_data()); - return env->CallIntMethod(godot_io_instance, _open_URI, jStr) ? ERR_CANT_OPEN : OK; + return env->CallIntMethod(io_object, _open_URI, jStr) ? ERR_CANT_OPEN : OK; } else { return ERR_UNAVAILABLE; } @@ -86,7 +86,7 @@ String GodotIOJavaWrapper::get_cache_dir() { if (_get_cache_dir) { JNIEnv *env = get_jni_env(); ERR_FAIL_COND_V(env == nullptr, String()); - jstring s = (jstring)env->CallObjectMethod(godot_io_instance, _get_cache_dir); + jstring s = (jstring)env->CallObjectMethod(io_object, _get_cache_dir); return jstring_to_string(s, env); } else { return String(); @@ -97,7 +97,7 @@ String GodotIOJavaWrapper::get_user_data_dir() { if (_get_data_dir) { JNIEnv *env = get_jni_env(); ERR_FAIL_COND_V(env == nullptr, String()); - jstring s = (jstring)env->CallObjectMethod(godot_io_instance, _get_data_dir); + jstring s = (jstring)env->CallObjectMethod(io_object, _get_data_dir); return jstring_to_string(s, env); } else { return String(); @@ -108,7 +108,7 @@ String GodotIOJavaWrapper::get_locale() { if (_get_locale) { JNIEnv *env = get_jni_env(); ERR_FAIL_COND_V(env == nullptr, String()); - jstring s = (jstring)env->CallObjectMethod(godot_io_instance, _get_locale); + jstring s = (jstring)env->CallObjectMethod(io_object, _get_locale); return jstring_to_string(s, env); } else { return String(); @@ -119,7 +119,7 @@ String GodotIOJavaWrapper::get_model() { if (_get_model) { JNIEnv *env = get_jni_env(); ERR_FAIL_COND_V(env == nullptr, String()); - jstring s = (jstring)env->CallObjectMethod(godot_io_instance, _get_model); + jstring s = (jstring)env->CallObjectMethod(io_object, _get_model); return jstring_to_string(s, env); } else { return String(); @@ -130,7 +130,7 @@ int GodotIOJavaWrapper::get_screen_dpi() { if (_get_screen_DPI) { JNIEnv *env = get_jni_env(); ERR_FAIL_COND_V(env == nullptr, 160); - return env->CallIntMethod(godot_io_instance, _get_screen_DPI); + return env->CallIntMethod(io_object, _get_screen_DPI); } else { return 160; } @@ -140,7 +140,7 @@ void GodotIOJavaWrapper::get_window_safe_area(int (&p_rect_xywh)[4]) { if (_get_window_safe_area) { JNIEnv *env = get_jni_env(); ERR_FAIL_COND(env == nullptr); - jintArray returnArray = (jintArray)env->CallObjectMethod(godot_io_instance, _get_window_safe_area); + jintArray returnArray = (jintArray)env->CallObjectMethod(io_object, _get_window_safe_area); ERR_FAIL_COND(env->GetArrayLength(returnArray) != 4); jint *arrayBody = env->GetIntArrayElements(returnArray, JNI_FALSE); for (int i = 0; i < 4; i++) { @@ -154,7 +154,7 @@ String GodotIOJavaWrapper::get_unique_id() { if (_get_unique_id) { JNIEnv *env = get_jni_env(); ERR_FAIL_COND_V(env == nullptr, String()); - jstring s = (jstring)env->CallObjectMethod(godot_io_instance, _get_unique_id); + jstring s = (jstring)env->CallObjectMethod(io_object, _get_unique_id); return jstring_to_string(s, env); } else { return String(); @@ -170,7 +170,7 @@ void GodotIOJavaWrapper::show_vk(const String &p_existing, bool p_multiline, int JNIEnv *env = get_jni_env(); ERR_FAIL_COND(env == nullptr); jstring jStr = env->NewStringUTF(p_existing.utf8().get_data()); - env->CallVoidMethod(godot_io_instance, _show_keyboard, jStr, p_multiline, p_max_input_length, p_cursor_start, p_cursor_end); + env->CallVoidMethod(io_object, _show_keyboard, jStr, p_multiline, p_max_input_length, p_cursor_start, p_cursor_end); } } @@ -178,7 +178,7 @@ void GodotIOJavaWrapper::hide_vk() { if (_hide_keyboard) { JNIEnv *env = get_jni_env(); ERR_FAIL_COND(env == nullptr); - env->CallVoidMethod(godot_io_instance, _hide_keyboard); + env->CallVoidMethod(io_object, _hide_keyboard); } } @@ -186,7 +186,7 @@ void GodotIOJavaWrapper::set_screen_orientation(int p_orient) { if (_set_screen_orientation) { JNIEnv *env = get_jni_env(); ERR_FAIL_COND(env == nullptr); - env->CallVoidMethod(godot_io_instance, _set_screen_orientation, p_orient); + env->CallVoidMethod(io_object, _set_screen_orientation, p_orient); } } @@ -194,7 +194,7 @@ int GodotIOJavaWrapper::get_screen_orientation() const { if (_get_screen_orientation) { JNIEnv *env = get_jni_env(); ERR_FAIL_COND_V(env == nullptr, 0); - return env->CallIntMethod(godot_io_instance, _get_screen_orientation); + return env->CallIntMethod(io_object, _get_screen_orientation); } else { return 0; } @@ -204,7 +204,7 @@ String GodotIOJavaWrapper::get_system_dir(int p_dir, bool p_shared_storage) { if (_get_system_dir) { JNIEnv *env = get_jni_env(); ERR_FAIL_COND_V(env == nullptr, String(".")); - jstring s = (jstring)env->CallObjectMethod(godot_io_instance, _get_system_dir, p_dir, p_shared_storage); + jstring s = (jstring)env->CallObjectMethod(io_object, _get_system_dir, p_dir, p_shared_storage); return jstring_to_string(s, env); } else { return String("."); diff --git a/platform/android/java_godot_io_wrapper.h b/platform/android/java_godot_io_wrapper.h index 08e4faecca..415efdcef2 100644 --- a/platform/android/java_godot_io_wrapper.h +++ b/platform/android/java_godot_io_wrapper.h @@ -42,7 +42,7 @@ // Class that makes functions in java/src/com/rebeltoolbox/rebelengine/GodotIO.java callable from C++ class GodotIOJavaWrapper { private: - jobject godot_io_instance; + jobject io_object; jclass cls; jmethodID _open_URI = 0; @@ -60,7 +60,7 @@ class GodotIOJavaWrapper { jmethodID _get_system_dir = 0; public: - GodotIOJavaWrapper(JNIEnv *p_env, jobject p_godot_io_instance); + GodotIOJavaWrapper(JNIEnv *p_env, jobject io_object); ~GodotIOJavaWrapper(); jobject get_instance(); From a661aea48419786962d4be7a2e70ccd19d8ff5b9 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sun, 11 Jun 2023 10:38:51 +1200 Subject: [PATCH 15/41] Rename java class GodotRenderer to RebelRenderer --- .../src/com/rebeltoolbox/rebelengine/GodotView.java | 10 +++++----- .../src/com/rebeltoolbox/rebelengine/RebelEngine.java | 8 ++++---- .../{GodotRenderer.java => RebelRenderer.java} | 9 +++------ 3 files changed, 12 insertions(+), 15 deletions(-) rename platform/android/java/lib/src/com/rebeltoolbox/rebelengine/{GodotRenderer.java => RebelRenderer.java} (95%) diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotView.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotView.java index 36b4c5503a..afb598eafd 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotView.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotView.java @@ -73,7 +73,7 @@ public class GodotView extends GLSurfaceView { private final RebelFragment rebelFragment; private final GodotInputHandler inputHandler; private final GestureDetector detector; - private final GodotRenderer godotRenderer; + private final RebelRenderer rebelRenderer; public GodotView(Context context, RebelFragment rebelFragment, XRMode xrMode, boolean p_use_gl3, boolean p_use_32_bits, boolean p_use_debug_opengl, boolean p_translucent) { @@ -85,7 +85,7 @@ public GodotView(Context context, RebelFragment rebelFragment, XRMode xrMode, bo this.rebelFragment = rebelFragment; this.inputHandler = new GodotInputHandler(this); this.detector = new GestureDetector(context, new GodotGestureHandler(this)); - this.godotRenderer = new GodotRenderer(); + this.rebelRenderer = new RebelRenderer(); init(xrMode, p_translucent, 16, 0); } @@ -172,7 +172,7 @@ private void init(XRMode xrMode, boolean translucent, int depth, int stencil) { } /* Set the renderer responsible for frame rendering */ - setRenderer(godotRenderer); + setRenderer(rebelRenderer); } public void onBackPressed() { @@ -189,7 +189,7 @@ public void onResume() { queueEvent(() -> { // Resume the renderer - godotRenderer.onActivityResumed(); + rebelRenderer.onActivityResumed(); RebelEngine.focusin(); }); } @@ -201,7 +201,7 @@ public void onPause() { queueEvent(() -> { RebelEngine.focusout(); // Pause the renderer - godotRenderer.onActivityPaused(); + rebelRenderer.onActivityPaused(); }); } } diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelEngine.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelEngine.java index 1a49917874..7b5c17e3d2 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelEngine.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelEngine.java @@ -208,14 +208,14 @@ public class RebelEngine { public static native void setVirtualKeyboardHeight(int p_height); /** - * Invoked on the GL thread when the {@link GodotRenderer} has been resumed. - * @see GodotRenderer#onActivityResumed() + * Invoked on the GL thread when the {@link RebelRenderer} has been resumed. + * @see RebelRenderer#onActivityResumed() */ public static native void onRendererResumed(); /** - * Invoked on the GL thread when the {@link GodotRenderer} has been paused. - * @see GodotRenderer#onActivityPaused() + * Invoked on the GL thread when the {@link RebelRenderer} has been paused. + * @see RebelRenderer#onActivityPaused() */ public static native void onRendererPaused(); } diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotRenderer.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelRenderer.java similarity index 95% rename from platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotRenderer.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelRenderer.java index 73d8f1f466..f1f57764ea 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotRenderer.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelRenderer.java @@ -1,5 +1,5 @@ /*************************************************************************/ -/* GodotRenderer.java */ +/* RebelRenderer.java */ /*************************************************************************/ /* This file is part of: */ /* REBEL ENGINE */ @@ -39,14 +39,11 @@ import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; -/** - * Godot's renderer implementation. - */ -class GodotRenderer implements GLSurfaceView.Renderer { +class RebelRenderer implements GLSurfaceView.Renderer { private final GodotPluginRegistry pluginRegistry; private boolean activityJustResumed = false; - GodotRenderer() { + RebelRenderer() { this.pluginRegistry = GodotPluginRegistry.getPluginRegistry(); } From 86496210bb94548dc982fcfe543a20cf797d42fa Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sun, 11 Jun 2023 12:12:34 +1200 Subject: [PATCH 16/41] Rename java class GodotView to RebelView --- .../rebelengine/RebelFragment.java | 41 +++++++++---------- .../{GodotView.java => RebelView.java} | 8 ++-- .../rebelengine/input/GodotEditText.java | 20 ++++----- .../input/GodotGestureHandler.java | 12 +++--- .../rebelengine/input/GodotInputHandler.java | 16 ++++---- .../input/GodotTextInputWrapper.java | 10 ++--- .../rebelengine/plugin/GodotPlugin.java | 5 ++- 7 files changed, 56 insertions(+), 56 deletions(-) rename platform/android/java/lib/src/com/rebeltoolbox/rebelengine/{GodotView.java => RebelView.java} (97%) diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java index 42267133da..760810a155 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java @@ -198,11 +198,10 @@ protected void registerClass(String p_name, String[] p_methods) { } /** - * Invoked once during the Godot Android initialization process after creation of the - * {@link GodotView} view. - *

+ * Invoked once during Android initialization after creation of the {@link RebelView}. + * * This method should be overridden by descendants of this class that would like to add - * their view/layout to the Godot view hierarchy. + * their view/layout to the view hierarchy. * * @return the view to be included; null if no views should be included. */ @@ -242,7 +241,7 @@ protected void instanceSingleton(SingletonBase s) { private boolean use_apk_expansion; private ViewGroup containerLayout; - public GodotView mView; + public RebelView rebelView; private boolean godot_initialized = false; private SensorManager mSensorManager; @@ -357,22 +356,22 @@ private void onVideoInit() { // ...add to FrameLayout containerLayout.addView(edittext); - mView = new GodotView(activity, this, xrMode, use_gl3, use_32_bits, use_debug_opengl, translucent); - containerLayout.addView(mView, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); - edittext.setView(mView); + rebelView = new RebelView(activity, this, xrMode, use_gl3, use_32_bits, use_debug_opengl, translucent); + containerLayout.addView(rebelView, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); + edittext.setRebelView(rebelView); io.setEdit(edittext); - mView.getViewTreeObserver().addOnGlobalLayoutListener(() -> { + rebelView.getViewTreeObserver().addOnGlobalLayoutListener(() -> { Point fullSize = new Point(); activity.getWindowManager().getDefaultDisplay().getSize(fullSize); Rect gameSize = new Rect(); - mView.getWindowVisibleDisplayFrame(gameSize); + rebelView.getWindowVisibleDisplayFrame(gameSize); final int keyboardHeight = fullSize.y - gameSize.bottom; RebelEngine.setVirtualKeyboardHeight(keyboardHeight); }); final String[] current_command_line = command_line; - mView.queueEvent(() -> { + rebelView.queueEvent(() -> { RebelEngine.setup(current_command_line); // Must occur after RebelEngine.setup has completed. @@ -524,7 +523,7 @@ private boolean isActivityResumed() { */ @Keep private Surface getSurface() { - return mView.getHolder().getSurface(); + return rebelView.getHolder().getSurface(); } /** @@ -764,7 +763,7 @@ public void onPause() { } return; } - mView.onPause(); + rebelView.onPause(); mSensorManager.unregisterListener(this); @@ -802,7 +801,7 @@ public void onResume() { return; } - mView.onResume(); + rebelView.onResume(); mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_GAME); mSensorManager.registerListener(this, mGravity, SensorManager.SENSOR_DELAY_GAME); @@ -869,8 +868,8 @@ public void onSensorChanged(SensorEvent event) { final float z = adjustedValues[2]; final int typeOfSensor = event.sensor.getType(); - if (mView != null) { - mView.queueEvent(() -> { + if (rebelView != null) { + rebelView.queueEvent(() -> { if (typeOfSensor == Sensor.TYPE_ACCELEROMETER) { RebelEngine.accelerometer(-x, y, -z); } @@ -922,8 +921,8 @@ public void onBackPressed() { } } - if (shouldQuit && mView != null) { - mView.queueEvent(RebelEngine::back); + if (shouldQuit && rebelView != null) { + rebelView.queueEvent(RebelEngine::back); } } @@ -933,8 +932,8 @@ public void onBackPressed() { * This must be called after the render thread has started. */ public final void runOnRenderThread(@NonNull Runnable action) { - if (mView != null) { - mView.queueEvent(action); + if (rebelView != null) { + rebelView.queueEvent(action); } } @@ -1100,6 +1099,6 @@ public void onDownloadProgress(DownloadProgressInfo progress) { progress.mOverallTotal)); } public void initInputDevices() { - mView.initInputDevices(); + rebelView.initInputDevices(); } } diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotView.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelView.java similarity index 97% rename from platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotView.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelView.java index afb598eafd..e9a2746fc4 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotView.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelView.java @@ -1,5 +1,5 @@ /*************************************************************************/ -/* GodotView.java */ +/* RebelView.java */ /*************************************************************************/ /* This file is part of: */ /* REBEL ENGINE */ @@ -67,15 +67,15 @@ * that matches it exactly (with regards to red/green/blue/alpha channels * bit depths). Failure to do so would result in an EGL_BAD_MATCH error. */ -public class GodotView extends GLSurfaceView { - private static String TAG = GodotView.class.getSimpleName(); +public class RebelView extends GLSurfaceView { + private static String TAG = RebelView.class.getSimpleName(); private final RebelFragment rebelFragment; private final GodotInputHandler inputHandler; private final GestureDetector detector; private final RebelRenderer rebelRenderer; - public GodotView(Context context, RebelFragment rebelFragment, XRMode xrMode, boolean p_use_gl3, + public RebelView(Context context, RebelFragment rebelFragment, XRMode xrMode, boolean p_use_gl3, boolean p_use_32_bits, boolean p_use_debug_opengl, boolean p_translucent) { super(context); GLUtils.use_gl3 = p_use_gl3; diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotEditText.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotEditText.java index e76cfcb6d6..198086e021 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotEditText.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotEditText.java @@ -55,7 +55,7 @@ public class GodotEditText extends EditText { // =========================================================== // Fields // =========================================================== - private GodotView mView; + private RebelView rebelView; private GodotTextInputWrapper mInputWrapper; private EditHandler sHandler = new EditHandler(this); private String mOriginText; @@ -129,7 +129,7 @@ private void handleMessage(final Message msg) { edit.mInputWrapper.setOriginText(text); edit.addTextChangedListener(edit.mInputWrapper); - final InputMethodManager imm = (InputMethodManager)mView.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); + final InputMethodManager imm = (InputMethodManager)rebelView.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(edit, 0); } } break; @@ -138,9 +138,9 @@ private void handleMessage(final Message msg) { GodotEditText edit = (GodotEditText)msg.obj; edit.removeTextChangedListener(mInputWrapper); - final InputMethodManager imm = (InputMethodManager)mView.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); + final InputMethodManager imm = (InputMethodManager)rebelView.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(edit.getWindowToken(), 0); - edit.mView.requestFocus(); + edit.rebelView.requestFocus(); } break; } } @@ -154,12 +154,12 @@ private void setMaxInputLength(EditText p_edit_text) { // =========================================================== // Getter & Setter // =========================================================== - public void setView(final GodotView view) { - this.mView = view; + public void setRebelView(final RebelView rebelView) { + this.rebelView = rebelView; if (mInputWrapper == null) - mInputWrapper = new GodotTextInputWrapper(mView, this); + mInputWrapper = new GodotTextInputWrapper(rebelView, this); this.setOnEditorActionListener(mInputWrapper); - view.requestFocus(); + rebelView.requestFocus(); } // =========================================================== @@ -169,7 +169,7 @@ public void setView(final GodotView view) { public boolean onKeyDown(final int keyCode, final KeyEvent keyEvent) { /* Let SurfaceView get focus if back key is input. */ // pass event to godot in special cases - if (needHandlingInGodot(keyCode, keyEvent) && mView.getInputHandler().onKeyDown(keyCode, keyEvent)) { + if (needHandlingInGodot(keyCode, keyEvent) && rebelView.getInputHandler().onKeyDown(keyCode, keyEvent)) { return true; } else { return super.onKeyDown(keyCode, keyEvent); @@ -178,7 +178,7 @@ public boolean onKeyDown(final int keyCode, final KeyEvent keyEvent) { @Override public boolean onKeyUp(int keyCode, KeyEvent keyEvent) { - if (needHandlingInGodot(keyCode, keyEvent) && mView.getInputHandler().onKeyUp(keyCode, keyEvent)) { + if (needHandlingInGodot(keyCode, keyEvent) && rebelView.getInputHandler().onKeyUp(keyCode, keyEvent)) { return true; } else { return super.onKeyUp(keyCode, keyEvent); diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotGestureHandler.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotGestureHandler.java index 06d7ace66e..3d2af26886 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotGestureHandler.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotGestureHandler.java @@ -30,25 +30,25 @@ package com.rebeltoolbox.rebelengine.input; -import com.rebeltoolbox.rebelengine.GodotView; import com.rebeltoolbox.rebelengine.RebelEngine; +import com.rebeltoolbox.rebelengine.RebelView; import android.view.GestureDetector; import android.view.MotionEvent; /** - * Handles gesture input related events for the {@link GodotView} view. + * Handles gesture input related events for the {@link RebelView}. * https://developer.android.com/reference/android/view/GestureDetector.SimpleOnGestureListener */ public class GodotGestureHandler extends GestureDetector.SimpleOnGestureListener { - private final GodotView godotView; + private final RebelView rebelView; - public GodotGestureHandler(GodotView godotView) { - this.godotView = godotView; + public GodotGestureHandler(RebelView rebelView) { + this.rebelView = rebelView; } private void queueEvent(Runnable task) { - godotView.queueEvent(task); + rebelView.queueEvent(task); } @Override diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotInputHandler.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotInputHandler.java index 6e1e4b9aea..639aad9c5e 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotInputHandler.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotInputHandler.java @@ -32,8 +32,8 @@ import static com.rebeltoolbox.rebelengine.utils.GLUtils.DEBUG; -import com.rebeltoolbox.rebelengine.GodotView; import com.rebeltoolbox.rebelengine.RebelEngine; +import com.rebeltoolbox.rebelengine.RebelView; import com.rebeltoolbox.rebelengine.input.InputManagerCompat.InputDeviceListener; import android.os.Build; @@ -51,7 +51,7 @@ import java.util.Set; /** - * Handles input related events for the {@link GodotView} view. + * Handles input related events for the {@link RebelView}. */ public class GodotInputHandler implements InputDeviceListener { private final String tag = this.getClass().getSimpleName(); @@ -59,12 +59,12 @@ public class GodotInputHandler implements InputDeviceListener { private final SparseIntArray mJoystickIds = new SparseIntArray(4); private final SparseArray mJoysticksDevices = new SparseArray<>(4); - private final GodotView godotView; + private final RebelView rebelView; private final InputManagerCompat inputManager; - public GodotInputHandler(GodotView godotView) { - this.godotView = godotView; - this.inputManager = InputManagerCompat.Factory.getInputManager(godotView.getContext()); + public GodotInputHandler(RebelView rebelView) { + this.rebelView = rebelView; + this.inputManager = InputManagerCompat.Factory.getInputManager(rebelView.getContext()); this.inputManager.registerInputDeviceListener(this, null); } @@ -105,7 +105,7 @@ public boolean onKeyUp(final int keyCode, KeyEvent event) { public boolean onKeyDown(final int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { - godotView.onBackPressed(); + rebelView.onBackPressed(); // press 'back' button should not terminate program //normal handle 'back' event in game logic return true; @@ -153,7 +153,7 @@ public boolean onTouchEvent(final MotionEvent event) { if (evcount == 0) return true; - if (godotView != null) { + if (rebelView != null) { final float[] arr = new float[event.getPointerCount() * 3]; // pointerId1, x1, y1, pointerId2, etc... for (int i = 0; i < event.getPointerCount(); i++) { diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotTextInputWrapper.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotTextInputWrapper.java index d005f6d3ed..84bb2fe30e 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotTextInputWrapper.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotTextInputWrapper.java @@ -50,7 +50,7 @@ public class GodotTextInputWrapper implements TextWatcher, OnEditorActionListene // =========================================================== // Fields // =========================================================== - private final GodotView mView; + private final RebelView rebelView; private final GodotEditText mEdit; private String mOriginText; private boolean mHasSelection; @@ -59,8 +59,8 @@ public class GodotTextInputWrapper implements TextWatcher, OnEditorActionListene // Constructors // =========================================================== - public GodotTextInputWrapper(final GodotView view, final GodotEditText edit) { - this.mView = view; + public GodotTextInputWrapper(final RebelView rebelView, final GodotEditText edit) { + this.rebelView = rebelView; this.mEdit = edit; } @@ -138,11 +138,11 @@ public boolean onEditorAction(final TextView pTextView, final int pActionID, fin if (pActionID == EditorInfo.IME_ACTION_DONE) { // Enter key has been pressed - mView.queueEvent(() -> { + rebelView.queueEvent(() -> { RebelEngine.key(KeyEvent.KEYCODE_ENTER, KeyEvent.KEYCODE_ENTER, 0, true); RebelEngine.key(KeyEvent.KEYCODE_ENTER, KeyEvent.KEYCODE_ENTER, 0, false); }); - mView.requestFocus(); + rebelView.requestFocus(); return true; } return false; diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPlugin.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPlugin.java index f112176f03..d9d0752791 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPlugin.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPlugin.java @@ -32,6 +32,7 @@ import com.rebeltoolbox.rebelengine.BuildConfig; import com.rebeltoolbox.rebelengine.RebelFragment; +import com.rebeltoolbox.rebelengine.RebelView; import android.app.Activity; import android.content.Intent; @@ -184,8 +185,8 @@ private static Map registerPluginWithGodotNative(Object plug } /** - * Invoked once during the Godot Android initialization process after creation of the - * {@link com.rebeltoolbox.rebelengine.GodotView} view. + * Invoked once during the Rebel Engine initialization process after creation of the + * {@link RebelView}. *

* The plugin can return a non-null {@link View} layout in order to add it to the Godot view * hierarchy. From d62a770be45d1c18e3bd918771ca1cd1d1e9f20b Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sun, 11 Jun 2023 12:38:46 +1200 Subject: [PATCH 17/41] Rename java class GodotEditText to RebelEditText --- .../rebelengine/RebelFragment.java | 14 ++-- .../com/rebeltoolbox/rebelengine/RebelIO.java | 16 ++--- .../input/GodotTextInputWrapper.java | 13 ++-- ...{GodotEditText.java => RebelEditText.java} | 70 +++++++++---------- 4 files changed, 56 insertions(+), 57 deletions(-) rename platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/{GodotEditText.java => RebelEditText.java} (80%) diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java index 760810a155..35fbfdfb2b 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java @@ -33,7 +33,7 @@ import static android.content.Context.MODE_PRIVATE; import static android.content.Context.WINDOW_SERVICE; -import com.rebeltoolbox.rebelengine.input.GodotEditText; +import com.rebeltoolbox.rebelengine.input.RebelEditText; import com.rebeltoolbox.rebelengine.plugin.GodotPlugin; import com.rebeltoolbox.rebelengine.plugin.GodotPluginRegistry; import com.rebeltoolbox.rebelengine.utils.GodotNetUtils; @@ -349,17 +349,17 @@ private void onVideoInit() { containerLayout = new FrameLayout(activity); containerLayout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); - // GodotEditText layout - GodotEditText edittext = new GodotEditText(activity); - edittext.setLayoutParams(new ViewGroup.LayoutParams(LayoutParams.MATCH_PARENT, + // RebelEditText layout + RebelEditText rebelEditText = new RebelEditText(activity); + rebelEditText.setLayoutParams(new ViewGroup.LayoutParams(LayoutParams.MATCH_PARENT, (int)getResources().getDimension(R.dimen.text_edit_height))); // ...add to FrameLayout - containerLayout.addView(edittext); + containerLayout.addView(rebelEditText); rebelView = new RebelView(activity, this, xrMode, use_gl3, use_32_bits, use_debug_opengl, translucent); containerLayout.addView(rebelView, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); - edittext.setRebelView(rebelView); - io.setEdit(edittext); + rebelEditText.setRebelView(rebelView); + io.setRebelEditText(rebelEditText); rebelView.getViewTreeObserver().addOnGlobalLayoutListener(() -> { Point fullSize = new Point(); diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelIO.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelIO.java index 0b17422f4d..5a0335bfc5 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelIO.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelIO.java @@ -30,7 +30,7 @@ package com.rebeltoolbox.rebelengine; -import com.rebeltoolbox.rebelengine.input.GodotEditText; +import com.rebeltoolbox.rebelengine.input.RebelEditText; import android.app.Activity; import android.content.ActivityNotFoundException; @@ -61,7 +61,7 @@ public class RebelIO { private final AssetManager am; private final Activity activity; private final String uniqueId; - GodotEditText edit; + RebelEditText rebelEditText; final int SCREEN_LANDSCAPE = 0; final int SCREEN_PORTRAIT = 1; @@ -249,16 +249,16 @@ public int[] getWindowSafeArea() { } public void showKeyboard(String p_existing_text, boolean p_multiline, int p_max_input_length, int p_cursor_start, int p_cursor_end) { - if (edit != null) - edit.showKeyboard(p_existing_text, p_multiline, p_max_input_length, p_cursor_start, p_cursor_end); + if (rebelEditText != null) + rebelEditText.showKeyboard(p_existing_text, p_multiline, p_max_input_length, p_cursor_start, p_cursor_end); //InputMethodManager inputMgr = (InputMethodManager)activity.getSystemService(Context.INPUT_METHOD_SERVICE); //inputMgr.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); } public void hideKeyboard() { - if (edit != null) - edit.hideKeyboard(); + if (rebelEditText != null) + rebelEditText.hideKeyboard(); } public void setScreenOrientation(int p_orientation) { @@ -318,8 +318,8 @@ public int getScreenOrientation() { } } - public void setEdit(GodotEditText _edit) { - edit = _edit; + public void setRebelEditText(RebelEditText rebelEditText) { + this.rebelEditText = rebelEditText; } public static final int SYSTEM_DIR_DESKTOP = 0; diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotTextInputWrapper.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotTextInputWrapper.java index 84bb2fe30e..88a244547f 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotTextInputWrapper.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotTextInputWrapper.java @@ -51,7 +51,7 @@ public class GodotTextInputWrapper implements TextWatcher, OnEditorActionListene // Fields // =========================================================== private final RebelView rebelView; - private final GodotEditText mEdit; + private final RebelEditText rebelEditText; private String mOriginText; private boolean mHasSelection; @@ -59,9 +59,9 @@ public class GodotTextInputWrapper implements TextWatcher, OnEditorActionListene // Constructors // =========================================================== - public GodotTextInputWrapper(final RebelView rebelView, final GodotEditText edit) { + public GodotTextInputWrapper(final RebelView rebelView, final RebelEditText rebelEditText) { this.rebelView = rebelView; - this.mEdit = edit; + this.rebelEditText = rebelEditText; } // =========================================================== @@ -69,8 +69,7 @@ public GodotTextInputWrapper(final RebelView rebelView, final GodotEditText edit // =========================================================== private boolean isFullScreenEdit() { - final TextView textField = this.mEdit; - final InputMethodManager imm = (InputMethodManager)textField.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); + final InputMethodManager imm = (InputMethodManager)rebelEditText.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); return imm.isFullscreenMode(); } @@ -115,7 +114,7 @@ public void onTextChanged(final CharSequence pCharSequence, final int start, fin } for (int i = 0; i < count; ++i) { int key = newChars[i]; - if ((key == '\n') && !mEdit.isMultiline()) { + if ((key == '\n') && !rebelEditText.isMultiline()) { // Return keys are handled through action events continue; } @@ -126,7 +125,7 @@ public void onTextChanged(final CharSequence pCharSequence, final int start, fin @Override public boolean onEditorAction(final TextView pTextView, final int pActionID, final KeyEvent pKeyEvent) { - if (this.mEdit == pTextView && this.isFullScreenEdit()) { + if (this.rebelEditText == pTextView && this.isFullScreenEdit()) { final String characters = pKeyEvent.getCharacters(); for (int i = 0; i < characters.length(); i++) { diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotEditText.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/RebelEditText.java similarity index 80% rename from platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotEditText.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/RebelEditText.java index 198086e021..26c01511d3 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotEditText.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/RebelEditText.java @@ -1,5 +1,5 @@ /*************************************************************************/ -/* GodotEditText.java */ +/* RebelEditText.java */ /*************************************************************************/ /* This file is part of: */ /* REBEL ENGINE */ @@ -45,7 +45,7 @@ import java.lang.ref.WeakReference; -public class GodotEditText extends EditText { +public class RebelEditText extends EditText { // =========================================================== // Constants // =========================================================== @@ -57,22 +57,22 @@ public class GodotEditText extends EditText { // =========================================================== private RebelView rebelView; private GodotTextInputWrapper mInputWrapper; - private EditHandler sHandler = new EditHandler(this); + private final EditHandler editHandler = new EditHandler(this); private String mOriginText; private int mMaxInputLength = Integer.MAX_VALUE; private boolean mMultiline = false; private static class EditHandler extends Handler { - private final WeakReference mEdit; - public EditHandler(GodotEditText edit) { - mEdit = new WeakReference<>(edit); + private final WeakReference rebelEditTextReference; + public EditHandler(RebelEditText rebelEditText) { + rebelEditTextReference = new WeakReference<>(rebelEditText); } @Override public void handleMessage(Message msg) { - GodotEditText edit = mEdit.get(); - if (edit != null) { - edit.handleMessage(msg); + RebelEditText rebelEditText = rebelEditTextReference.get(); + if (rebelEditText != null) { + rebelEditText.handleMessage(msg); } } } @@ -80,17 +80,17 @@ public void handleMessage(Message msg) { // =========================================================== // Constructors // =========================================================== - public GodotEditText(final Context context) { + public RebelEditText(final Context context) { super(context); this.initView(); } - public GodotEditText(final Context context, final AttributeSet attrs) { + public RebelEditText(final Context context, final AttributeSet attrs) { super(context, attrs); this.initView(); } - public GodotEditText(final Context context, final AttributeSet attrs, final int defStyle) { + public RebelEditText(final Context context, final AttributeSet attrs, final int defStyle) { super(context, attrs, defStyle); this.initView(); } @@ -107,35 +107,35 @@ public boolean isMultiline() { private void handleMessage(final Message msg) { switch (msg.what) { case HANDLER_OPEN_IME_KEYBOARD: { - GodotEditText edit = (GodotEditText)msg.obj; - String text = edit.mOriginText; - if (edit.requestFocus()) { - edit.removeTextChangedListener(edit.mInputWrapper); - setMaxInputLength(edit); - edit.setText(""); - edit.append(text); + RebelEditText rebelEditText = (RebelEditText)msg.obj; + String text = rebelEditText.mOriginText; + if (rebelEditText.requestFocus()) { + rebelEditText.removeTextChangedListener(rebelEditText.mInputWrapper); + setMaxInputLength(rebelEditText); + rebelEditText.setText(""); + rebelEditText.append(text); if (msg.arg2 != -1) { - edit.setSelection(msg.arg1, msg.arg2); - edit.mInputWrapper.setSelection(true); + rebelEditText.setSelection(msg.arg1, msg.arg2); + rebelEditText.mInputWrapper.setSelection(true); } else { - edit.mInputWrapper.setSelection(false); + rebelEditText.mInputWrapper.setSelection(false); } int inputType = InputType.TYPE_CLASS_TEXT; - if (edit.isMultiline()) { + if (rebelEditText.isMultiline()) { inputType |= InputType.TYPE_TEXT_FLAG_MULTI_LINE; } - edit.setInputType(inputType); + rebelEditText.setInputType(inputType); - edit.mInputWrapper.setOriginText(text); - edit.addTextChangedListener(edit.mInputWrapper); + rebelEditText.mInputWrapper.setOriginText(text); + rebelEditText.addTextChangedListener(rebelEditText.mInputWrapper); final InputMethodManager imm = (InputMethodManager)rebelView.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); - imm.showSoftInput(edit, 0); + imm.showSoftInput(rebelEditText, 0); } } break; case HANDLER_CLOSE_IME_KEYBOARD: { - GodotEditText edit = (GodotEditText)msg.obj; + RebelEditText edit = (RebelEditText)msg.obj; edit.removeTextChangedListener(mInputWrapper); final InputMethodManager imm = (InputMethodManager)rebelView.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); @@ -167,9 +167,9 @@ public void setRebelView(final RebelView rebelView) { // =========================================================== @Override public boolean onKeyDown(final int keyCode, final KeyEvent keyEvent) { - /* Let SurfaceView get focus if back key is input. */ - // pass event to godot in special cases - if (needHandlingInGodot(keyCode, keyEvent) && rebelView.getInputHandler().onKeyDown(keyCode, keyEvent)) { + // Let SurfaceView get focus if back key is pressed + // Handle special key events + if (isSpecialKey(keyCode, keyEvent) && rebelView.getInputHandler().onKeyDown(keyCode, keyEvent)) { return true; } else { return super.onKeyDown(keyCode, keyEvent); @@ -178,14 +178,14 @@ public boolean onKeyDown(final int keyCode, final KeyEvent keyEvent) { @Override public boolean onKeyUp(int keyCode, KeyEvent keyEvent) { - if (needHandlingInGodot(keyCode, keyEvent) && rebelView.getInputHandler().onKeyUp(keyCode, keyEvent)) { + if (isSpecialKey(keyCode, keyEvent) && rebelView.getInputHandler().onKeyUp(keyCode, keyEvent)) { return true; } else { return super.onKeyUp(keyCode, keyEvent); } } - private boolean needHandlingInGodot(int keyCode, KeyEvent keyEvent) { + private boolean isSpecialKey(int keyCode, KeyEvent keyEvent) { boolean isArrowKey = keyCode == KeyEvent.KEYCODE_DPAD_UP || keyCode == KeyEvent.KEYCODE_DPAD_DOWN || keyCode == KeyEvent.KEYCODE_DPAD_LEFT || keyCode == KeyEvent.KEYCODE_DPAD_RIGHT; boolean isModifiedKey = keyEvent.isAltPressed() || keyEvent.isCtrlPressed() || keyEvent.isSymPressed() || @@ -217,14 +217,14 @@ public void showKeyboard(String p_existing_text, boolean p_multiline, int p_max_ msg.obj = this; msg.arg1 = p_cursor_start; msg.arg2 = p_cursor_end; - sHandler.sendMessage(msg); + editHandler.sendMessage(msg); } public void hideKeyboard() { final Message msg = new Message(); msg.what = HANDLER_CLOSE_IME_KEYBOARD; msg.obj = this; - sHandler.sendMessage(msg); + editHandler.sendMessage(msg); } // =========================================================== From 4a83ab796483f9df22f7be8c79dd6efad1f4d65f Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sun, 11 Jun 2023 12:48:25 +1200 Subject: [PATCH 18/41] Rename java class GodotGestureHandler to RebelGestureListener --- .../src/com/rebeltoolbox/rebelengine/RebelView.java | 8 ++++---- ...tGestureHandler.java => RebelGestureListener.java} | 11 +++-------- 2 files changed, 7 insertions(+), 12 deletions(-) rename platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/{GodotGestureHandler.java => RebelGestureListener.java} (90%) diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelView.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelView.java index e9a2746fc4..6ac9a402b1 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelView.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelView.java @@ -30,8 +30,8 @@ package com.rebeltoolbox.rebelengine; -import com.rebeltoolbox.rebelengine.input.GodotGestureHandler; import com.rebeltoolbox.rebelengine.input.GodotInputHandler; +import com.rebeltoolbox.rebelengine.input.RebelGestureListener; import com.rebeltoolbox.rebelengine.utils.GLUtils; import com.rebeltoolbox.rebelengine.xr.XRMode; import com.rebeltoolbox.rebelengine.xr.ovr.OvrConfigChooser; @@ -72,7 +72,7 @@ public class RebelView extends GLSurfaceView { private final RebelFragment rebelFragment; private final GodotInputHandler inputHandler; - private final GestureDetector detector; + private final GestureDetector gestureDetector; private final RebelRenderer rebelRenderer; public RebelView(Context context, RebelFragment rebelFragment, XRMode xrMode, boolean p_use_gl3, @@ -84,7 +84,7 @@ public RebelView(Context context, RebelFragment rebelFragment, XRMode xrMode, bo this.rebelFragment = rebelFragment; this.inputHandler = new GodotInputHandler(this); - this.detector = new GestureDetector(context, new GodotGestureHandler(this)); + this.gestureDetector = new GestureDetector(context, new RebelGestureListener(this)); this.rebelRenderer = new RebelRenderer(); init(xrMode, p_translucent, 16, 0); @@ -98,7 +98,7 @@ public void initInputDevices() { @Override public boolean onTouchEvent(MotionEvent event) { super.onTouchEvent(event); - this.detector.onTouchEvent(event); + gestureDetector.onTouchEvent(event); return inputHandler.onTouchEvent(event); } diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotGestureHandler.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/RebelGestureListener.java similarity index 90% rename from platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotGestureHandler.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/RebelGestureListener.java index 3d2af26886..c6a6852076 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotGestureHandler.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/RebelGestureListener.java @@ -1,5 +1,5 @@ /*************************************************************************/ -/* GodotGestureHandler.java */ +/* RebelGestureListener.java */ /*************************************************************************/ /* This file is part of: */ /* REBEL ENGINE */ @@ -40,10 +40,10 @@ * Handles gesture input related events for the {@link RebelView}. * https://developer.android.com/reference/android/view/GestureDetector.SimpleOnGestureListener */ -public class GodotGestureHandler extends GestureDetector.SimpleOnGestureListener { +public class RebelGestureListener extends GestureDetector.SimpleOnGestureListener { private final RebelView rebelView; - public GodotGestureHandler(RebelView rebelView) { + public RebelGestureListener(RebelView rebelView) { this.rebelView = rebelView; } @@ -54,7 +54,6 @@ private void queueEvent(Runnable task) { @Override public boolean onDown(MotionEvent event) { super.onDown(event); - //Log.i("GodotGesture", "onDown"); return true; } @@ -66,12 +65,10 @@ public boolean onSingleTapConfirmed(MotionEvent event) { @Override public void onLongPress(MotionEvent event) { - //Log.i("GodotGesture", "onLongPress"); } @Override public boolean onDoubleTap(MotionEvent event) { - //Log.i("GodotGesture", "onDoubleTap"); final int x = Math.round(event.getX()); final int y = Math.round(event.getY()); final int buttonMask = event.getButtonState(); @@ -81,7 +78,6 @@ public boolean onDoubleTap(MotionEvent event) { @Override public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { - //Log.i("GodotGesture", "onScroll"); final int x = Math.round(distanceX); final int y = Math.round(distanceY); RebelEngine.scroll(x, y); @@ -90,7 +86,6 @@ public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float d @Override public boolean onFling(MotionEvent event1, MotionEvent event2, float velocityX, float velocityY) { - //Log.i("GodotGesture", "onFling"); return true; } } From 5fac265256f3c9d0fb1cc371422e4a47203aedec Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sun, 11 Jun 2023 13:06:26 +1200 Subject: [PATCH 19/41] Rename java class GodotInputHandler RebelInputHandler --- .../rebeltoolbox/rebelengine/RebelView.java | 20 ++++---- .../rebelengine/input/RebelEditText.java | 4 +- ...putHandler.java => RebelInputHandler.java} | 46 +++++++++---------- 3 files changed, 35 insertions(+), 35 deletions(-) rename platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/{GodotInputHandler.java => RebelInputHandler.java} (92%) diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelView.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelView.java index 6ac9a402b1..3878d25c90 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelView.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelView.java @@ -30,8 +30,8 @@ package com.rebeltoolbox.rebelengine; -import com.rebeltoolbox.rebelengine.input.GodotInputHandler; import com.rebeltoolbox.rebelengine.input.RebelGestureListener; +import com.rebeltoolbox.rebelengine.input.RebelInputHandler; import com.rebeltoolbox.rebelengine.utils.GLUtils; import com.rebeltoolbox.rebelengine.xr.XRMode; import com.rebeltoolbox.rebelengine.xr.ovr.OvrConfigChooser; @@ -71,7 +71,7 @@ public class RebelView extends GLSurfaceView { private static String TAG = RebelView.class.getSimpleName(); private final RebelFragment rebelFragment; - private final GodotInputHandler inputHandler; + private final RebelInputHandler rebelInputHandler; private final GestureDetector gestureDetector; private final RebelRenderer rebelRenderer; @@ -83,7 +83,7 @@ public RebelView(Context context, RebelFragment rebelFragment, XRMode xrMode, bo GLUtils.use_debug_opengl = p_use_debug_opengl; this.rebelFragment = rebelFragment; - this.inputHandler = new GodotInputHandler(this); + this.rebelInputHandler = new RebelInputHandler(this); this.gestureDetector = new GestureDetector(context, new RebelGestureListener(this)); this.rebelRenderer = new RebelRenderer(); @@ -91,7 +91,7 @@ public RebelView(Context context, RebelFragment rebelFragment, XRMode xrMode, bo } public void initInputDevices() { - this.inputHandler.initInputDevices(); + rebelInputHandler.initInputDevices(); } @SuppressLint("ClickableViewAccessibility") @@ -99,22 +99,22 @@ public void initInputDevices() { public boolean onTouchEvent(MotionEvent event) { super.onTouchEvent(event); gestureDetector.onTouchEvent(event); - return inputHandler.onTouchEvent(event); + return rebelInputHandler.onTouchEvent(event); } @Override public boolean onKeyUp(final int keyCode, KeyEvent event) { - return inputHandler.onKeyUp(keyCode, event) || super.onKeyUp(keyCode, event); + return rebelInputHandler.onKeyUp(keyCode, event) || super.onKeyUp(keyCode, event); } @Override public boolean onKeyDown(final int keyCode, KeyEvent event) { - return inputHandler.onKeyDown(keyCode, event) || super.onKeyDown(keyCode, event); + return rebelInputHandler.onKeyDown(keyCode, event) || super.onKeyDown(keyCode, event); } @Override public boolean onGenericMotionEvent(MotionEvent event) { - return inputHandler.onGenericMotionEvent(event) || super.onGenericMotionEvent(event); + return rebelInputHandler.onGenericMotionEvent(event) || super.onGenericMotionEvent(event); } private void init(XRMode xrMode, boolean translucent, int depth, int stencil) { @@ -179,8 +179,8 @@ public void onBackPressed() { rebelFragment.onBackPressed(); } - public GodotInputHandler getInputHandler() { - return inputHandler; + public RebelInputHandler getRebelInputHandler() { + return rebelInputHandler; } @Override diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/RebelEditText.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/RebelEditText.java index 26c01511d3..c68a0ce8fc 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/RebelEditText.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/RebelEditText.java @@ -169,7 +169,7 @@ public void setRebelView(final RebelView rebelView) { public boolean onKeyDown(final int keyCode, final KeyEvent keyEvent) { // Let SurfaceView get focus if back key is pressed // Handle special key events - if (isSpecialKey(keyCode, keyEvent) && rebelView.getInputHandler().onKeyDown(keyCode, keyEvent)) { + if (isSpecialKey(keyCode, keyEvent) && rebelView.getRebelInputHandler().onKeyDown(keyCode, keyEvent)) { return true; } else { return super.onKeyDown(keyCode, keyEvent); @@ -178,7 +178,7 @@ public boolean onKeyDown(final int keyCode, final KeyEvent keyEvent) { @Override public boolean onKeyUp(int keyCode, KeyEvent keyEvent) { - if (isSpecialKey(keyCode, keyEvent) && rebelView.getInputHandler().onKeyUp(keyCode, keyEvent)) { + if (isSpecialKey(keyCode, keyEvent) && rebelView.getRebelInputHandler().onKeyUp(keyCode, keyEvent)) { return true; } else { return super.onKeyUp(keyCode, keyEvent); diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotInputHandler.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/RebelInputHandler.java similarity index 92% rename from platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotInputHandler.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/RebelInputHandler.java index 639aad9c5e..e033a010b0 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotInputHandler.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/RebelInputHandler.java @@ -1,5 +1,5 @@ /*************************************************************************/ -/* GodotInputHandler.java */ +/* RebelInputHandler.java */ /*************************************************************************/ /* This file is part of: */ /* REBEL ENGINE */ @@ -53,7 +53,7 @@ /** * Handles input related events for the {@link RebelView}. */ -public class GodotInputHandler implements InputDeviceListener { +public class RebelInputHandler implements InputDeviceListener { private final String tag = this.getClass().getSimpleName(); private final SparseIntArray mJoystickIds = new SparseIntArray(4); @@ -62,7 +62,7 @@ public class GodotInputHandler implements InputDeviceListener { private final RebelView rebelView; private final InputManagerCompat inputManager; - public GodotInputHandler(RebelView rebelView) { + public RebelInputHandler(RebelView rebelView) { this.rebelView = rebelView; this.inputManager = InputManagerCompat.Factory.getInputManager(rebelView.getContext()); this.inputManager.registerInputDeviceListener(this, null); @@ -90,9 +90,9 @@ public boolean onKeyUp(final int keyCode, KeyEvent event) { // Check if the device exists final int deviceId = event.getDeviceId(); if (mJoystickIds.indexOfKey(deviceId) >= 0) { - final int button = getGodotButton(keyCode); - final int godotJoyId = mJoystickIds.get(deviceId); - RebelEngine.joybutton(godotJoyId, button, false); + final int buttonId = getButtonId(keyCode); + final int joystickId = mJoystickIds.get(deviceId); + RebelEngine.joybutton(joystickId, buttonId, false); } } else { final int scanCode = event.getScanCode(); @@ -125,9 +125,9 @@ public boolean onKeyDown(final int keyCode, KeyEvent event) { return true; if (mJoystickIds.indexOfKey(deviceId) >= 0) { - final int button = getGodotButton(keyCode); - final int godotJoyId = mJoystickIds.get(deviceId); - RebelEngine.joybutton(godotJoyId, button, true); + final int buttonId = getButtonId(keyCode); + final int joystickId = mJoystickIds.get(deviceId); + RebelEngine.joybutton(joystickId, buttonId, true); } } else { final int scanCode = event.getScanCode(); @@ -183,7 +183,7 @@ public boolean onGenericMotionEvent(MotionEvent event) { // Check if the device exists final int deviceId = event.getDeviceId(); if (mJoystickIds.indexOfKey(deviceId) >= 0) { - final int godotJoyId = mJoystickIds.get(deviceId); + final int joystickId = mJoystickIds.get(deviceId); Joystick joystick = mJoysticksDevices.get(deviceId); for (int i = 0; i < joystick.axes.size(); i++) { @@ -191,13 +191,13 @@ public boolean onGenericMotionEvent(MotionEvent event) { final float value = event.getAxisValue(axis); /** * As all axes are polled for each event, only fire an axis event if the value has actually changed. - * Prevents flooding Godot with repeated events. + * Prevents flooding Rebel Engine with repeated events. */ if (joystick.axesValues.indexOfKey(axis) < 0 || (float)joystick.axesValues.get(axis) != value) { // save value to prevent repeats joystick.axesValues.put(axis, value); - final int godotAxisIdx = i; - RebelEngine.joyaxis(godotJoyId, godotAxisIdx, value); + final int axisIndex = i; + RebelEngine.joyaxis(joystickId, axisIndex, value); } } @@ -207,7 +207,7 @@ public boolean onGenericMotionEvent(MotionEvent event) { if (joystick.hatX != hatX || joystick.hatY != hatY) { joystick.hatX = hatX; joystick.hatY = hatY; - RebelEngine.joyhat(godotJoyId, hatX, hatY); + RebelEngine.joyhat(joystickId, hatX, hatY); } } return true; @@ -240,12 +240,12 @@ public void initInputDevices() { } private int assignJoystickIdNumber(int deviceId) { - int godotJoyId = 0; - while (mJoystickIds.indexOfValue(godotJoyId) >= 0) { - godotJoyId++; + int joystickId = 0; + while (mJoystickIds.indexOfValue(joystickId) >= 0) { + joystickId++; } - mJoystickIds.put(deviceId, godotJoyId); - return godotJoyId; + mJoystickIds.put(deviceId, joystickId); + return joystickId; } @Override @@ -303,7 +303,7 @@ public void onInputDeviceAdded(int deviceId) { Collections.sort(joystick.axes); for (int idx = 0; idx < joystick.axes.size(); idx++) { //Helps with creating new joypad mappings. - Log.i(tag, " - Mapping Android axis " + joystick.axes.get(idx) + " to Godot axis " + idx); + Log.i(tag, " - Mapping Android axis " + joystick.axes.get(idx) + " to Rebel Engine axis " + idx); } mJoysticksDevices.put(deviceId, joystick); @@ -316,10 +316,10 @@ public void onInputDeviceRemoved(int deviceId) { if (mJoystickIds.indexOfKey(deviceId) < 0) { return; } - final int godotJoyId = mJoystickIds.get(deviceId); + final int joystickId = mJoystickIds.get(deviceId); mJoystickIds.delete(deviceId); mJoysticksDevices.delete(deviceId); - RebelEngine.joyconnectionchanged(godotJoyId, false, ""); + RebelEngine.joyconnectionchanged(joystickId, false, ""); } @Override @@ -335,7 +335,7 @@ public int compare(MotionRange arg0, MotionRange arg1) { } } - public static int getGodotButton(int keyCode) { + public static int getButtonId(int keyCode) { int button; switch (keyCode) { case KeyEvent.KEYCODE_BUTTON_A: // Android A is SNES B From 8dd1c0661470acfa84d9a39c5a509dadd951b97f Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sun, 11 Jun 2023 13:17:15 +1200 Subject: [PATCH 20/41] Rename java class GodotTextInputWrapper to RebelTextInputWrapper --- .../rebelengine/input/RebelEditText.java | 20 +++++++++---------- ...rapper.java => RebelTextInputWrapper.java} | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) rename platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/{GodotTextInputWrapper.java => RebelTextInputWrapper.java} (96%) diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/RebelEditText.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/RebelEditText.java index c68a0ce8fc..59bc64c107 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/RebelEditText.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/RebelEditText.java @@ -56,7 +56,7 @@ public class RebelEditText extends EditText { // Fields // =========================================================== private RebelView rebelView; - private GodotTextInputWrapper mInputWrapper; + private RebelTextInputWrapper rebelTextInputWrapper; private final EditHandler editHandler = new EditHandler(this); private String mOriginText; private int mMaxInputLength = Integer.MAX_VALUE; @@ -110,15 +110,15 @@ private void handleMessage(final Message msg) { RebelEditText rebelEditText = (RebelEditText)msg.obj; String text = rebelEditText.mOriginText; if (rebelEditText.requestFocus()) { - rebelEditText.removeTextChangedListener(rebelEditText.mInputWrapper); + rebelEditText.removeTextChangedListener(rebelEditText.rebelTextInputWrapper); setMaxInputLength(rebelEditText); rebelEditText.setText(""); rebelEditText.append(text); if (msg.arg2 != -1) { rebelEditText.setSelection(msg.arg1, msg.arg2); - rebelEditText.mInputWrapper.setSelection(true); + rebelEditText.rebelTextInputWrapper.setSelection(true); } else { - rebelEditText.mInputWrapper.setSelection(false); + rebelEditText.rebelTextInputWrapper.setSelection(false); } int inputType = InputType.TYPE_CLASS_TEXT; @@ -127,8 +127,8 @@ private void handleMessage(final Message msg) { } rebelEditText.setInputType(inputType); - rebelEditText.mInputWrapper.setOriginText(text); - rebelEditText.addTextChangedListener(rebelEditText.mInputWrapper); + rebelEditText.rebelTextInputWrapper.setOriginText(text); + rebelEditText.addTextChangedListener(rebelEditText.rebelTextInputWrapper); final InputMethodManager imm = (InputMethodManager)rebelView.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(rebelEditText, 0); } @@ -137,7 +137,7 @@ private void handleMessage(final Message msg) { case HANDLER_CLOSE_IME_KEYBOARD: { RebelEditText edit = (RebelEditText)msg.obj; - edit.removeTextChangedListener(mInputWrapper); + edit.removeTextChangedListener(rebelTextInputWrapper); final InputMethodManager imm = (InputMethodManager)rebelView.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(edit.getWindowToken(), 0); edit.rebelView.requestFocus(); @@ -156,9 +156,9 @@ private void setMaxInputLength(EditText p_edit_text) { // =========================================================== public void setRebelView(final RebelView rebelView) { this.rebelView = rebelView; - if (mInputWrapper == null) - mInputWrapper = new GodotTextInputWrapper(rebelView, this); - this.setOnEditorActionListener(mInputWrapper); + if (rebelTextInputWrapper == null) + rebelTextInputWrapper = new RebelTextInputWrapper(rebelView, this); + setOnEditorActionListener(rebelTextInputWrapper); rebelView.requestFocus(); } diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotTextInputWrapper.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/RebelTextInputWrapper.java similarity index 96% rename from platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotTextInputWrapper.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/RebelTextInputWrapper.java index 88a244547f..af7b42965d 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/GodotTextInputWrapper.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/input/RebelTextInputWrapper.java @@ -1,5 +1,5 @@ /*************************************************************************/ -/* GodotTextInputWrapper.java */ +/* RebelTextInputWrapper.java */ /*************************************************************************/ /* This file is part of: */ /* REBEL ENGINE */ @@ -41,11 +41,11 @@ import android.widget.TextView; import android.widget.TextView.OnEditorActionListener; -public class GodotTextInputWrapper implements TextWatcher, OnEditorActionListener { +public class RebelTextInputWrapper implements TextWatcher, OnEditorActionListener { // =========================================================== // Constants // =========================================================== - private static final String TAG = GodotTextInputWrapper.class.getSimpleName(); + private static final String TAG = RebelTextInputWrapper.class.getSimpleName(); // =========================================================== // Fields @@ -59,7 +59,7 @@ public class GodotTextInputWrapper implements TextWatcher, OnEditorActionListene // Constructors // =========================================================== - public GodotTextInputWrapper(final RebelView rebelView, final RebelEditText rebelEditText) { + public RebelTextInputWrapper(final RebelView rebelView, final RebelEditText rebelEditText) { this.rebelView = rebelView; this.rebelEditText = rebelEditText; } From c24b128750afe21dc05fb8627326cbc9f6de14c5 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sun, 11 Jun 2023 13:40:27 +1200 Subject: [PATCH 21/41] Rename java abstract class GodotPlugin to RebelPlugin --- .../rebelengine/RebelFragment.java | 54 +++++++++---------- .../rebelengine/RebelRenderer.java | 14 ++--- .../plugin/GodotPluginRegistry.java | 53 ++++++++---------- .../{GodotPlugin.java => RebelPlugin.java} | 49 +++++++++-------- .../rebelengine/plugin/SignalInfo.java | 2 +- platform/android/plugin/godot_plugin_jni.cpp | 10 ++-- platform/android/plugin/godot_plugin_jni.h | 10 ++-- 7 files changed, 92 insertions(+), 100 deletions(-) rename platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/{GodotPlugin.java => RebelPlugin.java} (89%) diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java index 35fbfdfb2b..2dc06ada1a 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java @@ -34,8 +34,8 @@ import static android.content.Context.WINDOW_SERVICE; import com.rebeltoolbox.rebelengine.input.RebelEditText; -import com.rebeltoolbox.rebelengine.plugin.GodotPlugin; import com.rebeltoolbox.rebelengine.plugin.GodotPluginRegistry; +import com.rebeltoolbox.rebelengine.plugin.RebelPlugin; import com.rebeltoolbox.rebelengine.utils.GodotNetUtils; import com.rebeltoolbox.rebelengine.utils.PermissionsUtil; import com.rebeltoolbox.rebelengine.xr.XRMode; @@ -165,7 +165,7 @@ private void setButtonPausedState(boolean paused) { static public class SingletonBase { protected void registerClass(String p_name, String[] p_methods) { - GodotPlugin.nativeRegisterSingleton(p_name, this); + RebelPlugin.nativeRegisterSingleton(p_name, this); Class clazz = getClass(); Method[] methods = clazz.getDeclaredMethods(); @@ -191,7 +191,7 @@ protected void registerClass(String p_name, String[] p_methods) { String[] pt = new String[ptr.size()]; ptr.toArray(pt); - GodotPlugin.nativeRegisterMethod(p_name, method.getName(), method.getReturnType().getName(), pt); + RebelPlugin.nativeRegisterMethod(p_name, method.getName(), method.getReturnType().getName(), pt); } RebelFragment.singletons[RebelFragment.singleton_count++] = this; @@ -289,8 +289,8 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { for (int i = 0; i < singleton_count; i++) { singletons[i].onMainActivityResult(requestCode, resultCode, data); } - for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) { - plugin.onMainActivityResult(requestCode, resultCode, data); + for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + rebelPlugin.onMainActivityResult(requestCode, resultCode, data); } } @@ -301,8 +301,8 @@ public void onRequestPermissionsResult(int requestCode, String[] permissions, in for (int i = 0; i < singleton_count; i++) { singletons[i].onMainRequestPermissionsResult(requestCode, permissions, grantResults); } - for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) { - plugin.onMainRequestPermissionsResult(requestCode, permissions, grantResults); + for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + rebelPlugin.onMainRequestPermissionsResult(requestCode, permissions, grantResults); } for (int i = 0; i < permissions.length; i++) { @@ -315,8 +315,8 @@ public void onRequestPermissionsResult(int requestCode, String[] permissions, in */ @CallSuper protected void onGodotSetupCompleted() { - for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) { - plugin.onGodotSetupCompleted(); + for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + rebelPlugin.onGodotSetupCompleted(); } if (rebelHost != null) { @@ -329,8 +329,8 @@ protected void onGodotSetupCompleted() { */ @CallSuper protected void onGodotMainLoopStarted() { - for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) { - plugin.onGodotMainLoopStarted(); + for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + rebelPlugin.onGodotMainLoopStarted(); } if (rebelHost != null) { @@ -375,14 +375,14 @@ private void onVideoInit() { RebelEngine.setup(current_command_line); // Must occur after RebelEngine.setup has completed. - for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) { - plugin.onRegisterPluginWithGodotNative(); + for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + rebelPlugin.onRegisterPluginWithGodotNative(); } setKeepScreenOn("True".equals(RebelEngine.getGlobal("display/window/energy_saving/keep_screen_on"))); - // The Godot Android plugins are setup on completion of RebelEngine.setup + // The Rebel Plugins are setup on completion of RebelEngine.setup mainThreadHandler.post(() -> { - // Include the non-null views returned in the Godot view hierarchy. + // Include all the non-null views. for (int i = 0; i < singleton_count; i++) { View view = singletons[i].onMainCreateView(activity); if (view != null) { @@ -392,11 +392,11 @@ private void onVideoInit() { }); }); - // Include the returned non-null views in the Godot view hierarchy. - for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) { - View pluginView = plugin.onMainCreate(activity); + // Include all the non-null views. + for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + View pluginView = rebelPlugin.onMainCreate(activity); if (pluginView != null) { - if (plugin.shouldBeOnTop()) { + if (rebelPlugin.shouldBeOnTop()) { containerLayout.addView(pluginView); } else { containerLayout.addView(pluginView, 0); @@ -741,8 +741,8 @@ public void onDestroy() { for (int i = 0; i < singleton_count; i++) { singletons[i].onMainDestroy(); } - for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) { - plugin.onMainDestroy(); + for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + rebelPlugin.onMainDestroy(); } RebelEngine.ondestroy(); @@ -770,8 +770,8 @@ public void onPause() { for (int i = 0; i < singleton_count; i++) { singletons[i].onMainPause(); } - for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) { - plugin.onMainPause(); + for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + rebelPlugin.onMainPause(); } } @@ -822,8 +822,8 @@ public void onResume() { for (int i = 0; i < singleton_count; i++) { singletons[i].onMainResume(); } - for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) { - plugin.onMainResume(); + for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + rebelPlugin.onMainResume(); } } @@ -915,8 +915,8 @@ public void onBackPressed() { shouldQuit = false; } } - for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) { - if (plugin.onMainBackPressed()) { + for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + if (rebelPlugin.onMainBackPressed()) { shouldQuit = false; } } diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelRenderer.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelRenderer.java index f1f57764ea..fa272f8964 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelRenderer.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelRenderer.java @@ -30,8 +30,8 @@ package com.rebeltoolbox.rebelengine; -import com.rebeltoolbox.rebelengine.plugin.GodotPlugin; import com.rebeltoolbox.rebelengine.plugin.GodotPluginRegistry; +import com.rebeltoolbox.rebelengine.plugin.RebelPlugin; import com.rebeltoolbox.rebelengine.utils.GLUtils; import android.opengl.GLSurfaceView; @@ -57,8 +57,8 @@ public void onDrawFrame(GL10 gl) { for (int i = 0; i < RebelFragment.singleton_count; i++) { RebelFragment.singletons[i].onGLDrawFrame(gl); } - for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) { - plugin.onGLDrawFrame(gl); + for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + rebelPlugin.onGLDrawFrame(gl); } } @@ -67,15 +67,15 @@ public void onSurfaceChanged(GL10 gl, int width, int height) { for (int i = 0; i < RebelFragment.singleton_count; i++) { RebelFragment.singletons[i].onGLSurfaceChanged(gl, width, height); } - for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) { - plugin.onGLSurfaceChanged(gl, width, height); + for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + rebelPlugin.onGLSurfaceChanged(gl, width, height); } } public void onSurfaceCreated(GL10 gl, EGLConfig config) { RebelEngine.newcontext(GLUtils.use_32); - for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) { - plugin.onGLSurfaceCreated(gl, config); + for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + rebelPlugin.onGLSurfaceCreated(gl, config); } } diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPluginRegistry.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPluginRegistry.java index b99d8c8b25..8576d900dc 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPluginRegistry.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPluginRegistry.java @@ -52,10 +52,10 @@ public final class GodotPluginRegistry { private static final String TAG = GodotPluginRegistry.class.getSimpleName(); - private static final String GODOT_PLUGIN_V1_NAME_PREFIX = "org.godotengine.plugin.v1."; + private static final String META_DATA_NAME_PREFIX = "rebel.plugin."; private static GodotPluginRegistry instance; - private final ConcurrentHashMap registry; + private final ConcurrentHashMap registry; private GodotPluginRegistry(RebelFragment rebelFragment) { registry = new ConcurrentHashMap<>(); @@ -65,24 +65,24 @@ private GodotPluginRegistry(RebelFragment rebelFragment) { /** * Retrieve the plugin tied to the given plugin name. * @param pluginName Name of the plugin - * @return {@link GodotPlugin} handle if it exists, null otherwise. + * @return {@link RebelPlugin} handle if it exists, null otherwise. */ @Nullable - public GodotPlugin getPlugin(String pluginName) { + public RebelPlugin getPlugin(String pluginName) { return registry.get(pluginName); } /** * Retrieve the full set of loaded plugins. */ - public Collection getAllPlugins() { + public Collection getAllPlugins() { return registry.values(); } /** * Parse the manifest file and load all included Godot Android plugins. *

- * A plugin manifest entry is a '' tag setup as described in the {@link GodotPlugin} + * A plugin manifest entry is a '' tag setup as described in the {@link RebelPlugin} * documentation. * * @param rebelFragment Rebel Fragment @@ -123,12 +123,11 @@ private void loadPlugins(RebelFragment rebelFragment) { return; } - int godotPluginV1NamePrefixLength = GODOT_PLUGIN_V1_NAME_PREFIX.length(); for (String metaDataName : metaData.keySet()) { - // Parse the meta-data looking for entry with the Godot plugin name prefix. - if (metaDataName.startsWith(GODOT_PLUGIN_V1_NAME_PREFIX)) { - String pluginName = metaDataName.substring(godotPluginV1NamePrefixLength).trim(); - Log.i(TAG, "Initializing Godot plugin " + pluginName); + // Parse the meta-data looking for entry with the Rebel Plugin name prefix. + if (metaDataName.startsWith(META_DATA_NAME_PREFIX)) { + String rebelPluginName = metaDataName.substring(META_DATA_NAME_PREFIX.length()).trim(); + Log.i(TAG, "Initializing Rebel plugin " + rebelPluginName); // Retrieve the plugin class full name. String pluginHandleClassFullName = metaData.getString(metaDataName); @@ -136,37 +135,31 @@ private void loadPlugins(RebelFragment rebelFragment) { try { // Attempt to create the plugin init class via reflection. @SuppressWarnings("unchecked") - Class pluginClass = (Class)Class + Class pluginClass = (Class)Class .forName(pluginHandleClassFullName); - Constructor pluginConstructor = pluginClass + Constructor pluginConstructor = pluginClass .getConstructor(RebelFragment.class); - GodotPlugin pluginHandle = pluginConstructor.newInstance(rebelFragment); + RebelPlugin rebelPlugin = pluginConstructor.newInstance(rebelFragment); // Load the plugin initializer into the registry using the plugin name as key. - if (!pluginName.equals(pluginHandle.getPluginName())) { + if (!rebelPluginName.equals(rebelPlugin.getPluginName())) { Log.w(TAG, - "Meta-data plugin name does not match the value returned by the plugin handle: " + pluginName + " =/= " + pluginHandle.getPluginName()); + "Meta-data plugin name does not match the value returned by the plugin handle: " + rebelPluginName + " =/= " + rebelPlugin.getPluginName()); } - registry.put(pluginName, pluginHandle); - Log.i(TAG, "Completed initialization for Godot plugin " + pluginHandle.getPluginName()); - } catch (ClassNotFoundException e) { - Log.w(TAG, "Unable to load Godot plugin " + pluginName, e); - } catch (IllegalAccessException e) { - Log.w(TAG, "Unable to load Godot plugin " + pluginName, e); - } catch (InstantiationException e) { - Log.w(TAG, "Unable to load Godot plugin " + pluginName, e); - } catch (NoSuchMethodException e) { - Log.w(TAG, "Unable to load Godot plugin " + pluginName, e); - } catch (InvocationTargetException e) { - Log.w(TAG, "Unable to load Godot plugin " + pluginName, e); + registry.put(rebelPluginName, rebelPlugin); + Log.i(TAG, "Completed initialization for Rebel plugin " + rebelPluginName); + } catch (ClassNotFoundException | IllegalAccessException | + InstantiationException | NoSuchMethodException | + InvocationTargetException e) { + Log.w(TAG, "Unable to load Rebel plugin " + rebelPluginName, e); } } else { - Log.w(TAG, "Invalid plugin loader class for " + pluginName); + Log.w(TAG, "Invalid plugin loader class for " + rebelPluginName); } } } } catch (PackageManager.NameNotFoundException e) { - Log.e(TAG, "Unable load Godot Android plugins from the manifest file.", e); + Log.e(TAG, "Unable load Rebel plugins from the manifest file.", e); } } } diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPlugin.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPlugin.java similarity index 89% rename from platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPlugin.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPlugin.java index d9d0752791..a35aa2e193 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPlugin.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPlugin.java @@ -1,5 +1,5 @@ /*************************************************************************/ -/* GodotPlugin.java */ +/* RebelPlugin.java */ /*************************************************************************/ /* This file is part of: */ /* REBEL ENGINE */ @@ -57,35 +57,33 @@ import javax.microedition.khronos.opengles.GL10; /** - * Base class for the Godot Android plugins. + * Base class for the Rebel plugins. *

- * A Godot Android plugin is a regular Android library packaged as an aar archive file with the following caveats: + * A Rebel plugin is a regular Android library packaged as an aar archive file with the following caveats: *

- * - The library must have a dependency on the Godot Android library (godot-lib.aar). + * - The library must have a dependency on the Rebel Android library (rebel-lib.aar). * A stable version is available for each release. *

* - The library must include a tag in its manifest file setup as follow: - * + * * Where: - * - 'PluginName' is the name of the plugin. - * - 'plugin.init.ClassFullName' is the full name (package + class name) of the plugin class - * extending {@link GodotPlugin}. + * - 'PluginName' is the name of the Rebel plugin. + * - 'Plugin.Class.Name' is the full name (package + class name) of the plugin class that + * extends {@link RebelPlugin}. * * A plugin can also define and provide c/c++ gdnative libraries and nativescripts for the target * app/game to leverage. * The shared library for the gdnative library will be automatically bundled by the aar build * system. - * Godot '*.gdnlib' and '*.gdns' resource files must however be manually defined in the project - * 'assets' directory. The recommended path for these resources in the 'assets' directory should be: - * 'godot/plugin/v1/[PluginName]/' + * '*.gdnlib' and '*.gdns' resource files must however be manually defined in the project. */ -public abstract class GodotPlugin { - private static final String TAG = GodotPlugin.class.getSimpleName(); +public abstract class RebelPlugin { + private static final String TAG = RebelPlugin.class.getSimpleName(); private final RebelFragment rebelFragment; private final ConcurrentHashMap registeredSignals = new ConcurrentHashMap<>(); - public GodotPlugin(RebelFragment rebelFragment) { + public RebelPlugin(RebelFragment rebelFragment) { this.rebelFragment = rebelFragment; } @@ -188,11 +186,11 @@ private static Map registerPluginWithGodotNative(Object plug * Invoked once during the Rebel Engine initialization process after creation of the * {@link RebelView}. *

- * The plugin can return a non-null {@link View} layout in order to add it to the Godot view + * The plugin can return a non-null {@link View} layout in order to add it to the view * hierarchy. * * Use shouldBeOnTop() to set whether the plugin's {@link View} should be added on top or behind - * the main Godot view. + * the main view. * * @see Activity#onCreate(Bundle) * @return the plugin's view to be included; null if no views should be included. @@ -299,10 +297,10 @@ protected Set getPluginGDNativeLibrariesPaths() { /** * Returns whether the plugin's {@link View} returned in onMainCreate() should be placed on - * top of the main Godot view. + * top of the main view. * * Returning false causes the plugin's {@link View} to be placed behind, which can be useful - * when used with transparency in order to let the Godot view handle inputs. + * when used with transparency in order to let the main view handle inputs. */ public boolean shouldBeOnTop() { return true; @@ -329,7 +327,7 @@ protected void runOnRenderThread(Runnable action) { } /** - * Emit a registered Godot signal. + * Emit a registered signal. * @param signalName Name of the signal to emit. It will be validated against the set of registered signals. * @param signalArgs Arguments used to populate the emitted signal. The arguments will be validated against the {@link SignalInfo} matching the registered signalName parameter. */ @@ -351,9 +349,10 @@ protected void emitSignal(final String signalName, final Object... signalArgs) { } /** - * Emit a Godot signal. + * Emit a signal. * @param rebelFragment - * @param pluginName Name of the Godot plugin the signal will be emitted from. The plugin must already be registered with the Godot engine. + * @param pluginName Name of the Rebel plugin the signal will be emitted from. + * The plugin must already be registered with the Rebel Engine. * @param signalInfo Information about the signal to emit. * @param signalArgs Arguments used to populate the emitted signal. The arguments will be validated against the given {@link SignalInfo} parameter. */ @@ -389,13 +388,13 @@ public static void emitSignal(RebelFragment rebelFragment, String pluginName, Si } /** - * Used to setup a {@link GodotPlugin} instance. + * Used to setup a {@link RebelPlugin} instance. * @param p_name Name of the instance. */ public static native void nativeRegisterSingleton(String p_name, Object object); /** - * Used to complete registration of the {@link GodotPlugin} instance's methods. + * Used to complete registration of the {@link RebelPlugin} instance's methods. * @param p_sname Name of the instance * @param p_name Name of the method to register * @param p_ret Return type of the registered method @@ -410,7 +409,7 @@ public static void emitSignal(RebelFragment rebelFragment, String pluginName, Si private static native void nativeRegisterGDNativeLibraries(String[] gdnlibPaths); /** - * Used to complete registration of the {@link GodotPlugin} instance's methods. + * Used to complete registration of the {@link RebelPlugin} instance's methods. * @param pluginName Name of the plugin * @param signalName Name of the signal to register * @param signalParamTypes Signal parameters types @@ -418,7 +417,7 @@ public static void emitSignal(RebelFragment rebelFragment, String pluginName, Si private static native void nativeRegisterSignal(String pluginName, String signalName, String[] signalParamTypes); /** - * Used to emit signal by {@link GodotPlugin} instance. + * Used to emit signal by {@link RebelPlugin} instance. * @param pluginName Name of the plugin * @param signalName Name of the signal to emit * @param signalParams Signal parameters diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/SignalInfo.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/SignalInfo.java index ebba103e71..7b54102276 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/SignalInfo.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/SignalInfo.java @@ -37,7 +37,7 @@ import java.util.Arrays; /** - * Store information about a {@link GodotPlugin}'s signal. + * Store information about a {@link RebelPlugin}'s signal. */ public final class SignalInfo { private final String name; diff --git a/platform/android/plugin/godot_plugin_jni.cpp b/platform/android/plugin/godot_plugin_jni.cpp index c4ed879bcf..e7b1aa3dbd 100644 --- a/platform/android/plugin/godot_plugin_jni.cpp +++ b/platform/android/plugin/godot_plugin_jni.cpp @@ -41,7 +41,7 @@ static HashMap jni_singletons; extern "C" { -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nativeRegisterSingleton(JNIEnv *env, jclass clazz, jstring name, jobject obj) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_RebelPlugin_nativeRegisterSingleton(JNIEnv *env, jclass clazz, jstring name, jobject obj) { String singname = jstring_to_string(name, env); JNISingleton *s = (JNISingleton *)ClassDB::instance("JNISingleton"); s->set_instance(env->NewGlobalRef(obj)); @@ -51,7 +51,7 @@ JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nati ProjectSettings::get_singleton()->set(singname, s); } -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nativeRegisterMethod(JNIEnv *env, jclass clazz, jstring sname, jstring name, jstring ret, jobjectArray args) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_RebelPlugin_nativeRegisterMethod(JNIEnv *env, jclass clazz, jstring sname, jstring name, jstring ret, jobjectArray args) { String singname = jstring_to_string(sname, env); ERR_FAIL_COND(!jni_singletons.has(singname)); @@ -83,7 +83,7 @@ JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nati s->add_method(mname, mid, types, get_jni_type(retval)); } -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nativeRegisterSignal(JNIEnv *env, jclass clazz, jstring j_plugin_name, jstring j_signal_name, jobjectArray j_signal_param_types) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_RebelPlugin_nativeRegisterSignal(JNIEnv *env, jclass clazz, jstring j_plugin_name, jstring j_signal_name, jobjectArray j_signal_param_types) { String singleton_name = jstring_to_string(j_plugin_name, env); ERR_FAIL_COND(!jni_singletons.has(singleton_name)); @@ -104,7 +104,7 @@ JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nati singleton->add_signal(signal_name, types); } -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nativeEmitSignal(JNIEnv *env, jclass clazz, jstring j_plugin_name, jstring j_signal_name, jobjectArray j_signal_params) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_RebelPlugin_nativeEmitSignal(JNIEnv *env, jclass clazz, jstring j_plugin_name, jstring j_signal_name, jobjectArray j_signal_params) { String singleton_name = jstring_to_string(j_plugin_name, env); ERR_FAIL_COND(!jni_singletons.has(singleton_name)); @@ -129,7 +129,7 @@ JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nati singleton->emit_signal(signal_name, args, count); } -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nativeRegisterGDNativeLibraries(JNIEnv *env, jclass clazz, jobjectArray gdnlib_paths) { +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_RebelPlugin_nativeRegisterGDNativeLibraries(JNIEnv *env, jclass clazz, jobjectArray gdnlib_paths) { int gdnlib_count = env->GetArrayLength(gdnlib_paths); if (gdnlib_count == 0) { return; diff --git a/platform/android/plugin/godot_plugin_jni.h b/platform/android/plugin/godot_plugin_jni.h index 332c79404a..3e0b5519e0 100644 --- a/platform/android/plugin/godot_plugin_jni.h +++ b/platform/android/plugin/godot_plugin_jni.h @@ -35,11 +35,11 @@ #include extern "C" { -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nativeRegisterSingleton(JNIEnv *env, jclass clazz, jstring name, jobject obj); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nativeRegisterMethod(JNIEnv *env, jclass clazz, jstring sname, jstring name, jstring ret, jobjectArray args); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nativeRegisterSignal(JNIEnv *env, jclass clazz, jstring j_plugin_name, jstring j_signal_name, jobjectArray j_signal_param_types); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nativeEmitSignal(JNIEnv *env, jclass clazz, jstring j_plugin_name, jstring j_signal_name, jobjectArray j_signal_params); -JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_GodotPlugin_nativeRegisterGDNativeLibraries(JNIEnv *env, jclass clazz, jobjectArray gdnlib_paths); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_RebelPlugin_nativeRegisterSingleton(JNIEnv *env, jclass clazz, jstring name, jobject obj); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_RebelPlugin_nativeRegisterMethod(JNIEnv *env, jclass clazz, jstring sname, jstring name, jstring ret, jobjectArray args); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_RebelPlugin_nativeRegisterSignal(JNIEnv *env, jclass clazz, jstring j_plugin_name, jstring j_signal_name, jobjectArray j_signal_param_types); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_RebelPlugin_nativeEmitSignal(JNIEnv *env, jclass clazz, jstring j_plugin_name, jstring j_signal_name, jobjectArray j_signal_params); +JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_plugin_RebelPlugin_nativeRegisterGDNativeLibraries(JNIEnv *env, jclass clazz, jobjectArray gdnlib_paths); } #endif // GODOT_PLUGIN_JNI_H From 35d6ae66de0a8031b5782d5b66a32509e8cf1171 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sun, 11 Jun 2023 13:46:14 +1200 Subject: [PATCH 22/41] Rename java interface GodotPluginInfoProvider to RebelPluginInfoProvider --- .../rebelengine/plugin/RebelPlugin.java | 10 +++++----- ...foProvider.java => RebelPluginInfoProvider.java} | 13 ++----------- 2 files changed, 7 insertions(+), 16 deletions(-) rename platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/{GodotPluginInfoProvider.java => RebelPluginInfoProvider.java} (90%) diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPlugin.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPlugin.java index a35aa2e193..0db3c6cddc 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPlugin.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPlugin.java @@ -119,13 +119,13 @@ public final void onRegisterPluginWithGodotNative() { * This method must be invoked on the render thread. */ public static void registerPluginWithGodotNative(Object pluginObject, - GodotPluginInfoProvider pluginInfoProvider) { - registerPluginWithGodotNative(pluginObject, pluginInfoProvider.getPluginName(), - Collections.emptyList(), pluginInfoProvider.getPluginSignals(), - pluginInfoProvider.getPluginGDNativeLibrariesPaths()); + RebelPluginInfoProvider rebelPluginInfoProvider) { + registerPluginWithGodotNative(pluginObject, rebelPluginInfoProvider.getPluginName(), + Collections.emptyList(), rebelPluginInfoProvider.getPluginSignals(), + rebelPluginInfoProvider.getPluginGDNativeLibrariesPaths()); // Notify that registration is complete. - pluginInfoProvider.onPluginRegistered(); + rebelPluginInfoProvider.onPluginRegistered(); } private static Map registerPluginWithGodotNative(Object pluginObject, diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPluginInfoProvider.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPluginInfoProvider.java similarity index 90% rename from platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPluginInfoProvider.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPluginInfoProvider.java index 4e2b886c2e..f29f904f7b 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPluginInfoProvider.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPluginInfoProvider.java @@ -1,5 +1,5 @@ /*************************************************************************/ -/* GodotPluginInfoProvider.java */ +/* RebelPluginInfoProvider.java */ /*************************************************************************/ /* This file is part of: */ /* REBEL ENGINE */ @@ -35,19 +35,10 @@ import java.util.Collections; import java.util.Set; -/** - * Provides the set of information expected from a Godot plugin. - */ -public interface GodotPluginInfoProvider { - /** - * Returns the name of the plugin. - */ +public interface RebelPluginInfoProvider { @NonNull String getPluginName(); - /** - * Returns the list of signals to be exposed to Godot. - */ @NonNull default Set getPluginSignals() { return Collections.emptySet(); From fabcc8158147fd382a421717cc46f7821207c915 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sun, 11 Jun 2023 14:11:47 +1200 Subject: [PATCH 23/41] Rename java class GodotPluginRegistry to RebelPluginRegistry --- .../rebelengine/RebelFragment.java | 26 ++++++++--------- .../rebelengine/RebelRenderer.java | 12 ++++---- ...Registry.java => RebelPluginRegistry.java} | 28 +++++++++---------- 3 files changed, 33 insertions(+), 33 deletions(-) rename platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/{GodotPluginRegistry.java => RebelPluginRegistry.java} (86%) diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java index 2dc06ada1a..a18ee15b63 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java @@ -34,8 +34,8 @@ import static android.content.Context.WINDOW_SERVICE; import com.rebeltoolbox.rebelengine.input.RebelEditText; -import com.rebeltoolbox.rebelengine.plugin.GodotPluginRegistry; import com.rebeltoolbox.rebelengine.plugin.RebelPlugin; +import com.rebeltoolbox.rebelengine.plugin.RebelPluginRegistry; import com.rebeltoolbox.rebelengine.utils.GodotNetUtils; import com.rebeltoolbox.rebelengine.utils.PermissionsUtil; import com.rebeltoolbox.rebelengine.xr.XRMode; @@ -138,7 +138,7 @@ public class RebelFragment extends Fragment implements SensorEventListener, IDow private final Handler mainThreadHandler = new Handler(Looper.getMainLooper()); private RebelHost rebelHost; - private GodotPluginRegistry pluginRegistry; + private RebelPluginRegistry rebelPluginRegistry; static private Intent mCurrentIntent; @@ -289,7 +289,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { for (int i = 0; i < singleton_count; i++) { singletons[i].onMainActivityResult(requestCode, resultCode, data); } - for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + for (RebelPlugin rebelPlugin : rebelPluginRegistry.getAllRebelPlugins()) { rebelPlugin.onMainActivityResult(requestCode, resultCode, data); } } @@ -301,7 +301,7 @@ public void onRequestPermissionsResult(int requestCode, String[] permissions, in for (int i = 0; i < singleton_count; i++) { singletons[i].onMainRequestPermissionsResult(requestCode, permissions, grantResults); } - for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + for (RebelPlugin rebelPlugin : rebelPluginRegistry.getAllRebelPlugins()) { rebelPlugin.onMainRequestPermissionsResult(requestCode, permissions, grantResults); } @@ -315,7 +315,7 @@ public void onRequestPermissionsResult(int requestCode, String[] permissions, in */ @CallSuper protected void onGodotSetupCompleted() { - for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + for (RebelPlugin rebelPlugin : rebelPluginRegistry.getAllRebelPlugins()) { rebelPlugin.onGodotSetupCompleted(); } @@ -329,7 +329,7 @@ protected void onGodotSetupCompleted() { */ @CallSuper protected void onGodotMainLoopStarted() { - for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + for (RebelPlugin rebelPlugin : rebelPluginRegistry.getAllRebelPlugins()) { rebelPlugin.onGodotMainLoopStarted(); } @@ -375,7 +375,7 @@ private void onVideoInit() { RebelEngine.setup(current_command_line); // Must occur after RebelEngine.setup has completed. - for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + for (RebelPlugin rebelPlugin : rebelPluginRegistry.getAllRebelPlugins()) { rebelPlugin.onRegisterPluginWithGodotNative(); } setKeepScreenOn("True".equals(RebelEngine.getGlobal("display/window/energy_saving/keep_screen_on"))); @@ -393,7 +393,7 @@ private void onVideoInit() { }); // Include all the non-null views. - for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + for (RebelPlugin rebelPlugin : rebelPluginRegistry.getAllRebelPlugins()) { View pluginView = rebelPlugin.onMainCreate(activity); if (pluginView != null) { if (rebelPlugin.shouldBeOnTop()) { @@ -591,7 +591,7 @@ public void onCreate(Bundle icicle) { Window window = activity.getWindow(); window.addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON); mClipboard = (ClipboardManager)activity.getSystemService(Context.CLIPBOARD_SERVICE); - pluginRegistry = GodotPluginRegistry.initializePluginRegistry(this); + rebelPluginRegistry = RebelPluginRegistry.initialize(this); // check for apk expansion API boolean md5mismatch = false; @@ -741,7 +741,7 @@ public void onDestroy() { for (int i = 0; i < singleton_count; i++) { singletons[i].onMainDestroy(); } - for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + for (RebelPlugin rebelPlugin : rebelPluginRegistry.getAllRebelPlugins()) { rebelPlugin.onMainDestroy(); } @@ -770,7 +770,7 @@ public void onPause() { for (int i = 0; i < singleton_count; i++) { singletons[i].onMainPause(); } - for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + for (RebelPlugin rebelPlugin : rebelPluginRegistry.getAllRebelPlugins()) { rebelPlugin.onMainPause(); } } @@ -822,7 +822,7 @@ public void onResume() { for (int i = 0; i < singleton_count; i++) { singletons[i].onMainResume(); } - for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + for (RebelPlugin rebelPlugin : rebelPluginRegistry.getAllRebelPlugins()) { rebelPlugin.onMainResume(); } } @@ -915,7 +915,7 @@ public void onBackPressed() { shouldQuit = false; } } - for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + for (RebelPlugin rebelPlugin : rebelPluginRegistry.getAllRebelPlugins()) { if (rebelPlugin.onMainBackPressed()) { shouldQuit = false; } diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelRenderer.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelRenderer.java index fa272f8964..d695f66960 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelRenderer.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelRenderer.java @@ -30,8 +30,8 @@ package com.rebeltoolbox.rebelengine; -import com.rebeltoolbox.rebelengine.plugin.GodotPluginRegistry; import com.rebeltoolbox.rebelengine.plugin.RebelPlugin; +import com.rebeltoolbox.rebelengine.plugin.RebelPluginRegistry; import com.rebeltoolbox.rebelengine.utils.GLUtils; import android.opengl.GLSurfaceView; @@ -40,11 +40,11 @@ import javax.microedition.khronos.opengles.GL10; class RebelRenderer implements GLSurfaceView.Renderer { - private final GodotPluginRegistry pluginRegistry; + private final RebelPluginRegistry rebelPluginRegistry; private boolean activityJustResumed = false; RebelRenderer() { - this.pluginRegistry = GodotPluginRegistry.getPluginRegistry(); + this.rebelPluginRegistry = RebelPluginRegistry.getPluginRegistry(); } public void onDrawFrame(GL10 gl) { @@ -57,7 +57,7 @@ public void onDrawFrame(GL10 gl) { for (int i = 0; i < RebelFragment.singleton_count; i++) { RebelFragment.singletons[i].onGLDrawFrame(gl); } - for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + for (RebelPlugin rebelPlugin : rebelPluginRegistry.getAllRebelPlugins()) { rebelPlugin.onGLDrawFrame(gl); } } @@ -67,14 +67,14 @@ public void onSurfaceChanged(GL10 gl, int width, int height) { for (int i = 0; i < RebelFragment.singleton_count; i++) { RebelFragment.singletons[i].onGLSurfaceChanged(gl, width, height); } - for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + for (RebelPlugin rebelPlugin : rebelPluginRegistry.getAllRebelPlugins()) { rebelPlugin.onGLSurfaceChanged(gl, width, height); } } public void onSurfaceCreated(GL10 gl, EGLConfig config) { RebelEngine.newcontext(GLUtils.use_32); - for (RebelPlugin rebelPlugin : pluginRegistry.getAllPlugins()) { + for (RebelPlugin rebelPlugin : rebelPluginRegistry.getAllRebelPlugins()) { rebelPlugin.onGLSurfaceCreated(gl, config); } } diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPluginRegistry.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPluginRegistry.java similarity index 86% rename from platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPluginRegistry.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPluginRegistry.java index 8576d900dc..8b1bb431b7 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/GodotPluginRegistry.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPluginRegistry.java @@ -1,5 +1,5 @@ /*************************************************************************/ -/* GodotPluginRegistry.java */ +/* RebelPluginRegistry.java */ /*************************************************************************/ /* This file is part of: */ /* REBEL ENGINE */ @@ -47,17 +47,17 @@ import java.util.concurrent.ConcurrentHashMap; /** - * Registry used to load and access the registered Godot Android plugins. + * Registry used to load and access the registered Rebel plugins. */ -public final class GodotPluginRegistry { - private static final String TAG = GodotPluginRegistry.class.getSimpleName(); +public final class RebelPluginRegistry { + private static final String TAG = RebelPluginRegistry.class.getSimpleName(); private static final String META_DATA_NAME_PREFIX = "rebel.plugin."; - private static GodotPluginRegistry instance; + private static RebelPluginRegistry instance; private final ConcurrentHashMap registry; - private GodotPluginRegistry(RebelFragment rebelFragment) { + private RebelPluginRegistry(RebelFragment rebelFragment) { registry = new ConcurrentHashMap<>(); loadPlugins(rebelFragment); } @@ -75,23 +75,23 @@ public RebelPlugin getPlugin(String pluginName) { /** * Retrieve the full set of loaded plugins. */ - public Collection getAllPlugins() { + public Collection getAllRebelPlugins() { return registry.values(); } /** - * Parse the manifest file and load all included Godot Android plugins. + * Parse the manifest file and load all included Rebel plugins. *

* A plugin manifest entry is a '' tag setup as described in the {@link RebelPlugin} * documentation. * * @param rebelFragment Rebel Fragment - * @return A singleton instance of {@link GodotPluginRegistry}. This ensures that only one instance - * of each Godot Android plugins is available at runtime. + * @return A singleton instance of {@link RebelPluginRegistry}. This ensures that only one instance + * of each Rebel plugin is available at runtime. */ - public static GodotPluginRegistry initializePluginRegistry(RebelFragment rebelFragment) { + public static RebelPluginRegistry initialize(RebelFragment rebelFragment) { if (instance == null) { - instance = new GodotPluginRegistry(rebelFragment); + instance = new RebelPluginRegistry(rebelFragment); } return instance; @@ -101,9 +101,9 @@ public static GodotPluginRegistry initializePluginRegistry(RebelFragment rebelFr * Return the plugin registry if it's initialized. * Throws a {@link IllegalStateException} exception if not. * - * @throws IllegalStateException if {@link GodotPluginRegistry#initializePluginRegistry(RebelFragment)} has not been called prior to calling this method. + * @throws IllegalStateException if {@link RebelPluginRegistry#initialize(RebelFragment)} has not been called prior to calling this method. */ - public static GodotPluginRegistry getPluginRegistry() throws IllegalStateException { + public static RebelPluginRegistry getPluginRegistry() throws IllegalStateException { if (instance == null) { throw new IllegalStateException("Plugin registry hasn't been initialized."); } From 7f8a1dc9d4f7485e57f53b48a85f09f6041a80d6 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sun, 11 Jun 2023 17:01:53 +1200 Subject: [PATCH 24/41] Rename java annotation UsedByGodot to UsedByRebel --- .../rebeltoolbox/rebelengine/plugin/RebelPlugin.java | 10 +++++----- .../plugin/{UsedByGodot.java => UsedByRebel.java} | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) rename platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/{UsedByGodot.java => UsedByRebel.java} (93%) diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPlugin.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPlugin.java index 0db3c6cddc..4af9eeec2e 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPlugin.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPlugin.java @@ -138,8 +138,8 @@ private static Map registerPluginWithGodotNative(Object plug Method[] methods = clazz.getDeclaredMethods(); for (Method method : methods) { - // Check if the method is annotated with {@link UsedByGodot}. - if (method.getAnnotation(UsedByGodot.class) != null) { + // Check if the method is annotated with {@link UsedByRebel}. + if (method.getAnnotation(UsedByRebel.class) != null) { filteredMethods.add(method); } else { // For backward compatibility, process the methods from the given argument. @@ -267,9 +267,9 @@ public void onGLSurfaceCreated(GL10 gl, EGLConfig config) {} public abstract String getPluginName(); /** - * Returns the list of methods to be exposed to Godot. + * Returns the list of methods to be exposed to Rebel Engine. * - * @deprecated Used the {@link UsedByGodot} annotation instead. + * @deprecated Use the {@link UsedByRebel} annotation instead. */ @NonNull @Deprecated @@ -278,7 +278,7 @@ public List getPluginMethods() { } /** - * Returns the list of signals to be exposed to Godot. + * Returns the list of signals to be exposed to Rebel Engine. */ @NonNull public Set getPluginSignals() { diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/UsedByGodot.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/UsedByRebel.java similarity index 93% rename from platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/UsedByGodot.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/UsedByRebel.java index e566e28bd0..f2f82c5ba6 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/UsedByGodot.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/UsedByRebel.java @@ -1,5 +1,5 @@ /*************************************************************************/ -/* UsedByGodot.java */ +/* UsedByRebel.java */ /*************************************************************************/ /* This file is part of: */ /* REBEL ENGINE */ @@ -36,10 +36,10 @@ import java.lang.annotation.Target; /** - * Annotation to indicate a method is being invoked from the Godot game logic. + * Annotation to indicate a method is being invoked by the Rebel Engine. * * At runtime, annotated plugin methods are detected and automatically registered. */ @Target({ ElementType.METHOD }) @Retention(RetentionPolicy.RUNTIME) -public @interface UsedByGodot {} +public @interface UsedByRebel {} From e6da6180ae242378cbe85316257fa9a1a6aa2593 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sun, 11 Jun 2023 17:16:20 +1200 Subject: [PATCH 25/41] Rename java class GodotNetUtils to WifiMulticastLock --- .../rebelengine/RebelFragment.java | 6 ++--- ...otNetUtils.java => WifiMulticastLock.java} | 23 ++++++++----------- 2 files changed, 13 insertions(+), 16 deletions(-) rename platform/android/java/lib/src/com/rebeltoolbox/rebelengine/utils/{GodotNetUtils.java => WifiMulticastLock.java} (81%) diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java index a18ee15b63..8121a2379b 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java @@ -36,8 +36,8 @@ import com.rebeltoolbox.rebelengine.input.RebelEditText; import com.rebeltoolbox.rebelengine.plugin.RebelPlugin; import com.rebeltoolbox.rebelengine.plugin.RebelPluginRegistry; -import com.rebeltoolbox.rebelengine.utils.GodotNetUtils; import com.rebeltoolbox.rebelengine.utils.PermissionsUtil; +import com.rebeltoolbox.rebelengine.utils.WifiMulticastLock; import com.rebeltoolbox.rebelengine.xr.XRMode; import android.annotation.SuppressLint; @@ -251,7 +251,7 @@ protected void instanceSingleton(SingletonBase s) { private Sensor mGyroscope; public static RebelIO io; - public static GodotNetUtils netUtils; + public static WifiMulticastLock wifiMulticastLock; static SingletonBase[] singletons = new SingletonBase[MAX_SINGLETONS]; static int singleton_count = 0; @@ -559,7 +559,7 @@ private void initializeGodot() { final Activity activity = getActivity(); io = new RebelIO(activity); RebelEngine.io = io; - netUtils = new GodotNetUtils(activity); + wifiMulticastLock = new WifiMulticastLock(activity); mSensorManager = (SensorManager)activity.getSystemService(Context.SENSOR_SERVICE); mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_GAME); diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/utils/GodotNetUtils.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/utils/WifiMulticastLock.java similarity index 81% rename from platform/android/java/lib/src/com/rebeltoolbox/rebelengine/utils/GodotNetUtils.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/utils/WifiMulticastLock.java index 4b9dee2dd6..f0ba04f93e 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/utils/GodotNetUtils.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/utils/WifiMulticastLock.java @@ -1,5 +1,5 @@ /*************************************************************************/ -/* GodotNetUtils.java */ +/* WifiMulticastLock.java */ /*************************************************************************/ /* This file is part of: */ /* REBEL ENGINE */ @@ -35,26 +35,23 @@ import android.net.wifi.WifiManager; import android.util.Log; -/** - * This class handles Android-specific networking functions. - * For now, it only provides access to WifiManager.MulticastLock, which is needed on some devices - * to receive broadcast and multicast packets. - */ -public class GodotNetUtils { +public class WifiMulticastLock { /* A single, reference counted, multicast lock, or null if permission CHANGE_WIFI_MULTICAST_STATE is missing */ + private static final String TAG = WifiMulticastLock.class.getSimpleName(); + private WifiManager.MulticastLock multicastLock; - public GodotNetUtils(Activity p_activity) { + public WifiMulticastLock(Activity p_activity) { if (PermissionsUtil.hasManifestPermission(p_activity, "android.permission.CHANGE_WIFI_MULTICAST_STATE")) { WifiManager wifi = (WifiManager)p_activity.getApplicationContext().getSystemService(Context.WIFI_SERVICE); - multicastLock = wifi.createMulticastLock("GodotMulticastLock"); + multicastLock = wifi.createMulticastLock(TAG); multicastLock.setReferenceCounted(true); } } /** * Acquire the multicast lock. This is required on some devices to receive broadcast/multicast packets. - * This is done automatically by Godot when enabling broadcast or joining a multicast group on a socket. + * This is done automatically when enabling broadcast or joining a multicast group on a socket. */ public void multicastLockAcquire() { if (multicastLock == null) @@ -62,13 +59,13 @@ public void multicastLockAcquire() { try { multicastLock.acquire(); } catch (RuntimeException e) { - Log.e("Godot", "Exception during multicast lock acquire: " + e); + Log.e(TAG, "Exception during multicast lock acquire: " + e); } } /** * Release the multicast lock. - * This is done automatically by Godot when the lock is no longer needed by a socket. + * This is done automatically when the lock is no longer needed by a socket. */ public void multicastLockRelease() { if (multicastLock == null) @@ -76,7 +73,7 @@ public void multicastLockRelease() { try { multicastLock.release(); } catch (RuntimeException e) { - Log.e("Godot", "Exception during multicast lock release: " + e); + Log.e(TAG, "Exception during multicast lock release: " + e); } } } From 67522447b3c51d8e9072c80b65688e1681a16261 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sun, 11 Jun 2023 17:21:34 +1200 Subject: [PATCH 26/41] Rename java class GodotInstrumentation to RebelInstrumentation --- platform/android/java/lib/AndroidManifest.xml | 2 +- .../lib/src/com/rebeltoolbox/rebelengine/RebelActivity.java | 2 +- .../{GodotInstrumentation.java => RebelInstrumentation.java} | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename platform/android/java/lib/src/com/rebeltoolbox/rebelengine/{GodotInstrumentation.java => RebelInstrumentation.java} (95%) diff --git a/platform/android/java/lib/AndroidManifest.xml b/platform/android/java/lib/AndroidManifest.xml index c11f6d2b5b..63b21ce1e8 100644 --- a/platform/android/java/lib/AndroidManifest.xml +++ b/platform/android/java/lib/AndroidManifest.xml @@ -19,7 +19,7 @@ diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelActivity.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelActivity.java index 7ae2a6385f..496cd70aba 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelActivity.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelActivity.java @@ -98,7 +98,7 @@ public final void onGodotRestartRequested(RebelFragment restartFragment) { // Bundle args = new Bundle(); args.putParcelable("intent", getIntent()); - startInstrumentation(new ComponentName(this, GodotInstrumentation.class), null, args); + startInstrumentation(new ComponentName(this, RebelInstrumentation.class), null, args); } } diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotInstrumentation.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelInstrumentation.java similarity index 95% rename from platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotInstrumentation.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelInstrumentation.java index 6db96b143f..12ea037188 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotInstrumentation.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelInstrumentation.java @@ -1,5 +1,5 @@ /*************************************************************************/ -/* GodotInstrumentation.java */ +/* RebelInstrumentation.java */ /*************************************************************************/ /* This file is part of: */ /* REBEL ENGINE */ @@ -34,7 +34,7 @@ import android.content.Intent; import android.os.Bundle; -public class GodotInstrumentation extends Instrumentation { +public class RebelInstrumentation extends Instrumentation { private Intent intent; @Override From e00881cd25dcc06258574ad214a7f11b94be2e5a Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sun, 11 Jun 2023 17:25:08 +1200 Subject: [PATCH 27/41] Rename java class GodotDownloaderService to RebelDownloaderService --- platform/android/java/lib/AndroidManifest.xml | 2 +- .../rebelengine/GodotDownloaderAlarmReceiver.java | 2 +- ...nloaderService.java => RebelDownloaderService.java} | 10 ++++++---- .../com/rebeltoolbox/rebelengine/RebelFragment.java | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) rename platform/android/java/lib/src/com/rebeltoolbox/rebelengine/{GodotDownloaderService.java => RebelDownloaderService.java} (90%) diff --git a/platform/android/java/lib/AndroidManifest.xml b/platform/android/java/lib/AndroidManifest.xml index 63b21ce1e8..99d049fab3 100644 --- a/platform/android/java/lib/AndroidManifest.xml +++ b/platform/android/java/lib/AndroidManifest.xml @@ -14,7 +14,7 @@ android:name="org.godotengine.library.version" android:value="${godotLibraryVersion}" /> - + diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotDownloaderAlarmReceiver.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotDownloaderAlarmReceiver.java index 009923ce53..b769973372 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotDownloaderAlarmReceiver.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotDownloaderAlarmReceiver.java @@ -50,7 +50,7 @@ public class GodotDownloaderAlarmReceiver extends BroadcastReceiver { public void onReceive(Context context, Intent intent) { Log.d("GODOT", "Alarma recivida"); try { - DownloaderClientMarshaller.startDownloadServiceIfRequired(context, intent, GodotDownloaderService.class); + DownloaderClientMarshaller.startDownloadServiceIfRequired(context, intent, RebelDownloaderService.class); } catch (NameNotFoundException e) { e.printStackTrace(); Log.d("GODOT", "Exception: " + e.getClass().getName() + ":" + e.getMessage()); diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotDownloaderService.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelDownloaderService.java similarity index 90% rename from platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotDownloaderService.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelDownloaderService.java index 10fbb2d365..c073c58421 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotDownloaderService.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelDownloaderService.java @@ -1,5 +1,5 @@ /*************************************************************************/ -/* GodotDownloaderService.java */ +/* RebelDownloaderService.java */ /*************************************************************************/ /* This file is part of: */ /* REBEL ENGINE */ @@ -35,12 +35,14 @@ import android.util.Log; import com.google.android.vending.expansion.downloader.impl.DownloaderService; +import com.rebeltoolbox.rebelengine.plugin.RebelPlugin; /** * This class demonstrates the minimal client implementation of the * DownloaderService from the Downloader library. */ -public class GodotDownloaderService extends DownloaderService { +public class RebelDownloaderService extends DownloaderService { + private static final String TAG = RebelDownloaderService.class.getSimpleName(); // stuff for LVL -- MODIFY FOR YOUR APPLICATION! private static final String BASE64_PUBLIC_KEY = "REPLACE THIS WITH YOUR PUBLIC KEY"; // used by the preference obfuscater @@ -56,7 +58,7 @@ public class GodotDownloaderService extends DownloaderService { @Override public String getPublicKey() { SharedPreferences prefs = getApplicationContext().getSharedPreferences("app_data_keys", Context.MODE_PRIVATE); - Log.d("GODOT", "getting public key:" + prefs.getString("store_public_key", null)); + Log.d(TAG, "getting public key:" + prefs.getString("store_public_key", null)); return prefs.getString("store_public_key", null); //return BASE64_PUBLIC_KEY; @@ -79,7 +81,7 @@ public byte[] getSALT() { */ @Override public String getAlarmReceiverClassName() { - Log.d("GODOT", "getAlarmReceiverClassName()"); + Log.d(TAG, "getAlarmReceiverClassName()"); return GodotDownloaderAlarmReceiver.class.getName(); } } diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java index 8121a2379b..eb4acdd360 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java @@ -693,13 +693,13 @@ public void onCreate(Bundle icicle) { startResult = DownloaderClientMarshaller.startDownloadServiceIfRequired( getContext(), pendingIntent, - GodotDownloaderService.class); + RebelDownloaderService.class); if (startResult != DownloaderClientMarshaller.NO_DOWNLOAD_REQUIRED) { // This is where you do set up to display the download // progress (next step in onCreateView) mDownloaderClientStub = DownloaderClientMarshaller.CreateStub(this, - GodotDownloaderService.class); + RebelDownloaderService.class); return; } From 6558079ca378d8ec83fcba263c2927e446f58cf1 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sun, 11 Jun 2023 17:33:21 +1200 Subject: [PATCH 28/41] Rename java class GodotDownloaderAlarmReceiver to RebelDownloaderReceiver --- ...armReceiver.java => RebelDownloaderReceiver.java} | 12 +++++++----- .../rebelengine/RebelDownloaderService.java | 3 +-- 2 files changed, 8 insertions(+), 7 deletions(-) rename platform/android/java/lib/src/com/rebeltoolbox/rebelengine/{GodotDownloaderAlarmReceiver.java => RebelDownloaderReceiver.java} (88%) diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotDownloaderAlarmReceiver.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelDownloaderReceiver.java similarity index 88% rename from platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotDownloaderAlarmReceiver.java rename to platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelDownloaderReceiver.java index b769973372..6558e06e2d 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/GodotDownloaderAlarmReceiver.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelDownloaderReceiver.java @@ -1,5 +1,5 @@ /*************************************************************************/ -/* GodotDownloaderAlarmReceiver.java */ +/* RebelDownloaderReceiver.java */ /*************************************************************************/ /* This file is part of: */ /* REBEL ENGINE */ @@ -43,17 +43,19 @@ * from the alarm service using the provided service helper function within the * DownloaderClientMarshaller. This class must be then registered in your AndroidManifest.xml * file with a section like this: - * + * */ -public class GodotDownloaderAlarmReceiver extends BroadcastReceiver { +public class RebelDownloaderReceiver extends BroadcastReceiver { + private static final String TAG = RebelDownloaderReceiver.class.getSimpleName(); + @Override public void onReceive(Context context, Intent intent) { - Log.d("GODOT", "Alarma recivida"); + Log.d(TAG, "Rebel Downloader Alarm received"); try { DownloaderClientMarshaller.startDownloadServiceIfRequired(context, intent, RebelDownloaderService.class); } catch (NameNotFoundException e) { e.printStackTrace(); - Log.d("GODOT", "Exception: " + e.getClass().getName() + ":" + e.getMessage()); + Log.d(TAG, "Exception: " + e.getClass().getName() + ":" + e.getMessage()); } } } diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelDownloaderService.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelDownloaderService.java index c073c58421..9941867101 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelDownloaderService.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelDownloaderService.java @@ -35,7 +35,6 @@ import android.util.Log; import com.google.android.vending.expansion.downloader.impl.DownloaderService; -import com.rebeltoolbox.rebelengine.plugin.RebelPlugin; /** * This class demonstrates the minimal client implementation of the @@ -82,6 +81,6 @@ public byte[] getSALT() { @Override public String getAlarmReceiverClassName() { Log.d(TAG, "getAlarmReceiverClassName()"); - return GodotDownloaderAlarmReceiver.class.getName(); + return RebelDownloaderReceiver.class.getName(); } } From e96fda4c4bc320f1f8743c120a287c1f6ddcbd65 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sun, 11 Jun 2023 17:45:42 +1200 Subject: [PATCH 29/41] Rename Android layout godot_app_layout to rebel_fragment --- .../res/layout/{godot_app_layout.xml => rebel_fragment.xml} | 2 +- .../lib/src/com/rebeltoolbox/rebelengine/RebelActivity.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename platform/android/java/lib/res/layout/{godot_app_layout.xml => rebel_fragment.xml} (81%) diff --git a/platform/android/java/lib/res/layout/godot_app_layout.xml b/platform/android/java/lib/res/layout/rebel_fragment.xml similarity index 81% rename from platform/android/java/lib/res/layout/godot_app_layout.xml rename to platform/android/java/lib/res/layout/rebel_fragment.xml index 386ded1c5d..f0f97a9d2c 100644 --- a/platform/android/java/lib/res/layout/godot_app_layout.xml +++ b/platform/android/java/lib/res/layout/rebel_fragment.xml @@ -1,5 +1,5 @@ diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelActivity.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelActivity.java index 496cd70aba..78d52e4aa0 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelActivity.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelActivity.java @@ -55,9 +55,9 @@ public abstract class RebelActivity extends FragmentActivity implements RebelHos @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.godot_app_layout); + setContentView(R.layout.rebel_fragment); - Fragment currentFragment = getSupportFragmentManager().findFragmentById(R.id.godot_fragment_container); + Fragment currentFragment = getSupportFragmentManager().findFragmentById(R.id.rebel_fragment); if (currentFragment instanceof RebelFragment) { Log.v(TAG, "Reusing existing Rebel Fragment."); rebelFragment = (RebelFragment)currentFragment; @@ -65,7 +65,7 @@ public void onCreate(Bundle savedInstanceState) { Log.v(TAG, "Creating new Rebel Fragment."); rebelFragment = createRebelFragment(); - getSupportFragmentManager().beginTransaction().replace(R.id.godot_fragment_container, rebelFragment).setPrimaryNavigationFragment(rebelFragment).commitNowAllowingStateLoss(); + getSupportFragmentManager().beginTransaction().replace(R.id.rebel_fragment, rebelFragment).setPrimaryNavigationFragment(rebelFragment).commitNowAllowingStateLoss(); } } From b66e1f6b0cc0bd61bc9b0cd321e93b269fe85f45 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Wed, 21 Jun 2023 08:17:27 +1200 Subject: [PATCH 30/41] Rename GodotAppMainTheme to MainTheme and rename GodotAppSplashTheme to SplashTheme --- platform/android/java/app/AndroidManifest.xml | 2 +- platform/android/java/app/res/values/themes.xml | 4 ++-- .../java/app/src/com/rebeltoolbox/rebelapp/RebelApp.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/android/java/app/AndroidManifest.xml b/platform/android/java/app/AndroidManifest.xml index f311599eeb..6650f6f237 100644 --- a/platform/android/java/app/AndroidManifest.xml +++ b/platform/android/java/app/AndroidManifest.xml @@ -66,7 +66,7 @@ - diff --git a/platform/android/java/app/src/com/rebeltoolbox/rebelapp/RebelApp.java b/platform/android/java/app/src/com/rebeltoolbox/rebelapp/RebelApp.java index dbf23e71e4..7306c18f28 100644 --- a/platform/android/java/app/src/com/rebeltoolbox/rebelapp/RebelApp.java +++ b/platform/android/java/app/src/com/rebeltoolbox/rebelapp/RebelApp.java @@ -41,7 +41,7 @@ public class RebelApp extends RebelActivity { @Override public void onCreate(Bundle savedInstanceState) { - setTheme(R.style.GodotAppMainTheme); + setTheme(R.style.MainTheme); super.onCreate(savedInstanceState); } } From 01114d101a4671da40ec5ea8740de64fe8b6bde5 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Wed, 21 Jun 2023 08:40:53 +1200 Subject: [PATCH 31/41] Rename Android project property godot_editor_version to editor_version --- platform/android/export/export_plugin.cpp | 2 +- platform/android/java/app/config.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index f467ada381..79b5179242 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -2989,7 +2989,7 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref Date: Wed, 21 Jun 2023 10:42:52 +1200 Subject: [PATCH 32/41] Rename Android Gradle build getGodot* funtions to get* Rename generateGodotLibraryVersion to generateLibraryVersion --- platform/android/export/export_plugin.cpp | 12 +-- .../android/export/godot_plugin_config.cpp | 22 +++--- platform/android/export/godot_plugin_config.h | 8 +- platform/android/java/app/build.gradle | 24 +++--- platform/android/java/app/config.gradle | 73 +++++++++---------- platform/android/java/lib/build.gradle | 4 +- 6 files changed, 70 insertions(+), 73 deletions(-) diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index 79b5179242..2802c52937 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -2957,9 +2957,9 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref enabled_plugins = get_enabled_plugins(p_preset); - String local_plugins_binaries = PluginConfigAndroid::get_plugins_binaries(PluginConfigAndroid::BINARY_TYPE_LOCAL, enabled_plugins); - String remote_plugins_binaries = PluginConfigAndroid::get_plugins_binaries(PluginConfigAndroid::BINARY_TYPE_REMOTE, enabled_plugins); - String custom_maven_repos = PluginConfigAndroid::get_plugins_custom_maven_repos(enabled_plugins); + String plugins_local_dependencies = PluginConfigAndroid::get_plugins_dependencies(PluginConfigAndroid::BINARY_TYPE_LOCAL, enabled_plugins); + String plugins_remote_dependencies = PluginConfigAndroid::get_plugins_dependencies(PluginConfigAndroid::BINARY_TYPE_REMOTE, enabled_plugins); + String plugins_maven_repos = PluginConfigAndroid::get_plugins_maven_repos(enabled_plugins); bool clean_build_required = is_clean_build_required(enabled_plugins); List cmdline; @@ -2984,9 +2984,9 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref return editorVersion } -ext.generateGodotLibraryVersion = { List requiredKeys -> +ext.generateLibraryVersion = { List requiredKeys -> // Attempt to read the version from the `version.py` file. String libraryVersion = "" @@ -120,14 +120,14 @@ ext.generateGodotLibraryVersion = { List requiredKeys -> return libraryVersion } -ext.getGodotLibraryVersion = { -> +ext.getLibraryVersion = { -> List requiredKeys = ["major", "minor", "patch", "status", "module_config"] - return generateGodotLibraryVersion(requiredKeys) + return generateLibraryVersion(requiredKeys) } -ext.getGodotPublishVersion = { -> +ext.getPublishVersion = { -> List requiredKeys = ["major", "minor", "patch", "status"] - return generateGodotLibraryVersion(requiredKeys) + return generateLibraryVersion(requiredKeys) } final String VALUE_SEPARATOR_REGEX = "\\|" @@ -164,18 +164,17 @@ ext.getExportFilename = { } /** - * Parse the project properties for the 'plugins_maven_repos' property and return the list - * of maven repos. + * Parse the project's 'plugins_maven_repos' property and return the list of maven repos. */ -ext.getGodotPluginsMavenRepos = { -> +ext.getPluginsMavenRepos = { -> Set mavenRepos = [] // Retrieve the list of maven repos. if (project.hasProperty("plugins_maven_repos")) { - String mavenReposProperty = project.property("plugins_maven_repos") - if (mavenReposProperty != null && !mavenReposProperty.trim().isEmpty()) { - for (String mavenRepoUrl : mavenReposProperty.split(VALUE_SEPARATOR_REGEX)) { - mavenRepos += mavenRepoUrl.trim() + String allMavenRepos = project.property("plugins_maven_repos") + if (allMavenRepos != null && !allMavenRepos.trim().isEmpty()) { + for (String mavenRepo : allMavenRepos.split(VALUE_SEPARATOR_REGEX)) { + mavenRepos += mavenRepo.trim() } } } @@ -184,42 +183,40 @@ ext.getGodotPluginsMavenRepos = { -> } /** - * Parse the project properties for the 'plugins_remote_binaries' property and return - * it for inclusion in the build dependencies. + * Parse project's 'plugins_remote_dependencies' property and return the list of remote dependencies. */ -ext.getGodotPluginsRemoteBinaries = { -> - Set remoteDeps = [] - - // Retrieve the list of remote plugins binaries. - if (project.hasProperty("plugins_remote_binaries")) { - String remoteDepsList = project.property("plugins_remote_binaries") - if (remoteDepsList != null && !remoteDepsList.trim().isEmpty()) { - for (String dep: remoteDepsList.split(VALUE_SEPARATOR_REGEX)) { - remoteDeps += dep.trim() +ext.getPluginsRemoteDependencies = { -> + Set remoteDependencies = [] + + // Retrieve the list of plugins' remote dependencies. + if (project.hasProperty("plugins_remote_dependencies")) { + String allRemoteDependencies = project.property("plugins_remote_dependencies") + if (allRemoteDependencies != null && !allRemoteDependencies.trim().isEmpty()) { + for (String dependencies: allRemoteDependencies.split(VALUE_SEPARATOR_REGEX)) { + remoteDependencies += dependencies.trim() } } } - return remoteDeps + return remoteDependencies } /** - * Parse the project properties for the 'plugins_local_binaries' property and return - * their binaries for inclusion in the build dependencies. + * Parse project's 'plugins_remote_dependencies' property and return the list of local dependencies. */ -ext.getGodotPluginsLocalBinaries = { -> - Set binDeps = [] - - // Retrieve the list of local plugins binaries. - if (project.hasProperty("plugins_local_binaries")) { - String pluginsList = project.property("plugins_local_binaries") - if (pluginsList != null && !pluginsList.trim().isEmpty()) { - for (String plugin : pluginsList.split(VALUE_SEPARATOR_REGEX)) { - binDeps += plugin.trim() +ext.getPluginsLocalDependencies = { -> + Set localDependencies = [] + + // Retrieve the list of plugins' local dependencies. + if (project.hasProperty("plugins_local_dependencies")) { + String allLocalDependencies = project.property("plugins_local_dependencies") + if (allLocalDependencies != null && !allLocalDependencies.trim().isEmpty()) { + for (String plugin : allLocalDependencies.split(VALUE_SEPARATOR_REGEX)) { + localDependencies += plugin.trim() } } } - return binDeps + return localDependencies } ext.getDebugKeystoreFile = { -> diff --git a/platform/android/java/lib/build.gradle b/platform/android/java/lib/build.gradle index 9d928813d1..3bcc1957f0 100644 --- a/platform/android/java/lib/build.gradle +++ b/platform/android/java/lib/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' ext { - PUBLISH_VERSION = getGodotPublishVersion() + PUBLISH_VERSION = getPublishVersion() PUBLISH_ARTIFACT_ID = 'godot' } @@ -25,7 +25,7 @@ android { minSdkVersion versions.minSdk targetSdkVersion versions.targetSdk - manifestPlaceholders = [godotLibraryVersion: getGodotLibraryVersion()] + manifestPlaceholders = [godotLibraryVersion: getLibraryVersion()] } namespace = "com.rebeltoolbox.rebelengine" From 240041a1dbb36e5559cd975d70660fbad9fad0c8 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Wed, 21 Jun 2023 10:47:23 +1200 Subject: [PATCH 33/41] Rename Android meta-data org.godotengine.editor.version to com.rebeltoolbox.rebeleditor.version --- platform/android/java/app/AndroidManifest.xml | 8 ++++---- platform/android/java/app/build.gradle | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/platform/android/java/app/AndroidManifest.xml b/platform/android/java/app/AndroidManifest.xml index 6650f6f237..e296e1c6fc 100644 --- a/platform/android/java/app/AndroidManifest.xml +++ b/platform/android/java/app/AndroidManifest.xml @@ -30,12 +30,12 @@ - + + android:name="com.rebeltoolbox.rebeleditor.version" + android:value="${editorVersion}" /> - + diff --git a/platform/android/java/app/build.gradle b/platform/android/java/app/build.gradle index f502e234a2..d07de2ede1 100644 --- a/platform/android/java/app/build.gradle +++ b/platform/android/java/app/build.gradle @@ -97,7 +97,7 @@ android { abiFilters export_abi_list } - manifestPlaceholders = [godotEditorVersion: getEditorVersion()] + manifestPlaceholders = [editorVersion: getEditorVersion()] // Feel free to modify the application id to your own. applicationId getExportPackageName() From b34c4a5d1ba11dd5d2e599a7e175e05be26975ac Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Wed, 21 Jun 2023 11:02:58 +1200 Subject: [PATCH 34/41] Rename Android meta-data org.godotengine.library.version to com.rebeltoolbox.rebellibrary.version --- platform/android/java/lib/AndroidManifest.xml | 6 +++--- platform/android/java/lib/build.gradle | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/android/java/lib/AndroidManifest.xml b/platform/android/java/lib/AndroidManifest.xml index 99d049fab3..1370cebd08 100644 --- a/platform/android/java/lib/AndroidManifest.xml +++ b/platform/android/java/lib/AndroidManifest.xml @@ -9,10 +9,10 @@ - + + android:name="com.rebeltoolbox.rebellibrary.version" + android:value="${libraryVersion}" /> diff --git a/platform/android/java/lib/build.gradle b/platform/android/java/lib/build.gradle index 3bcc1957f0..d8d1170ee1 100644 --- a/platform/android/java/lib/build.gradle +++ b/platform/android/java/lib/build.gradle @@ -25,7 +25,7 @@ android { minSdkVersion versions.minSdk targetSdkVersion versions.targetSdk - manifestPlaceholders = [godotLibraryVersion: getLibraryVersion()] + manifestPlaceholders = [libraryVersion: getLibraryVersion()] } namespace = "com.rebeltoolbox.rebelengine" From 8db6368db5aa230dc03ff398f24e16d1ecd98c19 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Thu, 22 Jun 2023 11:27:44 +1200 Subject: [PATCH 35/41] Rename Android Gradle task generateGodotTemplates to createAndroidTemplates generateDevTemplate to createDevelopmentAndroidTemplates and cleanGodotTemplates to deleteAndroidTemplates --- .github/workflows/android_builds.yml | 4 ++-- platform/android/java/build.gradle | 34 +++++++++++++--------------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/.github/workflows/android_builds.yml b/.github/workflows/android_builds.yml index 4e340b6a62..400320fc0e 100644 --- a/.github/workflows/android_builds.yml +++ b/.github/workflows/android_builds.yml @@ -54,10 +54,10 @@ jobs: target: release tools: false - - name: Generate templates + - name: Create Android templates run: | cd platform/android/java - ./gradlew generateGodotTemplates + ./gradlew createAndroidTemplates cd ../../.. ls -l bin/ diff --git a/platform/android/java/build.gradle b/platform/android/java/build.gradle index 66dff1236a..fe9b7dbd00 100644 --- a/platform/android/java/build.gradle +++ b/platform/android/java/build.gradle @@ -31,7 +31,7 @@ ext { // Used by gradle to specify which architecture to build for by default when running `./gradlew build`. // This command is usually used by Android Studio. // If building manually on the command line, it's recommended to use the - // `./gradlew generateGodotTemplates` build command instead after running the `scons` command. + // `./gradlew createAndroidTemplates` command instead after running the `scons` command. // The defaultAbi must be one of the {supportedAbis} values. defaultAbi = "arm64v8" } @@ -44,7 +44,7 @@ def getSconsTaskName(String buildType) { } /** - * Copy the generated 'android_debug.apk' binary template into the Godot bin directory. + * Copy the generated 'android_debug.apk' binary template into the bin directory. * Depends on the app build task to ensure the binary is generated prior to copying. */ task copyDebugBinaryToBin(type: Copy) { @@ -55,7 +55,7 @@ task copyDebugBinaryToBin(type: Copy) { } /** - * Copy the generated 'android_release.apk' binary template into the Godot bin directory. + * Copy the generated 'android_release.apk' binary template into the bin directory. * Depends on the app build task to ensure the binary is generated prior to copying. */ task copyReleaseBinaryToBin(type: Copy) { @@ -110,14 +110,14 @@ task copyReleaseAARToBin(type: Copy) { } /** - * Generate Godot custom build template by zipping the source files from the app directory, as well + * Generate custom build template by zipping the source files from the app directory, as well * as the AAR files generated by 'copyDebugAAR' and 'copyReleaseAAR'. * The zip file also includes some gradle tools to allow building of the custom build. */ task zipCustomBuild(type: Zip) { - onlyIf { generateGodotTemplates.state.executed || generateDevTemplate.state.executed } + onlyIf { createAndroidTemplates.state.executed || createDevelopmentAndroidTemplates.state.executed } doFirst { - logger.lifecycle("Generating Godot custom build template") + logger.lifecycle("Creating the Rebel Android custom build template") } from(fileTree(dir: 'app', excludes: ['**/build/**', '**/.gradle/**', '**/*.iml']), fileTree(dir: '.', includes: ['gradlew', 'gradlew.bat', 'gradle/**'])) include '**/*' @@ -160,9 +160,9 @@ def templateBuildTasks() { } /** - * Master task used to coordinate the tasks defined above to generate the set of Godot templates. + * Creates the Rebel Engine Android templates for each previously built target and architecture. */ -task generateGodotTemplates { +task createAndroidTemplates { gradle.startParameter.excludedTaskNames += templateExcludedBuildTask() dependsOn = templateBuildTasks() @@ -170,9 +170,9 @@ task generateGodotTemplates { } /** - * Generates the same output as generateGodotTemplates but with dev symbols + * Creates the development Android templates for each previously built target and architecture. */ -task generateDevTemplate { +task createDevelopmentAndroidTemplates { // add parameter to set symbols to true gradle.startParameter.projectProperties += [doNotStrip: true] @@ -183,22 +183,20 @@ task generateDevTemplate { } /** - * Clean the generated artifacts. + * Remove all the created files and directories. */ -task cleanGodotTemplates(type: Delete) { - // Delete the generated native libs +task deleteAndroidTemplates(type: Delete) { + // Delete the native libraries delete("lib/libs") - // Delete the library generated AAR files + // Delete the library AAR files delete("lib/build/outputs/aar") - - // Delete the app libs directory contents delete("app/libs") - // Delete the generated binary apks + // Delete the created apks delete("app/build/outputs/apk") - // Delete the Godot templates in the Godot bin directory + // Delete the template files in the bin directory delete("$binDir/android_debug.apk") delete("$binDir/android_release.apk") delete("$binDir/android_source.zip") From b71f8d682f1913cfb8cda4896a737b92816e743b Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Thu, 22 Jun 2023 16:12:11 +1200 Subject: [PATCH 36/41] Update references to Godot in comments in Gradle files --- platform/android/java/app/build.gradle | 3 ++- platform/android/java/app/gradle.properties | 16 +++++++++------- platform/android/java/app/settings.gradle | 2 +- platform/android/java/gradle.properties | 12 +++++------- .../android/java/nativeSrcsConfigs/README.md | 2 +- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/platform/android/java/app/build.gradle b/platform/android/java/app/build.gradle index d07de2ede1..b0d61bdf12 100644 --- a/platform/android/java/app/build.gradle +++ b/platform/android/java/app/build.gradle @@ -87,7 +87,8 @@ android { assetPacks = [":assetPacks:installTime"] defaultConfig { - // The default ignore pattern for the 'assets' directory includes hidden files and directories which are used by Godot projects. + // The default ignore pattern for the 'assets' directory includes hidden files and + // directories that are used by Rebel projects. aaptOptions { ignoreAssetsPattern "!.svn:!.git:!.gitignore:!.ds_store:!*.scc:

_*:!CVS:!thumbs.db:!picasa.ini:!*~" } diff --git a/platform/android/java/app/gradle.properties b/platform/android/java/app/gradle.properties index 19587bd81f..f967c234b5 100644 --- a/platform/android/java/app/gradle.properties +++ b/platform/android/java/app/gradle.properties @@ -1,10 +1,12 @@ -# Godot custom build Gradle settings. -# These properties apply when running custom build from the Godot editor. -# NOTE: This should be kept in sync with 'godot/platform/android/java/gradle.properties' except -# where otherwise specified. - +# Project Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. # For more details on how to configure your build environment visit # http://www.gradle.org/docs/current/userguide/build_environment.html +# +# These properties apply when creating a custom build in the Rebel Editor. +# NOTE: This should be kept in sync with the project 'gradle.properties' except where otherwise specified. android.enableJetifier=true android.useAndroidX=true @@ -20,6 +22,6 @@ org.gradle.jvmargs=-Xmx4536m org.gradle.warning.mode=all -# Enable resource optimizations for release build. -# NOTE: This is turned off for template release build in order to support the build legacy process. +# Enable resource optimizations. +# NOTE: This is turned on for custom builds in order to improve the game build. android.enableResourceOptimizations=true diff --git a/platform/android/java/app/settings.gradle b/platform/android/java/app/settings.gradle index e38d7b2ba6..dd8b858fff 100644 --- a/platform/android/java/app/settings.gradle +++ b/platform/android/java/app/settings.gradle @@ -1,2 +1,2 @@ -// This is the root directory of the Godot custom build. +// These settings apply when creating a custom build in the Rebel Editor. include ':assetPacks:installTime' diff --git a/platform/android/java/gradle.properties b/platform/android/java/gradle.properties index b51a19a005..07bccf0d86 100644 --- a/platform/android/java/gradle.properties +++ b/platform/android/java/gradle.properties @@ -1,13 +1,11 @@ -# Project-wide Gradle settings. -# NOTE: This should be kept in sync with 'godot/platform/android/java/app/gradle.properties' except -# where otherwise specified. - +# Project Gradle settings. # IDE (e.g. Android Studio) users: # Gradle settings configured through the IDE *will override* # any settings specified in this file. - # For more details on how to configure your build environment visit # http://www.gradle.org/docs/current/userguide/build_environment.html +# +# NOTE: This should be kept in sync with 'app/gradle.properties' except where otherwise specified. android.enableJetifier=true android.useAndroidX=true @@ -23,6 +21,6 @@ org.gradle.jvmargs=-Xmx4536m org.gradle.warning.mode=all -# Disable resource optimizations for template release build. -# NOTE: This is turned on for custom build in order to improve the release build. +# Disable resource optimizations. +# NOTE: This is turned off in order to support the legacy build process. android.enableResourceOptimizations=false diff --git a/platform/android/java/nativeSrcsConfigs/README.md b/platform/android/java/nativeSrcsConfigs/README.md index e48505ccda..bbb450ad40 100644 --- a/platform/android/java/nativeSrcsConfigs/README.md +++ b/platform/android/java/nativeSrcsConfigs/README.md @@ -1,4 +1,4 @@ ## Native sources configs -This is a non functional Android library used to provide Android Studio editor support to the Godot project native files. +This is a non functional Android library used to provide Android Studio editor support to the Rebel Engine native files. Nothing else should be added to this library. From 80a1b4b5d2b15c13005f2422bdc341c62bd06aa8 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Thu, 22 Jun 2023 16:20:03 +1200 Subject: [PATCH 37/41] Rename Gradle tasks for building Native Libraries from compileGodotNativeLibs to compileRebelEngine --- platform/android/java/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/android/java/build.gradle b/platform/android/java/build.gradle index fe9b7dbd00..289dd8ba03 100644 --- a/platform/android/java/build.gradle +++ b/platform/android/java/build.gradle @@ -40,7 +40,7 @@ def rootDir = "../../.." def binDir = "$rootDir/bin/" def getSconsTaskName(String buildType) { - return "compileGodotNativeLibs" + buildType.capitalize() + return "compileRebelEngine" + buildType.capitalize() } /** From b388f68c6ada22232527f36cf5d415f4e3387380 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Fri, 23 Jun 2023 11:37:38 +1200 Subject: [PATCH 38/41] Rename Android onGodot* methods to on* --- .../rebelengine/RebelActivity.java | 6 ++--- .../rebelengine/RebelFragment.java | 22 +++++++++---------- .../rebeltoolbox/rebelengine/RebelHost.java | 16 +++++++------- .../rebelengine/plugin/RebelPlugin.java | 8 +++---- platform/android/java_godot_lib_jni.cpp | 4 ++-- platform/android/java_godot_wrapper.cpp | 16 +++++++------- platform/android/java_godot_wrapper.h | 8 +++---- 7 files changed, 40 insertions(+), 40 deletions(-) diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelActivity.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelActivity.java index 78d52e4aa0..01aa586fc3 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelActivity.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelActivity.java @@ -72,18 +72,18 @@ public void onCreate(Bundle savedInstanceState) { @Override public void onDestroy() { super.onDestroy(); - onGodotForceQuit(rebelFragment); + onQuit(rebelFragment); } @Override - public final void onGodotForceQuit(RebelFragment quitFragment) { + public final void onQuit(RebelFragment quitFragment) { if (rebelFragment == quitFragment) { System.exit(0); } } @Override - public final void onGodotRestartRequested(RebelFragment restartFragment) { + public final void onRestart(RebelFragment restartFragment) { if (rebelFragment == restartFragment) { // HACK: // diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java index eb4acdd360..9793fea813 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java @@ -199,7 +199,7 @@ protected void registerClass(String p_name, String[] p_methods) { /** * Invoked once during Android initialization after creation of the {@link RebelView}. - * + * * This method should be overridden by descendants of this class that would like to add * their view/layout to the view hierarchy. * @@ -311,30 +311,30 @@ public void onRequestPermissionsResult(int requestCode, String[] permissions, in } /** - * Invoked on the render thread when the Godot setup is complete. + * Invoked on the render thread when the Rebel Engine setup is complete. */ @CallSuper - protected void onGodotSetupCompleted() { + protected void onSetupCompleted() { for (RebelPlugin rebelPlugin : rebelPluginRegistry.getAllRebelPlugins()) { - rebelPlugin.onGodotSetupCompleted(); + rebelPlugin.onSetupCompleted(); } if (rebelHost != null) { - rebelHost.onGodotSetupCompleted(); + rebelHost.onSetupCompleted(); } } /** - * Invoked on the render thread when the Godot main loop has started. + * Invoked on the render thread when the Rebel Engine main loop has started. */ @CallSuper - protected void onGodotMainLoopStarted() { + protected void onMainLoopStarted() { for (RebelPlugin rebelPlugin : rebelPluginRegistry.getAllRebelPlugins()) { - rebelPlugin.onGodotMainLoopStarted(); + rebelPlugin.onMainLoopStarted(); } if (rebelHost != null) { - rebelHost.onGodotMainLoopStarted(); + rebelHost.onMainLoopStarted(); } } @@ -437,7 +437,7 @@ private void vibrate(int durationMs) { public void restart() { if (rebelHost != null) { - rebelHost.onGodotRestartRequested(this); + rebelHost.onRestart(this); } } @@ -948,7 +948,7 @@ private void forceQuit() { // The proper fix will involve tracking down and properly shutting down each // Rebel Engine component that is started in onVideoInit. if (rebelHost != null) { - rebelHost.onGodotForceQuit(this); + rebelHost.onQuit(this); } } diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelHost.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelHost.java index 4352243b59..624969388e 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelHost.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelHost.java @@ -45,23 +45,23 @@ default List getCommandLine() { } /** - * Invoked on the render thread when the Godot setup is complete. + * Invoked on the render thread when the Rebel Engine setup is complete. */ - default void onGodotSetupCompleted() {} + default void onSetupCompleted() {} /** - * Invoked on the render thread when the Godot main loop has started. + * Invoked on the render thread when the Rebel Engine main loop has started. */ - default void onGodotMainLoopStarted() {} + default void onMainLoopStarted() {} /** - * Invoked on the UI thread as the last step of the Godot instance clean up phase. + * Invoked on the UI thread as the last step of the Rebel Engine clean up phase. */ - default void onGodotForceQuit(RebelFragment quitFragment) {} + default void onQuit(RebelFragment quitFragment) {} /** - * Invoked on the GL thread when the Godot instance wants to be restarted. It's up to the host + * Invoked on the GL thread when the Rebel Engine is restarted. It's up to the host * to perform the appropriate action(s). */ - default void onGodotRestartRequested(RebelFragment restartFragment) {} + default void onRestart(RebelFragment restartFragment) {} } diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPlugin.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPlugin.java index 4af9eeec2e..0394cf0097 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPlugin.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPlugin.java @@ -233,14 +233,14 @@ public void onMainDestroy() {} public boolean onMainBackPressed() { return false; } /** - * Invoked on the render thread when the Godot setup is complete. + * Invoked on the render thread when the Rebel Engine setup is complete. */ - public void onGodotSetupCompleted() {} + public void onSetupCompleted() {} /** - * Invoked on the render thread when the Godot main loop has started. + * Invoked on the render thread when the Rebel Engine main loop has started. */ - public void onGodotMainLoopStarted() {} + public void onMainLoopStarted() {} /** * Invoked once per frame on the GL thread after the frame is drawn. diff --git a/platform/android/java_godot_lib_jni.cpp b/platform/android/java_godot_lib_jni.cpp index 083f2be452..5112a0f1a9 100644 --- a/platform/android/java_godot_lib_jni.cpp +++ b/platform/android/java_godot_lib_jni.cpp @@ -253,9 +253,9 @@ JNIEXPORT void JNICALL Java_com_rebeltoolbox_rebelengine_RebelEngine_step(JNIEnv return; // should exit instead and print the error } - godot_java->on_godot_setup_completed(env); + godot_java->on_setup_completed(env); os_android->main_loop_begin(); - godot_java->on_godot_main_loop_started(env); + godot_java->on_main_loop_started(env); step.increment(); } diff --git a/platform/android/java_godot_wrapper.cpp b/platform/android/java_godot_wrapper.cpp index e5d647b40b..7021e4319e 100644 --- a/platform/android/java_godot_wrapper.cpp +++ b/platform/android/java_godot_wrapper.cpp @@ -74,8 +74,8 @@ GodotJavaWrapper::GodotJavaWrapper(JNIEnv *p_env, jobject p_activity, jobject p_ _is_activity_resumed = p_env->GetMethodID(java_method_class, "isActivityResumed", "()Z"); _vibrate = p_env->GetMethodID(java_method_class, "vibrate", "(I)V"); _get_input_fallback_mapping = p_env->GetMethodID(java_method_class, "getInputFallbackMapping", "()Ljava/lang/String;"); - _on_godot_setup_completed = p_env->GetMethodID(java_method_class, "onGodotSetupCompleted", "()V"); - _on_godot_main_loop_started = p_env->GetMethodID(java_method_class, "onGodotMainLoopStarted", "()V"); + _on_setup_completed = p_env->GetMethodID(java_method_class, "onSetupCompleted", "()V"); + _on_main_loop_started = p_env->GetMethodID(java_method_class, "onMainLoopStarted", "()V"); // get some Activity method pointers... _get_class_loader = p_env->GetMethodID(activity_class, "getClassLoader", "()Ljava/lang/ClassLoader;"); @@ -131,23 +131,23 @@ void GodotJavaWrapper::on_video_init(JNIEnv *p_env) { } } -void GodotJavaWrapper::on_godot_setup_completed(JNIEnv *p_env) { - if (_on_godot_setup_completed) { +void GodotJavaWrapper::on_setup_completed(JNIEnv *p_env) { + if (_on_setup_completed) { if (p_env == NULL) { p_env = get_jni_env(); } ERR_FAIL_COND(p_env == nullptr); - p_env->CallVoidMethod(godot_instance, _on_godot_setup_completed); + p_env->CallVoidMethod(godot_instance, _on_setup_completed); } } -void GodotJavaWrapper::on_godot_main_loop_started(JNIEnv *p_env) { - if (_on_godot_main_loop_started) { +void GodotJavaWrapper::on_main_loop_started(JNIEnv *p_env) { + if (_on_main_loop_started) { if (p_env == NULL) { p_env = get_jni_env(); } ERR_FAIL_COND(p_env == nullptr); - p_env->CallVoidMethod(godot_instance, _on_godot_main_loop_started); + p_env->CallVoidMethod(godot_instance, _on_main_loop_started); } } diff --git a/platform/android/java_godot_wrapper.h b/platform/android/java_godot_wrapper.h index 7c53cd3a85..11761acb8a 100644 --- a/platform/android/java_godot_wrapper.h +++ b/platform/android/java_godot_wrapper.h @@ -63,8 +63,8 @@ class GodotJavaWrapper { jmethodID _is_activity_resumed = 0; jmethodID _vibrate = 0; jmethodID _get_input_fallback_mapping = 0; - jmethodID _on_godot_setup_completed = 0; - jmethodID _on_godot_main_loop_started = 0; + jmethodID _on_setup_completed = 0; + jmethodID _on_main_loop_started = 0; jmethodID _get_class_loader = 0; public: @@ -78,8 +78,8 @@ class GodotJavaWrapper { void gfx_init(bool gl2); void on_video_init(JNIEnv *p_env = NULL); - void on_godot_setup_completed(JNIEnv *p_env = NULL); - void on_godot_main_loop_started(JNIEnv *p_env = NULL); + void on_setup_completed(JNIEnv *p_env = NULL); + void on_main_loop_started(JNIEnv *p_env = NULL); void restart(JNIEnv *p_env = NULL); void force_quit(JNIEnv *p_env = NULL); void set_keep_screen_on(bool p_enabled); From 6972eb2e5e0f9354785ef5306ec69c29eb37a643 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Fri, 23 Jun 2023 12:00:24 +1200 Subject: [PATCH 39/41] Rename Android onRegisterPluginWithGodotNative to onRegisterPlugin --- .../rebeltoolbox/rebelengine/RebelFragment.java | 2 +- .../rebelengine/plugin/RebelPlugin.java | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java index 9793fea813..e49dc5430c 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java @@ -376,7 +376,7 @@ private void onVideoInit() { // Must occur after RebelEngine.setup has completed. for (RebelPlugin rebelPlugin : rebelPluginRegistry.getAllRebelPlugins()) { - rebelPlugin.onRegisterPluginWithGodotNative(); + rebelPlugin.onRegisterPlugin(); } setKeepScreenOn("True".equals(RebelEngine.getGlobal("display/window/energy_saving/keep_screen_on"))); diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPlugin.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPlugin.java index 0394cf0097..75f5968d7e 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPlugin.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/plugin/RebelPlugin.java @@ -103,24 +103,24 @@ protected Activity getActivity() { } /** - * Register the plugin with Godot native code. + * Register the plugin. * * This method is invoked on the render thread. */ - public final void onRegisterPluginWithGodotNative() { + public final void onRegisterPlugin() { registeredSignals.putAll( - registerPluginWithGodotNative(this, getPluginName(), getPluginMethods(), getPluginSignals(), + registerPlugin(this, getPluginName(), getPluginMethods(), getPluginSignals(), getPluginGDNativeLibrariesPaths())); } /** - * Register the plugin with Godot native code. + * Register the plugin. * * This method must be invoked on the render thread. */ - public static void registerPluginWithGodotNative(Object pluginObject, + public static void registerPlugin(Object pluginObject, RebelPluginInfoProvider rebelPluginInfoProvider) { - registerPluginWithGodotNative(pluginObject, rebelPluginInfoProvider.getPluginName(), + registerPlugin(pluginObject, rebelPluginInfoProvider.getPluginName(), Collections.emptyList(), rebelPluginInfoProvider.getPluginSignals(), rebelPluginInfoProvider.getPluginGDNativeLibrariesPaths()); @@ -128,7 +128,7 @@ public static void registerPluginWithGodotNative(Object pluginObject, rebelPluginInfoProvider.onPluginRegistered(); } - private static Map registerPluginWithGodotNative(Object pluginObject, + private static Map registerPlugin(Object pluginObject, String pluginName, List pluginMethods, Set pluginSignals, Set pluginGDNativeLibrariesPaths) { nativeRegisterSingleton(pluginName, pluginObject); From 51d8e39c58294d3033affb213cc5e0a979e33de3 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Fri, 23 Jun 2023 12:32:06 +1200 Subject: [PATCH 40/41] Rename Android method initializeGodot to initialize --- .../rebeltoolbox/rebelengine/RebelFragment.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java index e49dc5430c..80691bdf0e 100644 --- a/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java +++ b/platform/android/java/lib/src/com/rebeltoolbox/rebelengine/RebelFragment.java @@ -242,7 +242,7 @@ protected void instanceSingleton(SingletonBase s) { private ViewGroup containerLayout; public RebelView rebelView; - private boolean godot_initialized = false; + private boolean initialized = false; private SensorManager mSensorManager; private Sensor mAccelerometer; @@ -537,7 +537,7 @@ private String getInputFallbackMapping() { String expansion_pack_path; - private void initializeGodot() { + private void initialize() { if (expansion_pack_path != null) { String[] new_cmdline; int cll = 0; @@ -574,7 +574,7 @@ private void initializeGodot() { result_callback = null; - godot_initialized = true; + initialized = true; } @Override @@ -711,7 +711,7 @@ public void onCreate(Bundle icicle) { mCurrentIntent = activity.getIntent(); - initializeGodot(); + initialize(); } @Override @@ -757,7 +757,7 @@ public void onPause() { super.onPause(); activityResumed = false; - if (!godot_initialized) { + if (!initialized) { if (null != mDownloaderClientStub) { mDownloaderClientStub.disconnect(getActivity()); } @@ -794,7 +794,7 @@ public void setClipboard(String p_text) { public void onResume() { super.onResume(); activityResumed = true; - if (!godot_initialized) { + if (!initialized) { if (null != mDownloaderClientStub) { mDownloaderClientStub.connect(getActivity()); } @@ -1065,7 +1065,7 @@ public void onDownloadStateChanged(int newState) { showDashboard = false; paused = false; indeterminate = false; - initializeGodot(); + initialize(); return; default: paused = true; From 1f379f021d172d4cb9475d974eee79e6a4acc4b9 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Fri, 23 Jun 2023 13:32:56 +1200 Subject: [PATCH 41/41] Update publish-module script to Rebel Engine --- platform/android/java/lib/build.gradle | 2 +- .../java/scripts/publish-module.gradle | 32 ++++++------------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/platform/android/java/lib/build.gradle b/platform/android/java/lib/build.gradle index d8d1170ee1..234a00cc84 100644 --- a/platform/android/java/lib/build.gradle +++ b/platform/android/java/lib/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'kotlin-android' ext { PUBLISH_VERSION = getPublishVersion() - PUBLISH_ARTIFACT_ID = 'godot' + PUBLISH_ARTIFACT_ID = 'rebel' } apply from: "../scripts/publish-module.gradle" diff --git a/platform/android/java/scripts/publish-module.gradle b/platform/android/java/scripts/publish-module.gradle index 6b2aea5caf..e204dae5d9 100644 --- a/platform/android/java/scripts/publish-module.gradle +++ b/platform/android/java/scripts/publish-module.gradle @@ -24,39 +24,27 @@ afterEvaluate { // Mostly self-explanatory metadata pom { name = PUBLISH_ARTIFACT_ID - description = 'Godot Engine Android Library' - url = 'https://godotengine.org/' + description = 'Rebel Engine Android Library' + url = 'https://rebeltoolbox.com/' licenses { license { name = 'MIT License' - url = 'https://github.com/godotengine/godot/blob/master/LICENSE.txt' + url = 'https://github.com/RebelToolbox/RebelEngine/blob/main/LICENSE' } } developers { developer { - id = 'm4gr3d' - name = 'Fredia Huya-Kouadio' - email = 'fhuyakou@gmail.com' + id = 'madmiraal' + name = 'Marcel Admiraal' + email = 'info@rebeltoolbox.com' } - developer { - id = 'reduz' - name = 'Juan Linietsky' - email = 'reduzio@gmail.com' - } - developer { - id = 'akien-mga' - name = 'RĂ©mi Verschelde' - email = 'rverschelde@gmail.com' - } - // Add all other devs here... } - // Version control info - if you're using GitHub, follow the - // format as seen here + // Version control info - if you're using GitHub, follow the format as seen here scm { - connection = 'scm:git:github.com/godotengine/godot.git' - developerConnection = 'scm:git:ssh://github.com/godotengine/godot.git' - url = 'https://github.com/godotengine/godot/tree/master' + connection = 'scm:git:github.com/RebelToolbox/RebelEngine.git' + developerConnection = 'scm:git:ssh://github.com/RebelToolbox/RebelEngine.git' + url = 'https://github.com/RebelToolbox/RebelEngine/tree/master' } } }