summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/io/stream_peer.cpp3
-rw-r--r--core/os/input_event.cpp5
-rw-r--r--core/os/input_event.h1
3 files changed, 8 insertions, 1 deletions
diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp
index fdad7c7bdf..faf0700edf 100644
--- a/core/io/stream_peer.cpp
+++ b/core/io/stream_peer.cpp
@@ -459,8 +459,9 @@ Error StreamPeerBuffer::get_partial_data(uint8_t *p_buffer, int p_bytes, int &r_
}
PoolVector<uint8_t>::Read r = data.read();
- copymem(p_buffer, r.ptr(), r_received);
+ copymem(p_buffer, r.ptr() + pointer, r_received);
+ pointer += r_received;
// FIXME: return what? OK or ERR_*
}
diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp
index fe0e2c2524..cb38eb67b6 100644
--- a/core/os/input_event.cpp
+++ b/core/os/input_event.cpp
@@ -595,6 +595,11 @@ float InputEventJoypadMotion::get_axis_value() const {
return axis_value;
}
+bool InputEventJoypadMotion::is_pressed() const {
+
+ return Math::abs(axis_value) > 0.5f;
+}
+
bool InputEventJoypadMotion::action_match(const Ref<InputEvent> &p_event) const {
Ref<InputEventJoypadMotion> jm = p_event;
diff --git a/core/os/input_event.h b/core/os/input_event.h
index b120d4b840..d1fd7cc90f 100644
--- a/core/os/input_event.h
+++ b/core/os/input_event.h
@@ -348,6 +348,7 @@ public:
void set_axis_value(float p_value);
float get_axis_value() const;
+ virtual bool is_pressed() const;
virtual bool action_match(const Ref<InputEvent> &p_event) const;
virtual bool is_action_type() const { return true; }