diff options
-rw-r--r-- | drivers/gles3/shaders/screen_space_reflection.glsl | 18 | ||||
-rw-r--r-- | scene/2d/node_2d.cpp | 22 | ||||
-rw-r--r-- | scene/gui/control.cpp | 12 | ||||
-rw-r--r-- | scene/main/viewport.cpp | 4 |
4 files changed, 30 insertions, 26 deletions
diff --git a/drivers/gles3/shaders/screen_space_reflection.glsl b/drivers/gles3/shaders/screen_space_reflection.glsl index e4ba712de6..8eec71ecb6 100644 --- a/drivers/gles3/shaders/screen_space_reflection.glsl +++ b/drivers/gles3/shaders/screen_space_reflection.glsl @@ -117,10 +117,10 @@ void main() { // clip the line to the viewport edges - float scale_max_x = min(1, 0.99 * (1.0 - vp_line_begin.x) / max(1e-5, vp_line_dir.x)); - float scale_max_y = min(1, 0.99 * (1.0 - vp_line_begin.y) / max(1e-5, vp_line_dir.y)); - float scale_min_x = min(1, 0.99 * vp_line_begin.x / max(1e-5, -vp_line_dir.x)); - float scale_min_y = min(1, 0.99 * vp_line_begin.y / max(1e-5, -vp_line_dir.y)); + float scale_max_x = min(1.0, 0.99 * (1.0 - vp_line_begin.x) / max(1e-5, vp_line_dir.x)); + float scale_max_y = min(1.0, 0.99 * (1.0 - vp_line_begin.y) / max(1e-5, vp_line_dir.y)); + float scale_min_x = min(1.0, 0.99 * vp_line_begin.x / max(1e-5, -vp_line_dir.x)); + float scale_min_y = min(1.0, 0.99 * vp_line_begin.y / max(1e-5, -vp_line_dir.y)); float line_clip = min(scale_max_x, scale_max_y) * min(scale_min_x, scale_min_y); line_dir *= line_clip; z_dir *= line_clip; @@ -150,9 +150,9 @@ void main() { //if acceleration > 0, distance between pixels gets larger each step. This allows covering a larger area float accel=1.0+acceleration; - float steps_taken=0; + float steps_taken=0.0; - for(float i=0;i<num_steps;i++) { + for(int i=0;i<num_steps;i++) { pos+=line_advance; z+=z_advance; @@ -232,11 +232,11 @@ void main() { } final_pos = new_pos; - grad=(steps_taken+subgrad)/num_steps; + grad=(steps_taken+subgrad)/float(num_steps); } else { #endif - grad=steps_taken/num_steps; + grad=steps_taken/float(num_steps); final_pos=pos; #ifdef SMOOTH_ACCEL } @@ -259,7 +259,7 @@ void main() { vec2 cone_dir = final_pos - line_begin; float cone_len = length(cone_dir); cone_dir = normalize(cone_dir); //will be used normalized from now on - float max_mipmap = filter_mipmap_levels -1; + float max_mipmap = filter_mipmap_levels - 1.0; float gloss_mult=gloss; float rem_alpha=1.0; diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp index 1ba6ec46cf..16b6342299 100644 --- a/scene/2d/node_2d.cpp +++ b/scene/2d/node_2d.cpp @@ -63,9 +63,10 @@ void Node2D::edit_set_state(const Variant &p_state) { angle = state[1]; _scale = state[2]; _update_transform(); - _change_notify("transform/rot"); - _change_notify("transform/scale"); - _change_notify("transform/pos"); + _change_notify("rotation"); + _change_notify("rotation_deg"); + _change_notify("scale"); + _change_notify("position"); } void Node2D::edit_set_rect(const Rect2 &p_edit_rect) { @@ -95,15 +96,16 @@ void Node2D::edit_set_rect(const Rect2 &p_edit_rect) { _scale *= new_scale; _update_transform(); - _change_notify("transform/scale"); - _change_notify("transform/pos"); + _change_notify("scale"); + _change_notify("position"); } void Node2D::edit_rotate(float p_rot) { angle += p_rot; _update_transform(); - _change_notify("transform/rot"); + _change_notify("rotation"); + _change_notify("rotation_deg"); } void Node2D::_update_xform_values() { @@ -134,7 +136,7 @@ void Node2D::set_position(const Point2 &p_pos) { ((Node2D *)this)->_update_xform_values(); pos = p_pos; _update_transform(); - _change_notify("transform/pos"); + _change_notify("position"); } void Node2D::set_rotation(float p_radians) { @@ -143,7 +145,8 @@ void Node2D::set_rotation(float p_radians) { ((Node2D *)this)->_update_xform_values(); angle = p_radians; _update_transform(); - _change_notify("transform/rot"); + _change_notify("rotation"); + _change_notify("rotation_deg"); } void Node2D::set_rotation_in_degrees(float p_degrees) { @@ -169,7 +172,7 @@ void Node2D::set_scale(const Size2 &p_scale) { if (_scale.y == 0) _scale.y = CMP_EPSILON; _update_transform(); - _change_notify("transform/scale"); + _change_notify("scale"); } Point2 Node2D::get_position() const { @@ -349,6 +352,7 @@ void Node2D::set_z(int p_z) { ERR_FAIL_COND(p_z > VS::CANVAS_ITEM_Z_MAX); z = p_z; VS::get_singleton()->canvas_item_set_z(get_canvas_item(), z); + _change_notify("z"); } void Node2D::set_z_as_relative(bool p_enabled) { diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index d2f3eea721..7f9944833a 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -1347,12 +1347,12 @@ Control::AnchorType Control::get_anchor(Margin p_margin) const { void Control::_change_notify_margins() { // this avoids sending the whole object data again on a change - _change_notify("margin/left"); - _change_notify("margin/top"); - _change_notify("margin/right"); - _change_notify("margin/bottom"); - _change_notify("rect/pos"); - _change_notify("rect/size"); + _change_notify("margin_left"); + _change_notify("margin_top"); + _change_notify("margin_right"); + _change_notify("margin_bottom"); + _change_notify("rect_pos"); + _change_notify("rect_size"); } void Control::set_margin(Margin p_margin, float p_value) { diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 23f8189167..3b8fd1ae3e 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1401,7 +1401,7 @@ void Viewport::_vp_input(const InputEvent &p_ev) { return; #ifdef TOOLS_ENABLED - if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) { + if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) { return; } #endif @@ -1422,7 +1422,7 @@ void Viewport::_vp_unhandled_input(const InputEvent &p_ev) { if (disable_input) return; #ifdef TOOLS_ENABLED - if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) { + if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) { return; } #endif |