diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/main/node.cpp | 7 | ||||
-rw-r--r-- | scene/main/node.h | 1 | ||||
-rw-r--r-- | scene/resources/material.cpp | 2 | ||||
-rw-r--r-- | scene/resources/material.h | 4 | ||||
-rw-r--r-- | scene/resources/style_box.cpp | 6 |
5 files changed, 18 insertions, 2 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 217dacfbfe..2a2a6bb41d 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -850,6 +850,11 @@ void Node::set_process_priority(int p_priority) { data.tree->make_group_changed("physics_process_internal"); } +int Node::get_process_priority() const { + + return data.process_priority; +} + void Node::set_process_input(bool p_enable) { if (p_enable == data.input) @@ -2754,6 +2759,7 @@ void Node::_bind_methods() { ClassDB::bind_method(D_METHOD("get_process_delta_time"), &Node::get_process_delta_time); ClassDB::bind_method(D_METHOD("set_process", "enable"), &Node::set_process); ClassDB::bind_method(D_METHOD("set_process_priority", "priority"), &Node::set_process_priority); + ClassDB::bind_method(D_METHOD("get_process_priority"), &Node::get_process_priority); ClassDB::bind_method(D_METHOD("is_processing"), &Node::is_processing); ClassDB::bind_method(D_METHOD("set_process_input", "enable"), &Node::set_process_input); ClassDB::bind_method(D_METHOD("is_processing_input"), &Node::is_processing_input); @@ -2894,6 +2900,7 @@ void Node::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "owner", PROPERTY_HINT_RESOURCE_TYPE, "Node", 0), "set_owner", "get_owner"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "multiplayer", PROPERTY_HINT_RESOURCE_TYPE, "MultiplayerAPI", 0), "", "get_multiplayer"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "custom_multiplayer", PROPERTY_HINT_RESOURCE_TYPE, "MultiplayerAPI", 0), "set_custom_multiplayer", "get_custom_multiplayer"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "process_priority"), "set_process_priority", "get_process_priority"); BIND_VMETHOD(MethodInfo("_process", PropertyInfo(Variant::REAL, "delta"))); BIND_VMETHOD(MethodInfo("_physics_process", PropertyInfo(Variant::REAL, "delta"))); diff --git a/scene/main/node.h b/scene/main/node.h index a8bcd2f273..6d0ff7e5cf 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -350,6 +350,7 @@ public: bool is_processing_internal() const; void set_process_priority(int p_priority); + int get_process_priority() const; void set_process_input(bool p_enable); bool is_processing_input() const; diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index fab0aace14..41bf7f4bf0 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -1405,8 +1405,8 @@ void SpatialMaterial::set_texture(TextureParam p_param, const Ref<Texture> &p_te textures[p_param] = p_texture; RID rid = p_texture.is_valid() ? p_texture->get_rid() : RID(); VS::get_singleton()->material_set_param(_get_material(), shader_names->texture_names[p_param], rid); - _queue_shader_change(); _change_notify(); + _queue_shader_change(); } Ref<Texture> SpatialMaterial::get_texture(TextureParam p_param) const { diff --git a/scene/resources/material.h b/scene/resources/material.h index 2423d6d48b..1c69a754b6 100644 --- a/scene/resources/material.h +++ b/scene/resources/material.h @@ -260,6 +260,8 @@ private: uint64_t proximity_fade : 1; uint64_t distance_fade : 2; uint64_t emission_op : 1; + uint64_t texture_metallic : 1; + uint64_t texture_roughness : 1; }; uint64_t key; @@ -305,6 +307,8 @@ private: mk.proximity_fade = proximity_fade_enabled; mk.distance_fade = distance_fade; mk.emission_op = emission_op; + mk.texture_metallic = textures[TEXTURE_METALLIC].is_valid() ? 1 : 0; + mk.texture_roughness = textures[TEXTURE_ROUGHNESS].is_valid() ? 1 : 0; return mk; } diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp index 9ee7c2936e..d56360f918 100644 --- a/scene/resources/style_box.cpp +++ b/scene/resources/style_box.cpp @@ -694,6 +694,11 @@ void StyleBoxFlat::draw(RID p_canvas_item, const Rect2 &p_rect) const { return; } + Rect2 style_rect = p_rect.grow_individual(expand_margin[MARGIN_LEFT], expand_margin[MARGIN_TOP], expand_margin[MARGIN_RIGHT], expand_margin[MARGIN_BOTTOM]); + if (Math::is_zero_approx(style_rect.size.width) || Math::is_zero_approx(style_rect.size.height)) { + return; + } + bool rounded_corners = (corner_radius[0] > 0) || (corner_radius[1] > 0) || (corner_radius[2] > 0) || (corner_radius[3] > 0); bool aa_on = rounded_corners && anti_aliased; @@ -701,7 +706,6 @@ void StyleBoxFlat::draw(RID p_canvas_item, const Rect2 &p_rect) const { bool blend_on = blend_border && draw_border; - Rect2 style_rect = p_rect.grow_individual(expand_margin[MARGIN_LEFT], expand_margin[MARGIN_TOP], expand_margin[MARGIN_RIGHT], expand_margin[MARGIN_BOTTOM]); Rect2 border_style_rect = style_rect; if (aa_on && !blend_on) { float aa_size_grow = 0.5 * ((aa_size + 1) / 2); |