summaryrefslogtreecommitdiff
path: root/platform/android
diff options
context:
space:
mode:
authorLightning_A <aaronjrecord@gmail.com>2021-06-17 16:03:09 -0600
committerLightning_A <aaronjrecord@gmail.com>2021-06-19 20:49:18 -0600
commite28fd07b2bbe78db0f286604a6eb469d8a0664be (patch)
treed10b935e7a77774960fefd93ac306db447cc2bfd /platform/android
parent60dcc4f39c0e6289dba691225c002cd6e77be6ba (diff)
Rename `instance()`->`instantiate()` when it's a verb
Diffstat (limited to 'platform/android')
-rw-r--r--platform/android/display_server_android.cpp26
-rw-r--r--platform/android/export/export.cpp14
-rw-r--r--platform/android/plugin/godot_plugin_jni.cpp2
3 files changed, 21 insertions, 21 deletions
diff --git a/platform/android/display_server_android.cpp b/platform/android/display_server_android.cpp
index ff61eeaee1..db497133aa 100644
--- a/platform/android/display_server_android.cpp
+++ b/platform/android/display_server_android.cpp
@@ -528,7 +528,7 @@ void DisplayServerAndroid::process_key_event(int p_keycode, int p_scancode, int
}
Ref<InputEventKey> ev;
- ev.instance();
+ ev.instantiate();
int val = unicode;
int keycode = android_get_keysym(p_keycode);
int phy_keycode = android_get_keysym(p_scancode);
@@ -575,7 +575,7 @@ void DisplayServerAndroid::process_touch(int p_event, int p_pointer, const Vecto
//end all if exist
for (int i = 0; i < touch.size(); i++) {
Ref<InputEventScreenTouch> ev;
- ev.instance();
+ ev.instantiate();
ev->set_index(touch[i].id);
ev->set_pressed(false);
ev->set_position(touch[i].pos);
@@ -592,7 +592,7 @@ void DisplayServerAndroid::process_touch(int p_event, int p_pointer, const Vecto
//send touch
for (int i = 0; i < touch.size(); i++) {
Ref<InputEventScreenTouch> ev;
- ev.instance();
+ ev.instantiate();
ev->set_index(touch[i].id);
ev->set_pressed(true);
ev->set_position(touch[i].pos);
@@ -618,7 +618,7 @@ void DisplayServerAndroid::process_touch(int p_event, int p_pointer, const Vecto
continue; //no move unncesearily
Ref<InputEventScreenDrag> ev;
- ev.instance();
+ ev.instantiate();
ev->set_index(touch[i].id);
ev->set_position(p_points[idx].pos);
ev->set_relative(p_points[idx].pos - touch[i].pos);
@@ -633,7 +633,7 @@ void DisplayServerAndroid::process_touch(int p_event, int p_pointer, const Vecto
//end all if exist
for (int i = 0; i < touch.size(); i++) {
Ref<InputEventScreenTouch> ev;
- ev.instance();
+ ev.instantiate();
ev->set_index(touch[i].id);
ev->set_pressed(false);
ev->set_position(touch[i].pos);
@@ -649,7 +649,7 @@ void DisplayServerAndroid::process_touch(int p_event, int p_pointer, const Vecto
touch.push_back(tp);
Ref<InputEventScreenTouch> ev;
- ev.instance();
+ ev.instantiate();
ev->set_index(tp.id);
ev->set_pressed(true);
@@ -664,7 +664,7 @@ void DisplayServerAndroid::process_touch(int p_event, int p_pointer, const Vecto
for (int i = 0; i < touch.size(); i++) {
if (touch[i].id == p_pointer) {
Ref<InputEventScreenTouch> ev;
- ev.instance();
+ ev.instantiate();
ev->set_index(touch[i].id);
ev->set_pressed(false);
ev->set_position(touch[i].pos);
@@ -685,7 +685,7 @@ void DisplayServerAndroid::process_hover(int p_type, Point2 p_pos) {
case AMOTION_EVENT_ACTION_HOVER_ENTER: // hover enter
case AMOTION_EVENT_ACTION_HOVER_EXIT: { // hover exit
Ref<InputEventMouseMotion> ev;
- ev.instance();
+ ev.instantiate();
_set_key_modifier_state(ev);
ev->set_position(p_pos);
ev->set_global_position(p_pos);
@@ -702,7 +702,7 @@ void DisplayServerAndroid::process_mouse_event(int input_device, int event_actio
case AMOTION_EVENT_ACTION_BUTTON_PRESS:
case AMOTION_EVENT_ACTION_BUTTON_RELEASE: {
Ref<InputEventMouseButton> ev;
- ev.instance();
+ ev.instantiate();
_set_key_modifier_state(ev);
if ((input_device & AINPUT_SOURCE_MOUSE) == AINPUT_SOURCE_MOUSE) {
ev->set_position(event_pos);
@@ -723,7 +723,7 @@ void DisplayServerAndroid::process_mouse_event(int input_device, int event_actio
case AMOTION_EVENT_ACTION_MOVE: {
Ref<InputEventMouseMotion> ev;
- ev.instance();
+ ev.instantiate();
_set_key_modifier_state(ev);
if ((input_device & AINPUT_SOURCE_MOUSE) == AINPUT_SOURCE_MOUSE) {
ev->set_position(event_pos);
@@ -740,7 +740,7 @@ void DisplayServerAndroid::process_mouse_event(int input_device, int event_actio
} break;
case AMOTION_EVENT_ACTION_SCROLL: {
Ref<InputEventMouseButton> ev;
- ev.instance();
+ ev.instantiate();
if ((input_device & AINPUT_SOURCE_MOUSE) == AINPUT_SOURCE_MOUSE) {
ev->set_position(event_pos);
ev->set_global_position(event_pos);
@@ -781,7 +781,7 @@ void DisplayServerAndroid::_wheel_button_click(int event_buttons_mask, const Ref
void DisplayServerAndroid::process_double_tap(int event_android_button_mask, Point2 p_pos) {
int event_button_mask = _android_button_mask_to_godot_button_mask(event_android_button_mask);
Ref<InputEventMouseButton> ev;
- ev.instance();
+ ev.instantiate();
_set_key_modifier_state(ev);
ev->set_position(p_pos);
ev->set_global_position(p_pos);
@@ -811,7 +811,7 @@ int DisplayServerAndroid::_button_index_from_mask(int button_mask) {
void DisplayServerAndroid::process_scroll(Point2 p_pos) {
Ref<InputEventPanGesture> ev;
- ev.instance();
+ ev.instantiate();
_set_key_modifier_state(ev);
ev->set_position(p_pos);
ev->set_delta(p_pos - scroll_prev_pos);
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index 4262cc1a50..923435eec5 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -1461,7 +1461,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
String project_splash_path = ProjectSettings::get_singleton()->get("application/boot_splash/image");
if (!project_splash_path.is_empty()) {
- splash_image.instance();
+ splash_image.instantiate();
print_verbose("Loading splash image: " + project_splash_path);
const Error err = ImageLoader::load_image(project_splash_path, splash_image);
if (err) {
@@ -1501,7 +1501,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
}
print_verbose("Creating splash background color image.");
- splash_bg_color_image.instance();
+ splash_bg_color_image.instantiate();
splash_bg_color_image->create(splash_image->get_width(), splash_image->get_height(), false, splash_image->get_format());
splash_bg_color_image->fill(bg_color);
@@ -1512,9 +1512,9 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
void load_icon_refs(const Ref<EditorExportPreset> &p_preset, Ref<Image> &icon, Ref<Image> &foreground, Ref<Image> &background) {
String project_icon_path = ProjectSettings::get_singleton()->get("application/config/icon");
- icon.instance();
- foreground.instance();
- background.instance();
+ icon.instantiate();
+ foreground.instantiate();
+ background.instantiate();
// Regular icon: user selection -> project icon -> default.
String path = static_cast<String>(p_preset->get(launcher_icon_option)).strip_edges();
@@ -2941,11 +2941,11 @@ public:
EditorExportPlatformAndroid() {
Ref<Image> img = memnew(Image(_android_logo));
- logo.instance();
+ logo.instantiate();
logo->create_from_image(img);
img = Ref<Image>(memnew(Image(_android_run_icon)));
- run_icon.instance();
+ run_icon.instantiate();
run_icon->create_from_image(img);
devices_changed.set();
diff --git a/platform/android/plugin/godot_plugin_jni.cpp b/platform/android/plugin/godot_plugin_jni.cpp
index ba3e9fa20f..cf0c02e2bf 100644
--- a/platform/android/plugin/godot_plugin_jni.cpp
+++ b/platform/android/plugin/godot_plugin_jni.cpp
@@ -43,7 +43,7 @@ extern "C" {
JNIEXPORT void JNICALL Java_org_godotengine_godot_plugin_GodotPlugin_nativeRegisterSingleton(JNIEnv *env, jclass clazz, jstring name, jobject obj) {
String singname = jstring_to_string(name, env);
- JNISingleton *s = (JNISingleton *)ClassDB::instance("JNISingleton");
+ JNISingleton *s = (JNISingleton *)ClassDB::instantiate("JNISingleton");
s->set_instance(env->NewGlobalRef(obj));
jni_singletons[singname] = s;