diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/3d/arvr_nodes.h | 2 | ||||
-rw-r--r-- | scene/3d/camera.cpp | 2 | ||||
-rw-r--r-- | scene/3d/camera.h | 2 | ||||
-rw-r--r-- | scene/gui/range.cpp | 1 | ||||
-rw-r--r-- | scene/gui/tree.cpp | 1 | ||||
-rw-r--r-- | scene/main/scene_tree.cpp | 2 | ||||
-rw-r--r-- | scene/main/viewport.cpp | 5 | ||||
-rw-r--r-- | scene/resources/texture.cpp | 9 | ||||
-rw-r--r-- | scene/resources/tile_set.cpp | 45 |
9 files changed, 52 insertions, 17 deletions
diff --git a/scene/3d/arvr_nodes.h b/scene/3d/arvr_nodes.h index 8e735f7110..b647df70aa 100644 --- a/scene/3d/arvr_nodes.h +++ b/scene/3d/arvr_nodes.h @@ -55,7 +55,7 @@ public: virtual Vector3 project_local_ray_normal(const Point2 &p_pos) const; virtual Point2 unproject_position(const Vector3 &p_pos) const; - virtual Vector3 project_position(const Point2 &p_point, float p_z_depth = 0) const; + virtual Vector3 project_position(const Point2 &p_point, float p_z_depth) const; virtual Vector<Plane> get_frustum() const; ARVRCamera(); diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp index 9797b5f3ab..4d9bb69778 100644 --- a/scene/3d/camera.cpp +++ b/scene/3d/camera.cpp @@ -486,7 +486,7 @@ void Camera::_bind_methods() { ClassDB::bind_method(D_METHOD("project_ray_origin", "screen_point"), &Camera::project_ray_origin); ClassDB::bind_method(D_METHOD("unproject_position", "world_point"), &Camera::unproject_position); ClassDB::bind_method(D_METHOD("is_position_behind", "world_point"), &Camera::is_position_behind); - ClassDB::bind_method(D_METHOD("project_position", "screen_point", "z_depth"), &Camera::project_position, DEFVAL(0)); + ClassDB::bind_method(D_METHOD("project_position", "screen_point", "z_depth"), &Camera::project_position); ClassDB::bind_method(D_METHOD("set_perspective", "fov", "z_near", "z_far"), &Camera::set_perspective); ClassDB::bind_method(D_METHOD("set_orthogonal", "size", "z_near", "z_far"), &Camera::set_orthogonal); ClassDB::bind_method(D_METHOD("set_frustum", "size", "offset", "z_near", "z_far"), &Camera::set_frustum); diff --git a/scene/3d/camera.h b/scene/3d/camera.h index 22223880c1..d81e097fc5 100644 --- a/scene/3d/camera.h +++ b/scene/3d/camera.h @@ -142,7 +142,7 @@ public: virtual Vector3 project_local_ray_normal(const Point2 &p_pos) const; virtual Point2 unproject_position(const Vector3 &p_pos) const; bool is_position_behind(const Vector3 &p_pos) const; - virtual Vector3 project_position(const Point2 &p_point, float p_z_depth = 0) const; + virtual Vector3 project_position(const Point2 &p_point, float p_z_depth) const; Vector<Vector3> get_near_plane_points() const; diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp index ed5dd77f53..9c016b5a50 100644 --- a/scene/gui/range.cpp +++ b/scene/gui/range.cpp @@ -213,6 +213,7 @@ void Range::unshare() { nshared->val = shared->val; nshared->step = shared->step; nshared->page = shared->page; + nshared->exp_ratio = shared->exp_ratio; nshared->allow_greater = shared->allow_greater; nshared->allow_lesser = shared->allow_lesser; _unref_shared(); diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 2c38676c83..a44b42a467 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -4049,6 +4049,7 @@ Tree::Tree() { drop_mode_section = 0; single_select_defer = NULL; + scrolling = false; allow_rmb_select = false; force_edit_checkbox_only_on_checkbox = false; diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 5653049060..78ceccfca2 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -2066,7 +2066,7 @@ SceneTree::SceneTree() { int ref_atlas_subdiv = GLOBAL_DEF("rendering/quality/reflections/atlas_subdiv", 8); ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/reflections/atlas_subdiv", PropertyInfo(Variant::INT, "rendering/quality/reflections/atlas_subdiv", PROPERTY_HINT_RANGE, "0,32,or_greater")); //next_power_of_2 will return a 0 as min value int msaa_mode = GLOBAL_DEF("rendering/quality/filters/msaa", 0); - ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/filters/msaa", PropertyInfo(Variant::INT, "rendering/quality/filters/msaa", PROPERTY_HINT_ENUM, "Disabled,2x,4x,8x,16x")); + ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/filters/msaa", PropertyInfo(Variant::INT, "rendering/quality/filters/msaa", PROPERTY_HINT_ENUM, "Disabled,2x,4x,8x,16x,External 2x,External 4x")); root->set_msaa(Viewport::MSAA(msaa_mode)); GLOBAL_DEF("rendering/quality/depth/hdr", true); diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 1af88171f6..563fcb9961 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -2955,7 +2955,7 @@ int Viewport::gui_get_canvas_sort_index() { void Viewport::set_msaa(MSAA p_msaa) { - ERR_FAIL_INDEX(p_msaa, 5); + ERR_FAIL_INDEX(p_msaa, 7); if (msaa == p_msaa) return; msaa = p_msaa; @@ -3022,6 +3022,7 @@ bool Viewport::gui_is_dragging() const { } void Viewport::set_input_as_handled() { + _drop_physics_mouseover(); if (handle_input_locally) { local_input_handled = true; } else { @@ -3186,7 +3187,7 @@ void Viewport::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "transparent_bg"), "set_transparent_background", "has_transparent_background"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "handle_input_locally"), "set_handle_input_locally", "is_handling_input_locally"); ADD_GROUP("Rendering", ""); - ADD_PROPERTY(PropertyInfo(Variant::INT, "msaa", PROPERTY_HINT_ENUM, "Disabled,2x,4x,8x,16x"), "set_msaa", "get_msaa"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "msaa", PROPERTY_HINT_ENUM, "Disabled,2x,4x,8x,16x,External 2x,External 4x"), "set_msaa", "get_msaa"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "hdr"), "set_hdr", "get_hdr"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disable_3d"), "set_disable_3d", "is_3d_disabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "keep_3d_linear"), "set_keep_3d_linear", "get_keep_3d_linear"); diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index c2e2f85723..593c399f62 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -2369,16 +2369,20 @@ RES ResourceFormatLoaderTextureLayered::load(const String &p_path, const String if (header[0] == 'G' && header[1] == 'D' && header[2] == '3' && header[3] == 'T') { if (tex3d.is_null()) { + f->close(); memdelete(f); ERR_FAIL_COND_V(tex3d.is_null(), RES()) } } else if (header[0] == 'G' && header[1] == 'D' && header[2] == 'A' && header[3] == 'T') { if (texarr.is_null()) { + f->close(); memdelete(f); ERR_FAIL_COND_V(texarr.is_null(), RES()) } } else { + f->close(); + memdelete(f); ERR_FAIL_V_MSG(RES(), "Unrecognized layered texture file format '" + String((const char *)header) + "'."); } @@ -2418,6 +2422,7 @@ RES ResourceFormatLoaderTextureLayered::load(const String &p_path, const String if (r_error) { *r_error = ERR_FILE_CORRUPT; } + f->close(); memdelete(f); ERR_FAIL_V(RES()); } @@ -2453,6 +2458,7 @@ RES ResourceFormatLoaderTextureLayered::load(const String &p_path, const String if (r_error) { *r_error = ERR_FILE_CORRUPT; } + f->close(); memdelete(f); ERR_FAIL_V(RES()); } @@ -2473,8 +2479,9 @@ RES ResourceFormatLoaderTextureLayered::load(const String &p_path, const String if (bytes != total_size) { if (r_error) { *r_error = ERR_FILE_CORRUPT; - memdelete(f); } + f->close(); + memdelete(f); ERR_FAIL_V(RES()); } } diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index 24122a8d99..16a95e65a8 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -148,20 +148,45 @@ bool TileSet::_set(const StringName &p_name, const Variant &p_value) { } } } else if (what == "shape") - for (int i = 0; i < tile_get_shape_count(id); i++) - tile_set_shape(id, i, p_value); + if (tile_get_shape_count(id) > 0) { + for (int i = 0; i < tile_get_shape_count(id); i++) { + tile_set_shape(id, i, p_value); + } + } else { + tile_set_shape(id, 0, p_value); + } else if (what == "shape_offset") - for (int i = 0; i < tile_get_shape_count(id); i++) - tile_set_shape_offset(id, i, p_value); + if (tile_get_shape_count(id) > 0) { + for (int i = 0; i < tile_get_shape_count(id); i++) { + tile_set_shape_offset(id, i, p_value); + } + } else { + tile_set_shape_offset(id, 0, p_value); + } else if (what == "shape_transform") - for (int i = 0; i < tile_get_shape_count(id); i++) - tile_set_shape_transform(id, i, p_value); + if (tile_get_shape_count(id) > 0) { + for (int i = 0; i < tile_get_shape_count(id); i++) { + tile_set_shape_transform(id, i, p_value); + } + } else { + tile_set_shape_transform(id, 0, p_value); + } else if (what == "shape_one_way") - for (int i = 0; i < tile_get_shape_count(id); i++) - tile_set_shape_one_way(id, i, p_value); + if (tile_get_shape_count(id) > 0) { + for (int i = 0; i < tile_get_shape_count(id); i++) { + tile_set_shape_one_way(id, i, p_value); + } + } else { + tile_set_shape_one_way(id, 0, p_value); + } else if (what == "shape_one_way_margin") - for (int i = 0; i < tile_get_shape_count(id); i++) - tile_set_shape_one_way_margin(id, i, p_value); + if (tile_get_shape_count(id) > 0) { + for (int i = 0; i < tile_get_shape_count(id); i++) { + tile_set_shape_one_way_margin(id, i, p_value); + } + } else { + tile_set_shape_one_way_margin(id, 0, p_value); + } else if (what == "shapes") _tile_set_shapes(id, p_value); else if (what == "occluder") |