From 6d09183c44e6db0ca1896f50f8727e55716dd85c Mon Sep 17 00:00:00 2001 From: Andreas Haas Date: Tue, 21 Jun 2016 17:06:41 +0200 Subject: [PATCH] Set default duration parameter of joystick vibration to 0. --- core/os/input.cpp | 2 +- core/os/input.h | 2 +- main/input_default.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/os/input.cpp b/core/os/input.cpp index 005a248aac3..dacddc0928e 100644 --- a/core/os/input.cpp +++ b/core/os/input.cpp @@ -61,7 +61,7 @@ void Input::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_joy_guid","device"),&Input::get_joy_guid); ObjectTypeDB::bind_method(_MD("get_joy_vibration_strength", "device"), &Input::get_joy_vibration_strength); ObjectTypeDB::bind_method(_MD("get_joy_vibration_duration", "device"), &Input::get_joy_vibration_duration); - ObjectTypeDB::bind_method(_MD("start_joy_vibration", "device", "weak_magnitude", "strong_magnitude", "duration"), &Input::start_joy_vibration); + ObjectTypeDB::bind_method(_MD("start_joy_vibration", "device", "weak_magnitude", "strong_magnitude", "duration"), &Input::start_joy_vibration, DEFVAL(0)); ObjectTypeDB::bind_method(_MD("stop_joy_vibration", "device"), &Input::stop_joy_vibration); ObjectTypeDB::bind_method(_MD("get_accelerometer"),&Input::get_accelerometer); ObjectTypeDB::bind_method(_MD("get_magnetometer"),&Input::get_magnetometer); diff --git a/core/os/input.h b/core/os/input.h index 6364d597b02..fa2cef54678 100644 --- a/core/os/input.h +++ b/core/os/input.h @@ -70,7 +70,7 @@ public: virtual Vector2 get_joy_vibration_strength(int p_device)=0; virtual float get_joy_vibration_duration(int p_device)=0; virtual uint64_t get_joy_vibration_timestamp(int p_device)=0; - virtual void start_joy_vibration(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration)=0; + virtual void start_joy_vibration(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration=0)=0; virtual void stop_joy_vibration(int p_device)=0; virtual Point2 get_mouse_pos() const=0; diff --git a/main/input_default.h b/main/input_default.h index 00a381ff021..c7fef8374c7 100644 --- a/main/input_default.h +++ b/main/input_default.h @@ -189,7 +189,7 @@ public: void set_magnetometer(const Vector3& p_magnetometer); void set_joy_axis(int p_device,int p_axis,float p_value); - virtual void start_joy_vibration(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration); + virtual void start_joy_vibration(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration=0); virtual void stop_joy_vibration(int p_device); void set_main_loop(MainLoop *main_loop);