summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/android/export/export.cpp4
-rw-r--r--platform/osx/os_osx.mm10
-rw-r--r--platform/uwp/app.cpp18
-rw-r--r--platform/windows/os_windows.cpp4
4 files changed, 18 insertions, 18 deletions
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index 84fc4f10bf..51597526ab 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -1714,7 +1714,7 @@ Error EditorExportPlatformAndroid::run(int p_device, int p_flags) {
args.push_back("--remove-all");
err = OS::get_singleton()->execute(adb,args,true,NULL,NULL,&rv);
- int port = GlobalConfig::get_singleton()->get("network/debug/remote_port");
+ int port = (int)EditorSettings::get_singleton()->get("network/debug/remote_port");
args.clear();
args.push_back("reverse");
args.push_back("tcp:"+itos(port));
@@ -2993,7 +2993,7 @@ public:
args.push_back("--remove-all");
err = OS::get_singleton()->execute(adb, args, true, NULL, NULL, &rv);
- int port = GlobalConfig::get_singleton()->get("network/debug/remote_port");
+ int port = (int)EditorSettings::get_singleton()->get("network/debug/remote_port");
args.clear();
args.push_back("reverse");
args.push_back("tcp:" + itos(port));
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index 72fba39e33..1070de724b 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -409,14 +409,14 @@ static int button_mask = 0;
if ((int)[event buttonNumber] != 2)
return;
- button_mask |= BUTTON_MASK_MIDDLE;
+ button_mask &= ~BUTTON_MASK_MIDDLE;
Ref<InputEventMouseButton> mb;
mb.instance();
get_key_modifier_state([event modifierFlags], mb);
mb->set_button_index(BUTTON_MIDDLE);
- mb->set_pressed(true);
+ mb->set_pressed(false);
mb->set_position(Vector2(mouse_x, mouse_y));
mb->set_global_position(Vector2(mouse_x, mouse_y));
mb->set_button_mask(button_mask);
@@ -816,7 +816,7 @@ void OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
unsigned int styleMask = NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | (p_desired.resizable ? NSResizableWindowMask : 0);
window_object = [[GodotWindow alloc]
- initWithContentRect:NSMakeRect(0, 0, p_desired.width / display_scale, p_desired.height / display_scale)
+ initWithContentRect:NSMakeRect(0, 0, p_desired.width, p_desired.height)
styleMask:styleMask
backing:NSBackingStoreBuffered
defer:NO];
@@ -825,8 +825,8 @@ void OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
window_view = [[GodotContentView alloc] init];
- window_size.width = p_desired.width;
- window_size.height = p_desired.height;
+ window_size.width = p_desired.width * display_scale;
+ window_size.height = p_desired.height * display_scale;
if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6 && display_scale > 1) {
[window_view setWantsBestResolutionOpenGLSurface:YES];
diff --git a/platform/uwp/app.cpp b/platform/uwp/app.cpp
index 51aba9b7fd..c773c0b746 100644
--- a/platform/uwp/app.cpp
+++ b/platform/uwp/app.cpp
@@ -263,7 +263,7 @@ void App::pointer_event(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Cor
screen_touch.instance();
screen_touch->set_device(0);
screen_touch->set_pressed(p_pressed);
- screen_touch->set_pos(Vector2(pos.X, pos.Y));
+ screen_touch->set_position(Vector2(pos.X, pos.Y));
screen_touch->set_index(_get_finger(point->PointerId));
last_touch_x[screen_touch->get_index()] = pos.X;
@@ -280,8 +280,8 @@ void App::pointer_event(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Cor
mouse_button->set_device(0);
mouse_button->set_pressed(p_pressed);
mouse_button->set_button_index(but);
- mouse_button->set_pos(Vector2(pos.X, pos.Y));
- mouse_button->set_global_pos(Vector2(pos.X, pos.Y));
+ mouse_button->set_position(Vector2(pos.X, pos.Y));
+ mouse_button->set_global_position(Vector2(pos.X, pos.Y));
if (p_is_wheel) {
if (point->Properties->MouseWheelDelta > 0) {
@@ -355,9 +355,9 @@ void App::OnPointerMoved(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Co
Ref<InputEventScreenDrag> screen_drag;
screen_drag.instance();
screen_drag->set_device(0);
- screen_drag->set_pos(Vector2(pos.X, pos.Y));
+ screen_drag->set_position(Vector2(pos.X, pos.Y));
screen_drag->set_index(_get_finger(point->PointerId));
- screen_drag->set_relative(Vector2(screen_drag->get_pos().x - last_touch_x[screen_drag->get_index()], screen_drag->get_pos().y - last_touch_y[screen_drag->get_index()]));
+ screen_drag->set_relative(Vector2(screen_drag->get_position().x - last_touch_x[screen_drag->get_index()], screen_drag->get_position().y - last_touch_y[screen_drag->get_index()]));
os->input_event(screen_drag);
if (number_of_contacts > 1)
@@ -372,8 +372,8 @@ void App::OnPointerMoved(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Co
Ref<InputEventMouseMotion> mouse_motion;
mouse_motion.instance();
mouse_motion->set_device(0);
- mouse_motion->set_pos(Vector2(pos.X, pos.Y));
- mouse_motion->set_global_pos(Vector2(pos.X, pos.Y));
+ mouse_motion->set_position(Vector2(pos.X, pos.Y));
+ mouse_motion->set_global_position(Vector2(pos.X, pos.Y));
mouse_motion->set_relative(Vector2(pos.X - last_touch_x[31], pos.Y - last_touch_y[31]));
last_mouse_pos = pos;
@@ -394,8 +394,8 @@ void App::OnMouseMoved(MouseDevice ^ mouse_device, MouseEventArgs ^ args) {
Ref<InputEventMouseMotion> mouse_motion;
mouse_motion.instance();
mouse_motion->set_device(0);
- mouse_motion->set_pos(Vector2(pos.X, pos.Y));
- mouse_motion->set_global_pos(Vector2(pos.X, pos.Y));
+ mouse_motion->set_position(Vector2(pos.X, pos.Y));
+ mouse_motion->set_global_position(Vector2(pos.X, pos.Y));
mouse_motion->set_relative(Vector2(args->MouseDelta.X, args->MouseDelta.Y));
last_mouse_pos = pos;
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 4393cad3bf..e94529dd94 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -543,8 +543,6 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
mb->set_position(Vector2(old_x, old_y));
}
- mb->set_global_position(mb->get_position());
-
if (uMsg != WM_MOUSEWHEEL) {
if (mb->is_pressed()) {
@@ -568,6 +566,8 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
mb->set_position(Vector2(coords.x, coords.y));
}
+ mb->set_global_position(mb->get_position());
+
if (main_loop) {
input->parse_input_event(mb);
if (mb->is_pressed() && mb->get_button_index() > 3) {