diff options
Diffstat (limited to 'platform/uwp')
-rw-r--r-- | platform/uwp/app.cpp | 16 | ||||
-rw-r--r-- | platform/uwp/export/export.cpp | 4 | ||||
-rw-r--r-- | platform/uwp/os_uwp.cpp | 6 | ||||
-rw-r--r-- | platform/uwp/os_uwp.h | 4 |
4 files changed, 14 insertions, 16 deletions
diff --git a/platform/uwp/app.cpp b/platform/uwp/app.cpp index 67f054aeaa..1da17ffc5d 100644 --- a/platform/uwp/app.cpp +++ b/platform/uwp/app.cpp @@ -145,7 +145,7 @@ void App::SetWindow(CoreWindow ^ p_window) { Main::setup2(); } -static int _get_button(Windows::UI::Input::PointerPoint ^ pt) { +static MouseButton _get_button(Windows::UI::Input::PointerPoint ^ pt) { using namespace Windows::UI::Input; #if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP @@ -177,7 +177,7 @@ static int _get_button(Windows::UI::Input::PointerPoint ^ pt) { } #endif - return 0; + return MOUSE_BUTTON_NONE; }; static bool _is_touch(Windows::UI::Input::PointerPoint ^ pointerPoint) { @@ -241,10 +241,10 @@ static int _get_finger(uint32_t p_touch_id) { void App::pointer_event(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::PointerEventArgs ^ args, bool p_pressed, bool p_is_wheel) { Windows::UI::Input::PointerPoint ^ point = args->CurrentPoint; Windows::Foundation::Point pos = _get_pixel_position(window, point->Position, os); - int but = _get_button(point); + MouseButton 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)); diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index a7edc6e6e5..1075ae38ce 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -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); } diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp index 65934b6681..e26e204f5f 100644 --- a/platform/uwp/os_uwp.cpp +++ b/platform/uwp/os_uwp.cpp @@ -126,8 +126,6 @@ void OS_UWP::set_keep_screen_on(bool p_enabled) { } void OS_UWP::initialize_core() { - last_button_state = 0; - //RedirectIOToConsole(); FileAccess::make_default<FileAccessWindows>(FileAccess::ACCESS_RESOURCES); @@ -423,7 +421,7 @@ Point2 OS_UWP::get_mouse_position() const { return Point2(old_x, old_y); } -int OS_UWP::get_mouse_button_state() const { +MouseButton OS_UWP::get_mouse_button_state() const { return last_button_state; } @@ -562,7 +560,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); diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h index a4d3d6d52a..3a735889b0 100644 --- a/platform/uwp/os_uwp.h +++ b/platform/uwp/os_uwp.h @@ -106,7 +106,7 @@ private: bool control_mem; bool meta_mem; bool force_quit; - uint32_t last_button_state; + MouseButton last_button_state = MOUSE_BUTTON_NONE; CursorShape cursor_shape; @@ -173,7 +173,7 @@ public: MouseMode get_mouse_mode() const; virtual Point2 get_mouse_position() const; - virtual int get_mouse_button_state() const; + virtual MouseButton get_mouse_button_state() const; virtual void set_window_title(const String &p_title); virtual void set_video_mode(const VideoMode &p_video_mode, int p_screen = 0); |