summaryrefslogtreecommitdiff
path: root/core/os
diff options
context:
space:
mode:
Diffstat (limited to 'core/os')
-rw-r--r--core/os/file_access.cpp2
-rw-r--r--core/os/file_access.h8
-rw-r--r--core/os/input.cpp4
-rw-r--r--core/os/input.h5
4 files changed, 18 insertions, 1 deletions
diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp
index a3ee9395de..1f23e8f33d 100644
--- a/core/os/file_access.cpp
+++ b/core/os/file_access.cpp
@@ -35,6 +35,8 @@
FileAccess::CreateFunc FileAccess::create_func[ACCESS_MAX]={0,0};
+FileAccess::FileCloseFailNotify FileAccess::close_fail_notify=NULL;
+
bool FileAccess::backup_save=false;
diff --git a/core/os/file_access.h b/core/os/file_access.h
index 2c894c94eb..8d5823663e 100644
--- a/core/os/file_access.h
+++ b/core/os/file_access.h
@@ -47,6 +47,8 @@ public:
ACCESS_MAX
};
+ typedef void (*FileCloseFailNotify)(const String&);
+
typedef FileAccess*(*CreateFunc)();
bool endian_swap;
bool real_is_double;
@@ -56,7 +58,7 @@ protected:
virtual Error _open(const String& p_path, int p_mode_flags)=0; ///< open a file
virtual uint64_t _get_modified_time(const String& p_file)=0;
-
+ static FileCloseFailNotify close_fail_notify;
private:
static bool backup_save;
@@ -69,8 +71,12 @@ private:
return memnew( T );
}
+
+
public:
+ static void set_file_close_fail_notify_callback(FileCloseFailNotify p_cbk) { close_fail_notify=p_cbk; }
+
virtual void _set_access_type(AccessType p_access);
enum ModeFlags {
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;