diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/io/unzip.c | 17 | ||||
-rw-r--r-- | core/os/input.cpp | 4 | ||||
-rw-r--r-- | core/os/input.h | 5 | ||||
-rw-r--r-- | core/variant_call.cpp | 2 |
4 files changed, 23 insertions, 5 deletions
diff --git a/core/io/unzip.c b/core/io/unzip.c index 78672677f9..7aa0a86d13 100644 --- a/core/io/unzip.c +++ b/core/io/unzip.c @@ -1031,10 +1031,19 @@ local int unz64local_GetCurrentFileInfoInternal (unzFile file, if (lSeek!=0) { - if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) - lSeek=0; - else - err=UNZ_ERRNO; + if (lSeek<0) { + // WORKAROUND for backwards seeking + z_off_t pos = ZTELL64(s->z_filefunc, s->filestream); + if (ZSEEK64(s->z_filefunc, s->filestream,pos+lSeek,ZLIB_FILEFUNC_SEEK_SET)==0) + lSeek=0; + else + err=UNZ_ERRNO; + } else { + if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; + } } while(acc < file_info.size_file_extra) diff --git a/core/os/input.cpp b/core/os/input.cpp index a766ef87fc..005a248aac 100644 --- a/core/os/input.cpp +++ b/core/os/input.cpp @@ -59,6 +59,10 @@ void Input::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_joy_axis","device","axis"),&Input::get_joy_axis); ObjectTypeDB::bind_method(_MD("get_joy_name","device"),&Input::get_joy_name); 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("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); //ObjectTypeDB::bind_method(_MD("get_mouse_pos"),&Input::get_mouse_pos); - this is not the function you want diff --git a/core/os/input.h b/core/os/input.h index 46edb30aa1..6364d597b0 100644 --- a/core/os/input.h +++ b/core/os/input.h @@ -67,6 +67,11 @@ public: virtual void remove_joy_mapping(String p_guid)=0; virtual bool is_joy_known(int p_device)=0; virtual String get_joy_guid(int p_device) const=0; + 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 stop_joy_vibration(int p_device)=0; virtual Point2 get_mouse_pos() const=0; virtual Point2 get_mouse_speed() const=0; diff --git a/core/variant_call.cpp b/core/variant_call.cpp index ffe05d10d6..c1a58dff75 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -1290,7 +1290,7 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC0(STRING,STRING,String,extension,varray()); ADDFUNC0(STRING,STRING,String,basename,varray()); ADDFUNC1(STRING,STRING,String,plus_file,STRING,"file",varray()); - ADDFUNC1(STRING,STRING,String,ord_at,INT,"at",varray()); + ADDFUNC1(STRING,INT,String,ord_at,INT,"at",varray()); ADDFUNC2(STRING,NIL,String,erase,INT,"pos",INT,"chars", varray()); ADDFUNC0(STRING,INT,String,hash,varray()); ADDFUNC0(STRING,STRING,String,md5_text,varray()); |