diff options
Diffstat (limited to 'core/os')
-rw-r--r-- | core/os/input_event.cpp | 13 | ||||
-rw-r--r-- | core/os/os.cpp | 3 | ||||
-rw-r--r-- | core/os/os.h | 3 |
3 files changed, 16 insertions, 3 deletions
diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp index 25a5c2afeb..a072017353 100644 --- a/core/os/input_event.cpp +++ b/core/os/input_event.cpp @@ -717,8 +717,17 @@ bool InputEventJoypadMotion::action_match(const Ref<InputEvent> &p_event, bool * bool pressed = same_direction ? Math::abs(jm->get_axis_value()) >= p_deadzone : false; if (p_pressed != NULL) *p_pressed = pressed; - if (p_strength != NULL) - *p_strength = pressed ? CLAMP(Math::inverse_lerp(p_deadzone, 1.0f, Math::abs(jm->get_axis_value())), 0.0f, 1.0f) : 0.0f; + if (p_strength != NULL) { + if (pressed) { + if (p_deadzone == 1.0f) { + *p_strength = 1.0f; + } else { + *p_strength = CLAMP(Math::inverse_lerp(p_deadzone, 1.0f, Math::abs(jm->get_axis_value())), 0.0f, 1.0f); + } + } else { + *p_strength = 0.0f; + } + } } return match; } diff --git a/core/os/os.cpp b/core/os/os.cpp index ea378c9e83..1a3c9ac5f8 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -465,6 +465,9 @@ void OS::_ensure_user_data_dir() { memdelete(da); } +void OS::set_native_icon(const String &p_filename) { +} + void OS::set_icon(const Ref<Image> &p_icon) { } diff --git a/core/os/os.h b/core/os/os.h index 4ae8a354e5..4f6a539e78 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -273,7 +273,7 @@ public: virtual String get_environment(const String &p_var) const = 0; virtual bool set_environment(const String &p_var, const String &p_value) const = 0; - virtual String get_name() = 0; + virtual String get_name() const = 0; virtual List<String> get_cmdline_args() const { return _cmdline; } virtual String get_model_name() const; @@ -451,6 +451,7 @@ public: virtual void make_rendering_thread(); virtual void swap_buffers(); + virtual void set_native_icon(const String &p_filename); virtual void set_icon(const Ref<Image> &p_icon); virtual int get_exit_code() const; |