summaryrefslogtreecommitdiff
path: root/core/os
diff options
context:
space:
mode:
Diffstat (limited to 'core/os')
-rw-r--r--core/os/main_loop.cpp10
-rw-r--r--core/os/main_loop.h2
-rw-r--r--core/os/memory.h9
3 files changed, 16 insertions, 5 deletions
diff --git a/core/os/main_loop.cpp b/core/os/main_loop.cpp
index 310bbaa3b8..e5feebfbfc 100644
--- a/core/os/main_loop.cpp
+++ b/core/os/main_loop.cpp
@@ -43,6 +43,7 @@ void MainLoop::_bind_methods() {
BIND_VMETHOD( MethodInfo("_initialize") );
BIND_VMETHOD( MethodInfo("_iteration",PropertyInfo(Variant::REAL,"delta")) );
BIND_VMETHOD( MethodInfo("_idle",PropertyInfo(Variant::REAL,"delta")) );
+ BIND_VMETHOD( MethodInfo("_drop_files",PropertyInfo(Variant::STRING_ARRAY,"files"),PropertyInfo(Variant::INT,"screen")) );
BIND_VMETHOD( MethodInfo("_finalize") );
BIND_CONSTANT(NOTIFICATION_WM_MOUSE_ENTER);
@@ -108,6 +109,15 @@ bool MainLoop::idle(float p_time) {
return false;
}
+
+void MainLoop::drop_files(const Vector<String>& p_files,int p_from_screen) {
+
+
+ if (get_script_instance())
+ get_script_instance()->call("_drop_files",p_files,p_from_screen);
+
+}
+
void MainLoop::finish() {
if (get_script_instance()) {
diff --git a/core/os/main_loop.h b/core/os/main_loop.h
index a34014983e..57185d9d3d 100644
--- a/core/os/main_loop.h
+++ b/core/os/main_loop.h
@@ -64,6 +64,8 @@ public:
virtual bool idle(float p_time);
virtual void finish();
+ virtual void drop_files(const Vector<String>& p_files,int p_from_screen=0);
+
void set_init_script(const Ref<Script>& p_init_script);
MainLoop();
diff --git a/core/os/memory.h b/core/os/memory.h
index 8257e66851..5f4c6f929c 100644
--- a/core/os/memory.h
+++ b/core/os/memory.h
@@ -211,7 +211,7 @@ void * operator new(size_t p_size,void *p_pointer,size_t check, const char *p_de
#ifdef DEBUG_MEMORY_ENABLED
-#define memalloc(m_size) Memory::alloc_static(m_size, __FILE__":"__STR(__LINE__)", memalloc.")
+#define memalloc(m_size) Memory::alloc_static(m_size, __FILE__ ":" __STR(__LINE__) ", memalloc.")
#define memrealloc(m_mem,m_size) Memory::realloc_static(m_mem,m_size)
#define memfree(m_size) Memory::free_static(m_size)
@@ -224,8 +224,7 @@ void * operator new(size_t p_size,void *p_pointer,size_t check, const char *p_de
#endif
#ifdef DEBUG_MEMORY_ENABLED
-
-#define dynalloc(m_size) Memory::alloc_dynamic(m_size, __FILE__":"__STR(__LINE__)", type: DYNAMIC")
+#define dynalloc(m_size) Memory::alloc_dynamic(m_size, __FILE__ ":" __STR(__LINE__) ", type: DYNAMIC")
#define dynrealloc(m_mem,m_size) m_mem.resize(m_size)
#else
@@ -248,7 +247,7 @@ _ALWAYS_INLINE_ T *_post_initialize(T *p_obj) {
#ifdef DEBUG_MEMORY_ENABLED
-#define memnew(m_class) _post_initialize(new(__FILE__":"__STR(__LINE__)", memnew type: "__STR(m_class)) m_class)
+#define memnew(m_class) _post_initialize(new(__FILE__ ":" __STR(__LINE__) ", memnew type: " __STR(m_class)) m_class)
#else
@@ -291,7 +290,7 @@ void memdelete_allocator(T *p_class) {
#define memdelete_notnull(m_v) { if (m_v) memdelete(m_v); }
#ifdef DEBUG_MEMORY_ENABLED
-#define memnew_arr( m_class, m_count ) memnew_arr_template<m_class>(m_count,__FILE__":"__STR(__LINE__)", memnew_arr type: "_STR(m_class))
+#define memnew_arr( m_class, m_count ) memnew_arr_template<m_class>(m_count,__FILE__ ":" __STR(__LINE__) ", memnew_arr type: " _STR(m_class))
#else