rename Input.get_mouse_speed() to Input.get_last_mouse_speed()

This commit is contained in:
Juan Linietsky 2017-01-13 19:23:42 -03:00
parent b191ea8f02
commit a97551902e
11 changed files with 18 additions and 18 deletions

View File

@ -74,7 +74,7 @@ void Input::_bind_methods() {
ClassDB::bind_method(_MD("get_magnetometer"),&Input::get_magnetometer);
ClassDB::bind_method(_MD("get_gyroscope"),&Input::get_gyroscope);
//ClassDB::bind_method(_MD("get_mouse_pos"),&Input::get_mouse_pos); - this is not the function you want
ClassDB::bind_method(_MD("get_mouse_speed"),&Input::get_mouse_speed);
ClassDB::bind_method(_MD("get_last_mouse_speed"),&Input::get_last_mouse_speed);
ClassDB::bind_method(_MD("get_mouse_button_mask"),&Input::get_mouse_button_mask);
ClassDB::bind_method(_MD("set_mouse_mode","mode"),&Input::set_mouse_mode);
ClassDB::bind_method(_MD("get_mouse_mode"),&Input::get_mouse_mode);

View File

@ -77,7 +77,7 @@ public:
virtual void stop_joy_vibration(int p_device)=0;
virtual Point2 get_mouse_pos() const=0;
virtual Point2 get_mouse_speed() const=0;
virtual Point2 get_last_mouse_speed() const=0;
virtual int get_mouse_button_mask() const=0;
virtual void warp_mouse_pos(const Vector2& p_to)=0;

View File

@ -465,7 +465,7 @@ Point2 InputDefault::get_mouse_pos() const {
return mouse_pos;
}
Point2 InputDefault::get_mouse_speed() const {
Point2 InputDefault::get_last_mouse_speed() const {
return mouse_speed_track.speed;
}

View File

@ -196,7 +196,7 @@ public:
virtual Vector3 get_gyroscope() const;
virtual Point2 get_mouse_pos() const;
virtual Point2 get_mouse_speed() const;
virtual Point2 get_last_mouse_speed() const;
virtual int get_mouse_button_mask() const;
virtual void warp_mouse_pos(const Vector2& p_to);

View File

@ -1776,7 +1776,7 @@ void VisualScriptEditor::drop_data_fw(const Point2& p_point,const Variant& p_dat
if (node) {
graph->set_selected(node);
_node_selected(node);
}
}
}
if (d.has("type") && String(d["type"])=="resource") {
@ -3082,7 +3082,7 @@ void VisualScriptEditor::_menu_option(int p_what) {
//popup disappearing grabs focus to owner, so use call deferred
node_filter->call_deferred("grab_focus");
node_filter->call_deferred("select_all");
} break;
} break;
case EDIT_COPY_NODES:
case EDIT_CUT_NODES: {

View File

@ -482,8 +482,8 @@ void OS_Android::process_touch(int p_what,int p_pointer, const Vector<TouchPos>&
ev.mouse_motion.x=p_points[0].pos.x;
ev.mouse_motion.y=p_points[0].pos.y;
input->set_mouse_pos(Point2(ev.mouse_motion.x,ev.mouse_motion.y));
ev.mouse_motion.speed_x=input->get_mouse_speed().x;
ev.mouse_motion.speed_y=input->get_mouse_speed().y;
ev.mouse_motion.speed_x=input->get_last_mouse_speed().x;
ev.mouse_motion.speed_y=input->get_last_mouse_speed().y;
ev.mouse_motion.relative_x=p_points[0].pos.x-last_mouse.x;
ev.mouse_motion.relative_y=p_points[0].pos.y-last_mouse.y;
last_mouse=p_points[0].pos;

View File

@ -376,8 +376,8 @@ void OSBB10::handle_screen_event(bps_event_t *event) {
ievent.mouse_motion.x = ievent.mouse_motion.global_x = mpos.x;
ievent.mouse_motion.y = ievent.mouse_motion.global_y = mpos.y;
input->set_mouse_pos(Point2(ievent.mouse_motion.x,ievent.mouse_motion.y));
ievent.mouse_motion.speed_x=input->get_mouse_speed().x;
ievent.mouse_motion.speed_y=input->get_mouse_speed().y;
ievent.mouse_motion.speed_x=input->get_last_mouse_speed().x;
ievent.mouse_motion.speed_y=input->get_last_mouse_speed().y;
ievent.mouse_motion.relative_x = mrel.x;
ievent.mouse_motion.relative_y = mrel.y;
ievent.mouse_motion.button_mask = 1; // pressed

View File

@ -219,8 +219,8 @@ void HaikuDirectWindow::HandleMouseMoved(BMessage* message) {
input->set_mouse_pos(pos);
motion_event.mouse_motion.global_x = pos.x;
motion_event.mouse_motion.global_y = pos.y;
motion_event.mouse_motion.speed_x = input->get_mouse_speed().x;
motion_event.mouse_motion.speed_y = input->get_mouse_speed().y;
motion_event.mouse_motion.speed_x = input->get_last_mouse_speed().x;
motion_event.mouse_motion.speed_y = input->get_last_mouse_speed().y;
motion_event.mouse_motion.relative_x = rel.x;
motion_event.mouse_motion.relative_y = rel.y;

View File

@ -644,8 +644,8 @@ void OS_JavaScript::process_touch(int p_what,int p_pointer, const Vector<TouchPo
ev.mouse_motion.x=p_points[0].pos.x;
ev.mouse_motion.y=p_points[0].pos.y;
input->set_mouse_pos(Point2(ev.mouse_motion.x,ev.mouse_motion.y));
ev.mouse_motion.speed_x=input->get_mouse_speed().x;
ev.mouse_motion.speed_y=input->get_mouse_speed().y;
ev.mouse_motion.speed_x=input->get_last_mouse_speed().x;
ev.mouse_motion.speed_y=input->get_last_mouse_speed().y;
ev.mouse_motion.relative_x=p_points[0].pos.x-last_mouse.x;
ev.mouse_motion.relative_y=p_points[0].pos.y-last_mouse.y;
last_mouse=p_points[0].pos;

View File

@ -401,8 +401,8 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) {
}
input->set_mouse_pos(Point2(mm.x,mm.y));
mm.speed_x=input->get_mouse_speed().x;
mm.speed_y=input->get_mouse_speed().y;
mm.speed_x=input->get_last_mouse_speed().x;
mm.speed_y=input->get_last_mouse_speed().y;
if (old_invalid) {

View File

@ -1467,8 +1467,8 @@ void OS_X11::process_xevents() {
input->set_mouse_pos(pos);
motion_event.mouse_motion.global_x=pos.x;
motion_event.mouse_motion.global_y=pos.y;
motion_event.mouse_motion.speed_x=input->get_mouse_speed().x;
motion_event.mouse_motion.speed_y=input->get_mouse_speed().y;
motion_event.mouse_motion.speed_x=input->get_last_mouse_speed().x;
motion_event.mouse_motion.speed_y=input->get_last_mouse_speed().y;
motion_event.mouse_motion.relative_x=rel.x;
motion_event.mouse_motion.relative_y=rel.y;