diff options
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/os_android.cpp | 26 | ||||
-rw-r--r-- | platform/iphone/os_iphone.cpp | 16 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 38 | ||||
-rw-r--r-- | platform/windows/os_windows.cpp | 40 | ||||
-rw-r--r-- | platform/x11/os_x11.cpp | 8 |
5 files changed, 64 insertions, 64 deletions
diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index 1c721c645c..6e8b46e252 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -380,8 +380,8 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> ev->set_button_index(BUTTON_LEFT); ev->set_button_mask(BUTTON_MASK_LEFT); ev->set_pressed(false); - ev->set_pos(touch[0].pos); - ev->set_global_pos(touch[0].pos); + ev->set_position(touch[0].pos); + ev->set_global_position(touch[0].pos); input->parse_input_event(ev); } @@ -391,7 +391,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> ev.instance(); ev->set_index(touch[i].id); ev->set_pressed(false); - ev->set_pos(touch[i].pos); + ev->set_position(touch[i].pos); input->parse_input_event(ev); } } @@ -410,8 +410,8 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> ev->set_button_index(BUTTON_LEFT); ev->set_button_mask(BUTTON_MASK_LEFT); ev->set_pressed(true); - ev->set_pos(touch[0].pos); - ev->set_global_pos(touch[0].pos); + ev->set_position(touch[0].pos); + ev->set_global_position(touch[0].pos); input->set_mouse_position(Point2(touch[0].pos.x, touch[0].pos.y)); last_mouse = touch[0].pos; input->parse_input_event(ev); @@ -424,7 +424,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> ev.instance(); ev->set_index(touch[i].id); ev->set_pressed(true); - ev->set_pos(touch[i].pos.x); + ev->set_position(touch[i].pos.x); input->parse_input_event(ev); } @@ -436,7 +436,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> Ref<InputEventMouseMotion> ev; ev.instance(); ev->set_button_mask(BUTTON_MASK_LEFT); - ev->set_pos(p_points[0].pos.x); + ev->set_position(p_points[0].pos.x); input->set_mouse_position(Point2(ev.mouse_motion.x, ev.mouse_motion.y)); ev->set_speed(input->get_last_mouse_speed()); ev->set_relative(p_points[0].pos - last_mouse); @@ -465,7 +465,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> Ref<InputEventScreenDrag> ev; ev.instance(); ev->set_index(touch[i].id); - ev->set_pos(p_points[idx].pos.x); + ev->set_position(p_points[idx].pos.x); ev->set_relative(p_points[idx].pos - touch[i].pos); input->parse_input_event(ev); touch[i].pos = p_points[idx].pos; @@ -481,8 +481,8 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> ev->set_button_index(BUTTON_LEFT); ev->set_button_mask(BUTTON_MASK_LEFT); ev->set_pressed(false); - ev->set_pos(touch[0].pos.x); - ev->set_global_pos(touch[0].pos.x); + ev->set_position(touch[0].pos.x); + ev->set_global_position(touch[0].pos.x); input->set_mouse_position(Point2(touch[0].pos.x, touch[0].pos.y)); input->parse_input_event(ev); @@ -492,7 +492,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> ev.instance(); ev->set_index(touch[i].id); ev->set_pressed(false); - ev->set_pos(touch[i].pos); + ev->set_position(touch[i].pos); input->parse_input_event(ev); } touch.clear(); @@ -511,7 +511,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> ev->set_index(tp.id); ev->set_pressed(true); - ev->set_pos(tp.pos); + ev->set_position(tp.pos); input->parse_input_event(ev); } break; @@ -524,7 +524,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> ev.instance(); ev->set_index(touch[i].id); ev->set_pressed(false); - ev->set_pos(touch[i].pos); + ev->set_position(touch[i].pos); input->parse_input_event(ev); touch.remove(i); i--; diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index 0d7913446e..b244edbff6 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -212,7 +212,7 @@ void OSIPhone::mouse_button(int p_idx, int p_x, int p_y, bool p_pressed, bool p_ ev->set_index(p_idx); ev->set_pressed(p_pressed); - ev->set_pos(Vector2(p_x, p_y)); + ev->set_position(Vector2(p_x, p_y)); queue_event(ev); }; @@ -225,12 +225,12 @@ void OSIPhone::mouse_button(int p_idx, int p_x, int p_y, bool p_pressed, bool p_ // swaped it for tilted screen //ev->get_pos().x = ev.mouse_button.global_x = video_mode.height - p_y; //ev->get_pos().y = ev.mouse_button.global_y = p_x; - ev->set_pos(Vector2(video_mode.height - p_y, p_x)); - ev->set_global_pos(Vector2(video_mode.height - p_y, p_x)); + ev->set_position(Vector2(video_mode.height - p_y, p_x)); + ev->set_global_position(Vector2(video_mode.height - p_y, p_x)); //mouse_list.pressed[p_idx] = p_pressed; - input->set_mouse_position(ev->get_pos()); + input->set_mouse_position(ev->get_position()); ev->set_button_index(BUTTON_LEFT); ev->set_doubleclick(p_doubleclick); ev->set_pressed(p_pressed); @@ -246,7 +246,7 @@ void OSIPhone::mouse_move(int p_idx, int p_prev_x, int p_prev_y, int p_x, int p_ Ref<InputEventScreenDrag> ev; ev.instance(); ev->set_index(p_idx); - ev->set_pos(Vector2(p_x, p_y)); + ev->set_position(Vector2(p_x, p_y)); ev->set_relative(Vector2(p_x - p_prev_x, p_y - p_prev_y)); queue_event(ev); }; @@ -255,11 +255,11 @@ void OSIPhone::mouse_move(int p_idx, int p_prev_x, int p_prev_y, int p_x, int p_ Ref<InputEventMouseMotion> ev; ev.instance(); - ev->set_pos(Vector2(p_x, p_y)); - ev->set_global_pos(Vector2(p_x, p_y)); + ev->set_position(Vector2(p_x, p_y)); + ev->set_global_position(Vector2(p_x, p_y)); ev->set_relative(Vector2(p_x - p_prev_x, p_y - p_prev_y)); - input->set_mouse_position(ev->get_pos()); + input->set_mouse_position(ev->get_position()); ev->set_speed(input->get_last_mouse_speed()); ev->set_button_mask(BUTTON_LEFT); // pressed diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 13bc2226f4..cb37f18090 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -291,8 +291,8 @@ static int button_mask = 0; get_key_modifier_state([event modifierFlags], mb); mb->set_button_index(BUTTON_LEFT); mb->set_pressed(true); - mb->set_pos(Vector2(mouse_x, mouse_y)); - mb->set_global_pos(Vector2(mouse_x, mouse_y)); + mb->set_position(Vector2(mouse_x, mouse_y)); + mb->set_global_position(Vector2(mouse_x, mouse_y)); mb->set_button_mask(button_mask); mb->set_doubleclick([event clickCount] == 2); OS_OSX::singleton->push_input(mb); @@ -311,8 +311,8 @@ static int button_mask = 0; get_key_modifier_state([event modifierFlags], mb); mb->set_button_index(BUTTON_LEFT); mb->set_pressed(false); - mb->set_pos(Vector2(mouse_x, mouse_y)); - mb->set_global_pos(Vector2(mouse_x, mouse_y)); + mb->set_position(Vector2(mouse_x, mouse_y)); + mb->set_global_position(Vector2(mouse_x, mouse_y)); mb->set_button_mask(button_mask); mb->set_doubleclick([event clickCount] == 2); OS_OSX::singleton->push_input(mb); @@ -330,8 +330,8 @@ static int button_mask = 0; const NSPoint p = [event locationInWindow]; mouse_x = p.x * OS_OSX::singleton->_mouse_scale([[event window] backingScaleFactor]); mouse_y = (contentRect.size.height - p.y) * OS_OSX::singleton->_mouse_scale([[event window] backingScaleFactor]); - mm->set_pos(Vector2(mouse_x, mouse_y)); - mm->set_global_pos(Vector2(mouse_x, mouse_y)); + mm->set_position(Vector2(mouse_x, mouse_y)); + mm->set_global_position(Vector2(mouse_x, mouse_y)); Vector2 relativeMotion = Vector2(); relativeMotion.x = [event deltaX] * OS_OSX::singleton->_mouse_scale([[event window] backingScaleFactor]); relativeMotion.y = [event deltaY] * OS_OSX::singleton->_mouse_scale([[event window] backingScaleFactor]); @@ -352,8 +352,8 @@ static int button_mask = 0; get_key_modifier_state([event modifierFlags], mb); mb->set_button_index(BUTTON_RIGHT); mb->set_pressed(true); - mb->set_pos(Vector2(mouse_x, mouse_y)); - mb->set_global_pos(Vector2(mouse_x, mouse_y)); + mb->set_position(Vector2(mouse_x, mouse_y)); + mb->set_global_position(Vector2(mouse_x, mouse_y)); mb->set_button_mask(button_mask); mb->set_doubleclick([event clickCount] == 2); OS_OSX::singleton->push_input(mb); @@ -373,8 +373,8 @@ static int button_mask = 0; get_key_modifier_state([event modifierFlags], mb); mb->set_button_index(BUTTON_RIGHT); mb->set_pressed(false); - mb->set_pos(Vector2(mouse_x, mouse_y)); - mb->set_global_pos(Vector2(mouse_x, mouse_y)); + mb->set_position(Vector2(mouse_x, mouse_y)); + mb->set_global_position(Vector2(mouse_x, mouse_y)); mb->set_button_mask(button_mask); mb->set_doubleclick([event clickCount] == 2); OS_OSX::singleton->push_input(mb); @@ -393,8 +393,8 @@ static int button_mask = 0; get_key_modifier_state([event modifierFlags], mb); mb->set_button_index(BUTTON_MIDDLE); mb->set_pressed(true); - mb->set_pos(Vector2(mouse_x, mouse_y)); - mb->set_global_pos(Vector2(mouse_x, mouse_y)); + mb->set_position(Vector2(mouse_x, mouse_y)); + mb->set_global_position(Vector2(mouse_x, mouse_y)); mb->set_button_mask(button_mask); mb->set_doubleclick([event clickCount] == 2); OS_OSX::singleton->push_input(mb); @@ -417,8 +417,8 @@ static int button_mask = 0; get_key_modifier_state([event modifierFlags], mb); mb->set_button_index(BUTTON_MIDDLE); mb->set_pressed(true); - mb->set_pos(Vector2(mouse_x, mouse_y)); - mb->set_global_pos(Vector2(mouse_x, mouse_y)); + mb->set_position(Vector2(mouse_x, mouse_y)); + mb->set_global_position(Vector2(mouse_x, mouse_y)); mb->set_button_mask(button_mask); mb->set_doubleclick([event clickCount] == 2); OS_OSX::singleton->push_input(mb); @@ -701,8 +701,8 @@ inline void sendScrollEvent(int button, double factor, int modifierFlags) { sc->set_factor(factor); sc->set_pressed(true); Vector2 mouse_pos = Vector2(mouse_x, mouse_y); - sc->set_pos(mouse_pos); - sc->set_global_pos(mouse_pos); + sc->set_position(mouse_pos); + sc->set_global_position(mouse_pos); sc->set_button_mask(button_mask); OS_OSX::singleton->push_input(sc); sc->set_pressed(false); @@ -974,7 +974,7 @@ void OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_au NSRect nsrect = [[screenArray objectAtIndex:i] visibleFrame]; Rect2 rect = Rect2(nsrect.origin.x, nsrect.origin.y, nsrect.size.width, nsrect.size.height); - rect.pos *= displayScale; + rect.position *= displayScale; rect.size *= displayScale; screens.push_back(rect); @@ -1275,7 +1275,7 @@ void OS_OSX::set_current_screen(int p_screen) { Point2 OS_OSX::get_screen_position(int p_screen) const { ERR_FAIL_INDEX_V(p_screen, screens.size(), Point2()); - return screens[p_screen].pos; + return screens[p_screen].position; }; int OS_OSX::get_screen_dpi(int p_screen) const { @@ -1384,7 +1384,7 @@ void OS_OSX::set_window_maximized(bool p_enabled) { [window_object setFrame:[[[NSScreen screens] objectAtIndex:current_screen] visibleFrame] display:YES]; } else { set_window_size(restore_rect.size); - set_window_position(restore_rect.pos); + set_window_position(restore_rect.position); }; maximized = p_enabled; }; diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 830aae5515..a9fcf70b55 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -219,7 +219,7 @@ void OS_Windows::_touch_event(bool p_pressed, int p_x, int p_y, int idx) { event.instance(); event->set_index(idx); event->set_pressed(p_pressed); - event->set_pos(Vector2(p_x, p_y)); + event->set_position(Vector2(p_x, p_y)); if (main_loop) { input->parse_input_event(event); @@ -231,7 +231,7 @@ void OS_Windows::_drag_event(int p_x, int p_y, int idx) { Ref<InputEventScreenDrag> event; event.instance(); event->set_index(idx); - event->set_pos(Vector2(p_x, p_y)); + event->set_position(Vector2(p_x, p_y)); if (main_loop) input->parse_input_event(event); @@ -378,7 +378,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) last_button_state = mm->get_button_mask(); /*mm->get_button_mask()|=(wParam&MK_XBUTTON1)?(1<<5):0; mm->get_button_mask()|=(wParam&MK_XBUTTON2)?(1<<6):0;*/ - mm->set_pos(Vector2(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); + mm->set_position(Vector2(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); if (mouse_mode == MOUSE_MODE_CAPTURED) { @@ -386,31 +386,31 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) old_x = c.x; old_y = c.y; - if (mm->get_pos() == c) { + if (mm->get_position() == c) { center = c; return 0; } - Point2i ncenter = mm->get_pos(); + Point2i ncenter = mm->get_position(); center = ncenter; POINT pos = { (int)c.x, (int)c.y }; ClientToScreen(hWnd, &pos); SetCursorPos(pos.x, pos.y); } - input->set_mouse_position(mm->get_pos()); + input->set_mouse_position(mm->get_position()); mm->set_speed(input->get_last_mouse_speed()); if (old_invalid) { - old_x = mm->get_pos().x; - old_y = mm->get_pos().y; + old_x = mm->get_position().x; + old_y = mm->get_position().y; old_invalid = false; } - mm->set_relative(Vector2(mm->get_pos() - Vector2(old_x, old_y))); - old_x = mm->get_pos().x; - old_y = mm->get_pos().y; + mm->set_relative(Vector2(mm->get_position() - Vector2(old_x, old_y))); + old_x = mm->get_position().x; + old_y = mm->get_position().y; if (window_has_focus && main_loop) input->parse_input_event(mm); @@ -536,14 +536,14 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) /* mb->get_button_mask()|=(wParam&MK_XBUTTON1)?(1<<5):0; mb->get_button_mask()|=(wParam&MK_XBUTTON2)?(1<<6):0;*/ - mb->set_pos(Vector2(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); + mb->set_position(Vector2(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); if (mouse_mode == MOUSE_MODE_CAPTURED) { - mb->set_pos(Vector2(old_x, old_y)); + mb->set_position(Vector2(old_x, old_y)); } - mb->set_global_pos(mb->get_pos()); + mb->set_global_position(mb->get_position()); if (uMsg != WM_MOUSEWHEEL) { if (mb->is_pressed()) { @@ -560,12 +560,12 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } else if (mouse_mode != MOUSE_MODE_CAPTURED) { // for reasons unknown to mankind, wheel comes in screen cordinates POINT coords; - coords.x = mb->get_pos().x; - coords.y = mb->get_pos().y; + coords.x = mb->get_position().x; + coords.y = mb->get_position().y; ScreenToClient(hWnd, &coords); - mb->set_pos(Vector2(coords.x, coords.y)); + mb->set_position(Vector2(coords.x, coords.y)); } if (main_loop) { @@ -889,8 +889,8 @@ BOOL CALLBACK OS_Windows::MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPR MonitorInfo minfo; minfo.hMonitor = hMonitor; minfo.hdcMonitor = hdcMonitor; - minfo.rect.pos.x = lprcMonitor->left; - minfo.rect.pos.y = lprcMonitor->top; + minfo.rect.position.x = lprcMonitor->left; + minfo.rect.position.y = lprcMonitor->top; minfo.rect.size.x = lprcMonitor->right - lprcMonitor->left; minfo.rect.size.y = lprcMonitor->bottom - lprcMonitor->top; @@ -1370,7 +1370,7 @@ void OS_Windows::set_current_screen(int p_screen) { Point2 OS_Windows::get_screen_position(int p_screen) const { ERR_FAIL_INDEX_V(p_screen, monitor_info.size(), Point2()); - return Vector2(monitor_info[p_screen].rect.pos); + return Vector2(monitor_info[p_screen].rect.position); } Size2 OS_Windows::get_screen_size(int p_screen) const { diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 2a912a7ba2..8ac37c965b 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -1334,8 +1334,8 @@ void OS_X11::process_xevents() { get_key_modifier_state(event.xbutton.state, mb); mb->set_button_mask(get_mouse_button_state(event.xbutton.state)); - mb->set_pos(Vector2(event.xbutton.x, event.xbutton.y)); - mb->set_global_pos(mb->get_pos()); + mb->set_position(Vector2(event.xbutton.x, event.xbutton.y)); + mb->set_global_position(mb->get_position()); mb->set_button_index(event.xbutton.button); if (mb->get_button_index() == 2) mb->set_button_index(3); @@ -1443,8 +1443,8 @@ void OS_X11::process_xevents() { get_key_modifier_state(event.xmotion.state, mm); mm->set_button_mask(get_mouse_button_state(event.xmotion.state)); - mm->set_pos(pos); - mm->set_global_pos(pos); + mm->set_position(pos); + mm->set_global_position(pos); input->set_mouse_position(pos); mm->set_speed(input->get_last_mouse_speed()); mm->set_relative(rel); |