diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/bind/core_bind.cpp | 10 | ||||
-rw-r--r-- | core/event_queue.cpp | 18 | ||||
-rw-r--r-- | core/image.cpp | 12 | ||||
-rw-r--r-- | core/image.h | 1 | ||||
-rw-r--r-- | core/object.cpp | 7 | ||||
-rw-r--r-- | core/object.h | 4 |
6 files changed, 41 insertions, 11 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 5839467388..439855fbb7 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -709,13 +709,13 @@ void _OS::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_screen_count"),&_OS::get_screen_count); ObjectTypeDB::bind_method(_MD("get_current_screen"),&_OS::get_current_screen); - ObjectTypeDB::bind_method(_MD("set_current_screen"),&_OS::set_current_screen); - ObjectTypeDB::bind_method(_MD("get_screen_position"),&_OS::get_screen_position,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_screen_size"),&_OS::get_screen_size,DEFVAL(0)); + ObjectTypeDB::bind_method(_MD("set_current_screen","screen"),&_OS::set_current_screen); + ObjectTypeDB::bind_method(_MD("get_screen_position","screen"),&_OS::get_screen_position,DEFVAL(0)); + ObjectTypeDB::bind_method(_MD("get_screen_size","screen"),&_OS::get_screen_size,DEFVAL(0)); ObjectTypeDB::bind_method(_MD("get_window_position"),&_OS::get_window_position); - ObjectTypeDB::bind_method(_MD("set_window_position"),&_OS::set_window_position); + ObjectTypeDB::bind_method(_MD("set_window_position","position"),&_OS::set_window_position); ObjectTypeDB::bind_method(_MD("get_window_size"),&_OS::get_window_size); - ObjectTypeDB::bind_method(_MD("set_window_size"),&_OS::set_window_size); + ObjectTypeDB::bind_method(_MD("set_window_size","size"),&_OS::set_window_size); ObjectTypeDB::bind_method(_MD("set_window_fullscreen","enabled"),&_OS::set_window_fullscreen); ObjectTypeDB::bind_method(_MD("is_window_fullscreen"),&_OS::is_window_fullscreen); ObjectTypeDB::bind_method(_MD("set_window_resizable","enabled"),&_OS::set_window_resizable); diff --git a/core/event_queue.cpp b/core/event_queue.cpp index cf6e742f79..161fb4fedd 100644 --- a/core/event_queue.cpp +++ b/core/event_queue.cpp @@ -56,28 +56,36 @@ Error EventQueue::push_call(uint32_t p_instance_ID, const StringName& p_method, buffer_end+=sizeof(Event); - if (args==1) { + if (args>=1) { Variant * v = memnew_placement( &event_buffer[ buffer_end ], Variant ); buffer_end+=sizeof(Variant); *v=p_arg1; - } else if (args==2) { + } + + if (args>=2) { Variant * v = memnew_placement( &event_buffer[ buffer_end ], Variant ); buffer_end+=sizeof(Variant); *v=p_arg2; - } else if (args==3) { + } + + if (args>=3) { Variant * v = memnew_placement( &event_buffer[ buffer_end ], Variant ); buffer_end+=sizeof(Variant); *v=p_arg3; - } else if (args==4) { + } + + if (args>=4) { Variant * v = memnew_placement( &event_buffer[ buffer_end ], Variant ); buffer_end+=sizeof(Variant); *v=p_arg4; - } else if (args==5) { + } + + if (args>=5) { Variant * v = memnew_placement( &event_buffer[ buffer_end ], Variant ); buffer_end+=sizeof(Variant); diff --git a/core/image.cpp b/core/image.cpp index 17ee569b6b..ea09787f01 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -134,6 +134,18 @@ void Image::get_mipmap_offset_and_size(int p_mipmap,int &r_ofs, int &r_size) con } +void Image::get_mipmap_offset_size_and_dimensions(int p_mipmap,int &r_ofs, int &r_size,int &w, int& h) const { + + + int ofs; + _get_mipmap_offset_and_size(p_mipmap,ofs,w,h); + int ofs2,w2,h2; + _get_mipmap_offset_and_size(p_mipmap+1,ofs2,w2,h2); + r_ofs=ofs; + r_size=ofs2-ofs; + +} + void Image::put_pixel(int p_x,int p_y, const Color& p_color,int p_mipmap){ ERR_FAIL_INDEX(p_mipmap,mipmaps+1); diff --git a/core/image.h b/core/image.h index f4c96703b9..8ef7a54c78 100644 --- a/core/image.h +++ b/core/image.h @@ -236,6 +236,7 @@ public: int get_mipmap_offset(int p_mipmap) const; //get where the mipmap begins in data void get_mipmap_offset_and_size(int p_mipmap,int &r_ofs, int &r_size) const; //get where the mipmap begins in data + void get_mipmap_offset_size_and_dimensions(int p_mipmap,int &r_ofs, int &r_size,int &w, int& h) const; //get where the mipmap begins in data /** * Resize the image, using the prefered interpolation method. diff --git a/core/object.cpp b/core/object.cpp index 2b83f728d1..f71521a0ff 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1503,6 +1503,8 @@ void Object::_bind_methods() { ObjectTypeDB::bind_method(_MD("XL_MESSAGE","message"),&Object::XL_MESSAGE); ObjectTypeDB::bind_method(_MD("tr","message"),&Object::tr); + ObjectTypeDB::bind_method(_MD("is_queued_for_deletion"),&Object::is_queued_for_deletion); + ADD_SIGNAL( MethodInfo("script_changed")); BIND_VMETHOD( MethodInfo("_notification",PropertyInfo(Variant::INT,"what")) ); @@ -1566,6 +1568,10 @@ void Object::get_translatable_strings(List<String> *p_strings) const { } +bool Object::is_queued_for_deletion() const { + return _is_queued_for_deletion; +} + #ifdef TOOLS_ENABLED void Object::set_edited(bool p_edited) { @@ -1587,6 +1593,7 @@ Object::Object() { _instance_ID=0; _instance_ID = ObjectDB::add_instance(this); _can_translate=true; + _is_queued_for_deletion=false; script_instance=NULL; #ifdef TOOLS_ENABLED diff --git a/core/object.h b/core/object.h index eb885f5d20..0bd3d09c21 100644 --- a/core/object.h +++ b/core/object.h @@ -397,7 +397,6 @@ friend void postinitialize_handler(Object*); protected: - virtual bool _use_builtin_script() const { return false; } virtual void _initialize_typev() { initialize_type(); } virtual bool _setv(const StringName& p_name,const Variant &p_property) { return false; }; @@ -589,6 +588,9 @@ public: StringName XL_MESSAGE(const StringName& p_message) const; //translate message (internationalization) StringName tr(const StringName& p_message) const; //translate message (alternative) + bool _is_queued_for_deletion; // set to true by SceneTree::queue_delete() + bool is_queued_for_deletion() const; + _FORCE_INLINE_ void set_message_translation(bool p_enable) { _can_translate=p_enable; } _FORCE_INLINE_ bool can_translate_messages() const { return _can_translate; } Object(); |