Rename instance()->instantiate() when it's a verb
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -224,7 +224,7 @@ void DisplayServerIPhone::_window_callback(const Callable &p_callable, const Var
|
||||
void DisplayServerIPhone::touch_press(int p_idx, int p_x, int p_y, bool p_pressed, bool p_double_click) {
|
||||
if (!GLOBAL_DEF("debug/disable_touch", false)) {
|
||||
Ref<InputEventScreenTouch> ev;
|
||||
ev.instance();
|
||||
ev.instantiate();
|
||||
|
||||
ev->set_index(p_idx);
|
||||
ev->set_pressed(p_pressed);
|
||||
@@ -236,7 +236,7 @@ void DisplayServerIPhone::touch_press(int p_idx, int p_x, int p_y, bool p_presse
|
||||
void DisplayServerIPhone::touch_drag(int p_idx, int p_prev_x, int p_prev_y, int p_x, int p_y) {
|
||||
if (!GLOBAL_DEF("debug/disable_touch", false)) {
|
||||
Ref<InputEventScreenDrag> ev;
|
||||
ev.instance();
|
||||
ev.instantiate();
|
||||
ev->set_index(p_idx);
|
||||
ev->set_position(Vector2(p_x, p_y));
|
||||
ev->set_relative(Vector2(p_x - p_prev_x, p_y - p_prev_y));
|
||||
@@ -256,7 +256,7 @@ void DisplayServerIPhone::touches_cancelled(int p_idx) {
|
||||
|
||||
void DisplayServerIPhone::key(uint32_t p_key, bool p_pressed) {
|
||||
Ref<InputEventKey> ev;
|
||||
ev.instance();
|
||||
ev.instantiate();
|
||||
ev->set_echo(false);
|
||||
ev->set_pressed(p_pressed);
|
||||
ev->set_keycode(p_key);
|
||||
|
||||
@@ -820,7 +820,7 @@ Error EditorExportPlatformIOS::_export_loading_screen_file(const Ref<EditorExpor
|
||||
if (custom_launch_image_2x.length() > 0 && custom_launch_image_3x.length() > 0) {
|
||||
Ref<Image> image;
|
||||
String image_path = p_dest_dir.plus_file("splash@2x.png");
|
||||
image.instance();
|
||||
image.instantiate();
|
||||
Error err = image->load(custom_launch_image_2x);
|
||||
|
||||
if (err) {
|
||||
@@ -834,7 +834,7 @@ Error EditorExportPlatformIOS::_export_loading_screen_file(const Ref<EditorExpor
|
||||
|
||||
image.unref();
|
||||
image_path = p_dest_dir.plus_file("splash@3x.png");
|
||||
image.instance();
|
||||
image.instantiate();
|
||||
err = image->load(custom_launch_image_3x);
|
||||
|
||||
if (err) {
|
||||
@@ -851,7 +851,7 @@ Error EditorExportPlatformIOS::_export_loading_screen_file(const Ref<EditorExpor
|
||||
const String splash_path = ProjectSettings::get_singleton()->get("application/boot_splash/image");
|
||||
|
||||
if (!splash_path.is_empty()) {
|
||||
splash.instance();
|
||||
splash.instantiate();
|
||||
const Error err = splash->load(splash_path);
|
||||
if (err) {
|
||||
splash.unref();
|
||||
@@ -1999,7 +1999,7 @@ bool EditorExportPlatformIOS::can_export(const Ref<EditorExportPreset> &p_preset
|
||||
|
||||
EditorExportPlatformIOS::EditorExportPlatformIOS() {
|
||||
Ref<Image> img = memnew(Image(_iphone_logo));
|
||||
logo.instance();
|
||||
logo.instantiate();
|
||||
logo->create_from_image(img);
|
||||
|
||||
plugins_changed.set();
|
||||
@@ -2014,7 +2014,7 @@ EditorExportPlatformIOS::~EditorExportPlatformIOS() {
|
||||
|
||||
void register_iphone_exporter() {
|
||||
Ref<EditorExportPlatformIOS> platform;
|
||||
platform.instance();
|
||||
platform.instantiate();
|
||||
|
||||
EditorExport::get_singleton()->add_export_platform(platform);
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ void DisplayServerJavaScript::dom2godot_mod(T *emscripten_event_ptr, Ref<InputEv
|
||||
|
||||
Ref<InputEventKey> DisplayServerJavaScript::setup_key_event(const EmscriptenKeyboardEvent *emscripten_event) {
|
||||
Ref<InputEventKey> ev;
|
||||
ev.instance();
|
||||
ev.instantiate();
|
||||
ev->set_echo(emscripten_event->repeat);
|
||||
dom2godot_mod(emscripten_event, ev);
|
||||
ev->set_keycode(dom_code2godot_scancode(emscripten_event->code, emscripten_event->key, false));
|
||||
@@ -181,7 +181,7 @@ EM_BOOL DisplayServerJavaScript::mouse_button_callback(int p_event_type, const E
|
||||
DisplayServerJavaScript *display = get_singleton();
|
||||
|
||||
Ref<InputEventMouseButton> ev;
|
||||
ev.instance();
|
||||
ev.instantiate();
|
||||
ev->set_pressed(p_event_type == EMSCRIPTEN_EVENT_MOUSEDOWN);
|
||||
ev->set_position(compute_position_in_canvas(p_event->clientX, p_event->clientY));
|
||||
ev->set_global_position(ev->get_position());
|
||||
@@ -261,7 +261,7 @@ EM_BOOL DisplayServerJavaScript::mousemove_callback(int p_event_type, const Emsc
|
||||
return false;
|
||||
|
||||
Ref<InputEventMouseMotion> ev;
|
||||
ev.instance();
|
||||
ev.instantiate();
|
||||
dom2godot_mod(p_event, ev);
|
||||
ev->set_button_mask(input_mask);
|
||||
|
||||
@@ -452,7 +452,7 @@ EM_BOOL DisplayServerJavaScript::wheel_callback(int p_event_type, const Emscript
|
||||
|
||||
Input *input = Input::get_singleton();
|
||||
Ref<InputEventMouseButton> ev;
|
||||
ev.instance();
|
||||
ev.instantiate();
|
||||
ev->set_position(input->get_mouse_position());
|
||||
ev->set_global_position(ev->get_position());
|
||||
|
||||
@@ -492,7 +492,7 @@ EM_BOOL DisplayServerJavaScript::wheel_callback(int p_event_type, const Emscript
|
||||
EM_BOOL DisplayServerJavaScript::touch_press_callback(int p_event_type, const EmscriptenTouchEvent *p_event, void *p_user_data) {
|
||||
DisplayServerJavaScript *display = get_singleton();
|
||||
Ref<InputEventScreenTouch> ev;
|
||||
ev.instance();
|
||||
ev.instantiate();
|
||||
int lowest_id_index = -1;
|
||||
for (int i = 0; i < p_event->numTouches; ++i) {
|
||||
const EmscriptenTouchPoint &touch = p_event->touches[i];
|
||||
@@ -514,7 +514,7 @@ EM_BOOL DisplayServerJavaScript::touch_press_callback(int p_event_type, const Em
|
||||
EM_BOOL DisplayServerJavaScript::touchmove_callback(int p_event_type, const EmscriptenTouchEvent *p_event, void *p_user_data) {
|
||||
DisplayServerJavaScript *display = get_singleton();
|
||||
Ref<InputEventScreenDrag> ev;
|
||||
ev.instance();
|
||||
ev.instantiate();
|
||||
int lowest_id_index = -1;
|
||||
for (int i = 0; i < p_event->numTouches; ++i) {
|
||||
const EmscriptenTouchPoint &touch = p_event->touches[i];
|
||||
@@ -553,12 +553,12 @@ void DisplayServerJavaScript::vk_input_text_callback(const char *p_text, int p_c
|
||||
Input *input = Input::get_singleton();
|
||||
Ref<InputEventKey> k;
|
||||
for (int i = 0; i < p_cursor; i++) {
|
||||
k.instance();
|
||||
k.instantiate();
|
||||
k->set_pressed(true);
|
||||
k->set_echo(false);
|
||||
k->set_keycode(KEY_RIGHT);
|
||||
input->parse_input_event(k);
|
||||
k.instance();
|
||||
k.instantiate();
|
||||
k->set_pressed(false);
|
||||
k->set_echo(false);
|
||||
k->set_keycode(KEY_RIGHT);
|
||||
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
mimes["png"] = "image/png";
|
||||
mimes["svg"] = "image/svg";
|
||||
mimes["wasm"] = "application/wasm";
|
||||
server.instance();
|
||||
server.instantiate();
|
||||
stop();
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ class EditorExportPlatformJavaScript : public EditorExportPlatform {
|
||||
|
||||
Ref<Image> _get_project_icon() const {
|
||||
Ref<Image> icon;
|
||||
icon.instance();
|
||||
icon.instantiate();
|
||||
const String icon_path = String(GLOBAL_GET("application/config/icon")).strip_edges();
|
||||
if (icon_path.is_empty() || ImageLoader::load_image(icon_path, icon) != OK) {
|
||||
return EditorNode::get_singleton()->get_editor_theme()->get_icon("DefaultProjectIcon", "EditorIcons")->get_image();
|
||||
@@ -299,7 +299,7 @@ class EditorExportPlatformJavaScript : public EditorExportPlatform {
|
||||
|
||||
Ref<Image> _get_project_splash() const {
|
||||
Ref<Image> splash;
|
||||
splash.instance();
|
||||
splash.instantiate();
|
||||
const String splash_path = String(GLOBAL_GET("application/boot_splash/image")).strip_edges();
|
||||
if (splash_path.is_empty() || ImageLoader::load_image(splash_path, splash) != OK) {
|
||||
return Ref<Image>(memnew(Image(boot_splash_png)));
|
||||
@@ -481,7 +481,7 @@ Error EditorExportPlatformJavaScript::_add_manifest_icon(const String &p_path, c
|
||||
|
||||
Ref<Image> icon;
|
||||
if (!p_icon.is_empty()) {
|
||||
icon.instance();
|
||||
icon.instantiate();
|
||||
const Error err = ImageLoader::load_image(p_icon, icon);
|
||||
if (err != OK) {
|
||||
EditorNode::get_singleton()->show_warning(TTR("Could not read file:") + "\n" + p_icon);
|
||||
@@ -964,22 +964,22 @@ void EditorExportPlatformJavaScript::_server_thread_poll(void *data) {
|
||||
}
|
||||
|
||||
EditorExportPlatformJavaScript::EditorExportPlatformJavaScript() {
|
||||
server.instance();
|
||||
server.instantiate();
|
||||
server_thread.start(_server_thread_poll, this);
|
||||
|
||||
Ref<Image> img = memnew(Image(_javascript_logo));
|
||||
logo.instance();
|
||||
logo.instantiate();
|
||||
logo->create_from_image(img);
|
||||
|
||||
img = Ref<Image>(memnew(Image(_javascript_run_icon)));
|
||||
run_icon.instance();
|
||||
run_icon.instantiate();
|
||||
run_icon->create_from_image(img);
|
||||
|
||||
Ref<Theme> theme = EditorNode::get_singleton()->get_editor_theme();
|
||||
if (theme.is_valid()) {
|
||||
stop_icon = theme->get_icon("Stop", "EditorIcons");
|
||||
} else {
|
||||
stop_icon.instance();
|
||||
stop_icon.instantiate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1000,6 +1000,6 @@ void register_javascript_exporter() {
|
||||
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/web/ssl_certificate", PROPERTY_HINT_GLOBAL_FILE, "*.crt,*.pem"));
|
||||
|
||||
Ref<EditorExportPlatformJavaScript> platform;
|
||||
platform.instance();
|
||||
platform.instantiate();
|
||||
EditorExport::get_singleton()->add_export_platform(platform);
|
||||
}
|
||||
|
||||
@@ -2255,7 +2255,7 @@ void DisplayServerX11::_handle_key_event(WindowID p_window, XKeyEvent *p_event,
|
||||
tmp.parse_utf8(utf8string, utf8bytes);
|
||||
for (int i = 0; i < tmp.length(); i++) {
|
||||
Ref<InputEventKey> k;
|
||||
k.instance();
|
||||
k.instantiate();
|
||||
if (physical_keycode == 0 && keycode == 0 && tmp[i] == 0) {
|
||||
continue;
|
||||
}
|
||||
@@ -2346,7 +2346,7 @@ void DisplayServerX11::_handle_key_event(WindowID p_window, XKeyEvent *p_event,
|
||||
//print_verbose("mod1: "+itos(xkeyevent->state&Mod1Mask)+" mod 5: "+itos(xkeyevent->state&Mod5Mask));
|
||||
|
||||
Ref<InputEventKey> k;
|
||||
k.instance();
|
||||
k.instantiate();
|
||||
k->set_window_id(p_window);
|
||||
|
||||
_get_key_modifier_state(xkeyevent->state, k);
|
||||
@@ -2904,7 +2904,7 @@ void DisplayServerX11::process_events() {
|
||||
bool is_begin = event_data->evtype == XI_TouchBegin;
|
||||
|
||||
Ref<InputEventScreenTouch> st;
|
||||
st.instance();
|
||||
st.instantiate();
|
||||
st->set_window_id(window_id);
|
||||
st->set_index(index);
|
||||
st->set_position(pos);
|
||||
@@ -2938,7 +2938,7 @@ void DisplayServerX11::process_events() {
|
||||
|
||||
if (curr_pos_elem->value() != pos) {
|
||||
Ref<InputEventScreenDrag> sd;
|
||||
sd.instance();
|
||||
sd.instantiate();
|
||||
sd->set_window_id(window_id);
|
||||
sd->set_index(index);
|
||||
sd->set_position(pos);
|
||||
@@ -3091,7 +3091,7 @@ void DisplayServerX11::process_events() {
|
||||
// Release every pointer to avoid sticky points
|
||||
for (Map<int, Vector2>::Element *E = xi.state.front(); E; E = E->next()) {
|
||||
Ref<InputEventScreenTouch> st;
|
||||
st.instance();
|
||||
st.instantiate();
|
||||
st->set_index(E->key());
|
||||
st->set_window_id(window_id);
|
||||
st->set_position(E->get());
|
||||
@@ -3126,7 +3126,7 @@ void DisplayServerX11::process_events() {
|
||||
}
|
||||
|
||||
Ref<InputEventMouseButton> mb;
|
||||
mb.instance();
|
||||
mb.instantiate();
|
||||
|
||||
mb->set_window_id(window_id);
|
||||
_get_key_modifier_state(event.xbutton.state, mb);
|
||||
@@ -3291,7 +3291,7 @@ void DisplayServerX11::process_events() {
|
||||
}
|
||||
|
||||
Ref<InputEventMouseMotion> mm;
|
||||
mm.instance();
|
||||
mm.instantiate();
|
||||
|
||||
mm->set_window_id(window_id);
|
||||
if (xi.pressure_supported) {
|
||||
|
||||
@@ -39,11 +39,11 @@ static Error fixup_embedded_pck(const String &p_path, int64_t p_embedded_start,
|
||||
|
||||
void register_linuxbsd_exporter() {
|
||||
Ref<EditorExportPlatformPC> platform;
|
||||
platform.instance();
|
||||
platform.instantiate();
|
||||
|
||||
Ref<Image> img = memnew(Image(_linuxbsd_logo));
|
||||
Ref<ImageTexture> logo;
|
||||
logo.instance();
|
||||
logo.instantiate();
|
||||
logo->create_from_image(img);
|
||||
platform->set_logo(logo);
|
||||
platform->set_name("Linux/X11");
|
||||
|
||||
@@ -119,7 +119,7 @@ static NSCursor *_cursorFromSelector(SEL selector, SEL fallback = nil) {
|
||||
if ([event type] == NSEventTypeKeyDown) {
|
||||
if (([event modifierFlags] & NSEventModifierFlagCommand) && [event keyCode] == 0x2f) {
|
||||
Ref<InputEventKey> k;
|
||||
k.instance();
|
||||
k.instantiate();
|
||||
|
||||
_get_key_modifier_state([event modifierFlags], k);
|
||||
k->set_window_id(DisplayServerOSX::INVALID_WINDOW_ID);
|
||||
@@ -824,7 +824,7 @@ static void _mouseDownEvent(DisplayServer::WindowID window_id, NSEvent *event, i
|
||||
}
|
||||
|
||||
Ref<InputEventMouseButton> mb;
|
||||
mb.instance();
|
||||
mb.instantiate();
|
||||
mb->set_window_id(window_id);
|
||||
const Vector2 pos = _get_mouse_pos(wd, [event locationInWindow]);
|
||||
_get_key_modifier_state([event modifierFlags], mb);
|
||||
@@ -928,7 +928,7 @@ static void _mouseDownEvent(DisplayServer::WindowID window_id, NSEvent *event, i
|
||||
}
|
||||
|
||||
Ref<InputEventMouseMotion> mm;
|
||||
mm.instance();
|
||||
mm.instantiate();
|
||||
|
||||
mm->set_window_id(window_id);
|
||||
mm->set_button_mask(DS_OSX->last_button_state);
|
||||
@@ -1016,7 +1016,7 @@ static void _mouseDownEvent(DisplayServer::WindowID window_id, NSEvent *event, i
|
||||
DisplayServerOSX::WindowData &wd = DS_OSX->windows[window_id];
|
||||
|
||||
Ref<InputEventMagnifyGesture> ev;
|
||||
ev.instance();
|
||||
ev.instantiate();
|
||||
ev->set_window_id(window_id);
|
||||
_get_key_modifier_state([event modifierFlags], ev);
|
||||
ev->set_position(_get_mouse_pos(wd, [event locationInWindow]));
|
||||
@@ -1492,7 +1492,7 @@ inline void sendScrollEvent(DisplayServer::WindowID window_id, int button, doubl
|
||||
unsigned int mask = 1 << (button - 1);
|
||||
|
||||
Ref<InputEventMouseButton> sc;
|
||||
sc.instance();
|
||||
sc.instantiate();
|
||||
|
||||
sc->set_window_id(window_id);
|
||||
_get_key_modifier_state(modifierFlags, sc);
|
||||
@@ -1506,7 +1506,7 @@ inline void sendScrollEvent(DisplayServer::WindowID window_id, int button, doubl
|
||||
|
||||
Input::get_singleton()->accumulate_input_event(sc);
|
||||
|
||||
sc.instance();
|
||||
sc.instantiate();
|
||||
sc->set_window_id(window_id);
|
||||
sc->set_button_index(button);
|
||||
sc->set_factor(factor);
|
||||
@@ -1524,7 +1524,7 @@ inline void sendPanEvent(DisplayServer::WindowID window_id, double dx, double dy
|
||||
DisplayServerOSX::WindowData &wd = DS_OSX->windows[window_id];
|
||||
|
||||
Ref<InputEventPanGesture> pg;
|
||||
pg.instance();
|
||||
pg.instantiate();
|
||||
|
||||
pg->set_window_id(window_id);
|
||||
_get_key_modifier_state(modifierFlags, pg);
|
||||
@@ -3375,7 +3375,7 @@ void DisplayServerOSX::_process_key_events() {
|
||||
const KeyEvent &ke = key_event_buffer[i];
|
||||
if (ke.raw) {
|
||||
// Non IME input - no composite characters, pass events as is
|
||||
k.instance();
|
||||
k.instantiate();
|
||||
|
||||
k->set_window_id(ke.window_id);
|
||||
_get_key_modifier_state(ke.osx_state, k);
|
||||
@@ -3389,7 +3389,7 @@ void DisplayServerOSX::_process_key_events() {
|
||||
} else {
|
||||
// IME input
|
||||
if ((i == 0 && ke.keycode == 0) || (i > 0 && key_event_buffer[i - 1].keycode == 0)) {
|
||||
k.instance();
|
||||
k.instantiate();
|
||||
|
||||
k->set_window_id(ke.window_id);
|
||||
_get_key_modifier_state(ke.osx_state, k);
|
||||
@@ -3402,7 +3402,7 @@ void DisplayServerOSX::_process_key_events() {
|
||||
_push_input(k);
|
||||
}
|
||||
if (ke.keycode != 0) {
|
||||
k.instance();
|
||||
k.instantiate();
|
||||
|
||||
k->set_window_id(ke.window_id);
|
||||
_get_key_modifier_state(ke.osx_state, k);
|
||||
|
||||
@@ -700,7 +700,7 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
|
||||
}
|
||||
} else {
|
||||
Ref<Image> icon;
|
||||
icon.instance();
|
||||
icon.instantiate();
|
||||
icon->load(iconpath);
|
||||
if (!icon->is_empty()) {
|
||||
_make_icon(icon, data);
|
||||
@@ -1151,7 +1151,7 @@ bool EditorExportPlatformOSX::can_export(const Ref<EditorExportPreset> &p_preset
|
||||
|
||||
EditorExportPlatformOSX::EditorExportPlatformOSX() {
|
||||
Ref<Image> img = memnew(Image(_osx_logo));
|
||||
logo.instance();
|
||||
logo.instantiate();
|
||||
logo->create_from_image(img);
|
||||
}
|
||||
|
||||
@@ -1160,7 +1160,7 @@ EditorExportPlatformOSX::~EditorExportPlatformOSX() {
|
||||
|
||||
void register_osx_exporter() {
|
||||
Ref<EditorExportPlatformOSX> platform;
|
||||
platform.instance();
|
||||
platform.instantiate();
|
||||
|
||||
EditorExport::get_singleton()->add_export_platform(platform);
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ void App::pointer_event(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Cor
|
||||
int but = _get_button(point);
|
||||
if (_is_touch(point)) {
|
||||
Ref<InputEventScreenTouch> screen_touch;
|
||||
screen_touch.instance();
|
||||
screen_touch.instantiate();
|
||||
screen_touch->set_device(0);
|
||||
screen_touch->set_pressed(p_pressed);
|
||||
screen_touch->set_position(Vector2(pos.X, pos.Y));
|
||||
@@ -256,7 +256,7 @@ void App::pointer_event(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Cor
|
||||
os->input_event(screen_touch);
|
||||
} else {
|
||||
Ref<InputEventMouseButton> mouse_button;
|
||||
mouse_button.instance();
|
||||
mouse_button.instantiate();
|
||||
mouse_button->set_device(0);
|
||||
mouse_button->set_pressed(p_pressed);
|
||||
mouse_button->set_button_index(but);
|
||||
@@ -324,7 +324,7 @@ void App::OnPointerMoved(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Co
|
||||
|
||||
if (_is_touch(point)) {
|
||||
Ref<InputEventScreenDrag> screen_drag;
|
||||
screen_drag.instance();
|
||||
screen_drag.instantiate();
|
||||
screen_drag->set_device(0);
|
||||
screen_drag->set_position(Vector2(pos.X, pos.Y));
|
||||
screen_drag->set_index(_get_finger(point->PointerId));
|
||||
@@ -338,7 +338,7 @@ void App::OnPointerMoved(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Co
|
||||
}
|
||||
|
||||
Ref<InputEventMouseMotion> mouse_motion;
|
||||
mouse_motion.instance();
|
||||
mouse_motion.instantiate();
|
||||
mouse_motion->set_device(0);
|
||||
mouse_motion->set_position(Vector2(pos.X, pos.Y));
|
||||
mouse_motion->set_global_position(Vector2(pos.X, pos.Y));
|
||||
@@ -361,7 +361,7 @@ void App::OnMouseMoved(MouseDevice ^ mouse_device, MouseEventArgs ^ args) {
|
||||
pos.Y = last_mouse_pos.Y + args->MouseDelta.Y;
|
||||
|
||||
Ref<InputEventMouseMotion> mouse_motion;
|
||||
mouse_motion.instance();
|
||||
mouse_motion.instantiate();
|
||||
mouse_motion->set_device(0);
|
||||
mouse_motion->set_position(Vector2(pos.X, pos.Y));
|
||||
mouse_motion->set_global_position(Vector2(pos.X, pos.Y));
|
||||
|
||||
@@ -1429,7 +1429,7 @@ public:
|
||||
|
||||
EditorExportPlatformUWP() {
|
||||
Ref<Image> img = memnew(Image(_uwp_logo));
|
||||
logo.instance();
|
||||
logo.instantiate();
|
||||
logo->create_from_image(img);
|
||||
}
|
||||
};
|
||||
@@ -1446,6 +1446,6 @@ void register_uwp_exporter() {
|
||||
#endif // WINDOWS_ENABLED
|
||||
|
||||
Ref<EditorExportPlatformUWP> exporter;
|
||||
exporter.instance();
|
||||
exporter.instantiate();
|
||||
EditorExport::get_singleton()->add_export_platform(exporter);
|
||||
}
|
||||
|
||||
@@ -562,7 +562,7 @@ void OS_UWP::process_key_events() {
|
||||
KeyEvent &kev = key_event_buffer[i];
|
||||
|
||||
Ref<InputEventKey> key_event;
|
||||
key_event.instance();
|
||||
key_event.instantiate();
|
||||
key_event->set_alt_pressed(kev.alt);
|
||||
key_event->set_shift_pressed(kev.shift);
|
||||
key_event->set_ctrl_pressed(kev.control);
|
||||
|
||||
@@ -1727,7 +1727,7 @@ void DisplayServerWindows::_touch_event(WindowID p_window, bool p_pressed, float
|
||||
}
|
||||
|
||||
Ref<InputEventScreenTouch> event;
|
||||
event.instance();
|
||||
event.instantiate();
|
||||
event->set_index(idx);
|
||||
event->set_window_id(p_window);
|
||||
event->set_pressed(p_pressed);
|
||||
@@ -1746,7 +1746,7 @@ void DisplayServerWindows::_drag_event(WindowID p_window, float p_x, float p_y,
|
||||
return;
|
||||
|
||||
Ref<InputEventScreenDrag> event;
|
||||
event.instance();
|
||||
event.instantiate();
|
||||
event->set_window_id(p_window);
|
||||
event->set_index(idx);
|
||||
event->set_position(Vector2(p_x, p_y));
|
||||
@@ -1965,7 +1965,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
|
||||
|
||||
if (raw->header.dwType == RIM_TYPEMOUSE) {
|
||||
Ref<InputEventMouseMotion> mm;
|
||||
mm.instance();
|
||||
mm.instantiate();
|
||||
|
||||
mm->set_window_id(window_id);
|
||||
mm->set_ctrl_pressed(control_mem);
|
||||
@@ -2062,7 +2062,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
|
||||
break;
|
||||
|
||||
Ref<InputEventMouseMotion> mm;
|
||||
mm.instance();
|
||||
mm.instantiate();
|
||||
mm->set_window_id(window_id);
|
||||
mm->set_ctrl_pressed(GetKeyState(VK_CONTROL) < 0);
|
||||
mm->set_shift_pressed(GetKeyState(VK_SHIFT) < 0);
|
||||
@@ -2196,7 +2196,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
|
||||
}
|
||||
|
||||
Ref<InputEventMouseMotion> mm;
|
||||
mm.instance();
|
||||
mm.instantiate();
|
||||
|
||||
mm->set_window_id(window_id);
|
||||
if (pen_info.penMask & PEN_MASK_PRESSURE) {
|
||||
@@ -2302,7 +2302,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
|
||||
}
|
||||
|
||||
Ref<InputEventMouseMotion> mm;
|
||||
mm.instance();
|
||||
mm.instantiate();
|
||||
mm->set_window_id(window_id);
|
||||
mm->set_ctrl_pressed((wParam & MK_CONTROL) != 0);
|
||||
mm->set_shift_pressed((wParam & MK_SHIFT) != 0);
|
||||
@@ -2385,7 +2385,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
|
||||
case WM_XBUTTONDOWN:
|
||||
case WM_XBUTTONUP: {
|
||||
Ref<InputEventMouseButton> mb;
|
||||
mb.instance();
|
||||
mb.instantiate();
|
||||
mb->set_window_id(window_id);
|
||||
|
||||
switch (uMsg) {
|
||||
@@ -2843,7 +2843,7 @@ void DisplayServerWindows::_process_key_events() {
|
||||
prev_wc = 0;
|
||||
}
|
||||
Ref<InputEventKey> k;
|
||||
k.instance();
|
||||
k.instantiate();
|
||||
|
||||
k->set_window_id(ke.window_id);
|
||||
k->set_shift_pressed(ke.shift);
|
||||
@@ -2870,7 +2870,7 @@ void DisplayServerWindows::_process_key_events() {
|
||||
case WM_KEYUP:
|
||||
case WM_KEYDOWN: {
|
||||
Ref<InputEventKey> k;
|
||||
k.instance();
|
||||
k.instantiate();
|
||||
|
||||
k->set_window_id(ke.window_id);
|
||||
k->set_shift_pressed(ke.shift);
|
||||
|
||||
@@ -344,11 +344,11 @@ void register_windows_exporter() {
|
||||
#endif
|
||||
|
||||
Ref<EditorExportPlatformWindows> platform;
|
||||
platform.instance();
|
||||
platform.instantiate();
|
||||
|
||||
Ref<Image> img = memnew(Image(_windows_logo));
|
||||
Ref<ImageTexture> logo;
|
||||
logo.instance();
|
||||
logo.instantiate();
|
||||
logo->create_from_image(img);
|
||||
platform->set_logo(logo);
|
||||
platform->set_name("Windows Desktop");
|
||||
|
||||
Reference in New Issue
Block a user