diff options
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/animation.cpp | 2 | ||||
-rw-r--r-- | scene/resources/default_theme/default_theme.cpp | 12 | ||||
-rw-r--r-- | scene/resources/height_map_shape.cpp | 1 | ||||
-rw-r--r-- | scene/resources/mesh.cpp | 2 | ||||
-rw-r--r-- | scene/resources/mesh.h | 5 | ||||
-rw-r--r-- | scene/resources/packed_scene.cpp | 4 | ||||
-rw-r--r-- | scene/resources/particles_material.cpp | 1 | ||||
-rw-r--r-- | scene/resources/primitive_meshes.cpp | 6 | ||||
-rw-r--r-- | scene/resources/primitive_meshes.h | 1 | ||||
-rw-r--r-- | scene/resources/resource_format_text.cpp | 6 | ||||
-rw-r--r-- | scene/resources/texture.cpp | 2 | ||||
-rw-r--r-- | scene/resources/visual_shader.cpp | 2 |
12 files changed, 27 insertions, 17 deletions
diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index b49b551252..e4da659b0d 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -93,7 +93,7 @@ bool Animation::_set(const StringName &p_name, const Variant &p_value) { TransformTrack *tt = static_cast<TransformTrack *>(tracks[track]); PoolVector<float> values = p_value; int vcount = values.size(); - ERR_FAIL_COND_V(vcount % 12, false); // shuld be multiple of 11 + ERR_FAIL_COND_V(vcount % 12, false); // should be multiple of 11 PoolVector<float>::Read r = values.read(); diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index bdb6c78782..e8359e3dfe 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -582,14 +582,14 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const // GraphNode - Ref<StyleBoxTexture> graphsb = make_stylebox(graph_node_png, 6, 24, 6, 5, 16, 24, 16, 5); - Ref<StyleBoxTexture> graphsbcomment = make_stylebox(graph_node_comment_png, 6, 24, 6, 5, 16, 24, 16, 5); - Ref<StyleBoxTexture> graphsbcommentselected = make_stylebox(graph_node_comment_focus_png, 6, 24, 6, 5, 16, 24, 16, 5); - Ref<StyleBoxTexture> graphsbselected = make_stylebox(graph_node_selected_png, 6, 24, 6, 5, 16, 24, 16, 5); + Ref<StyleBoxTexture> graphsb = make_stylebox(graph_node_png, 6, 24, 6, 5, 16, 24, 16, 6); + Ref<StyleBoxTexture> graphsbcomment = make_stylebox(graph_node_comment_png, 6, 24, 6, 5, 16, 24, 16, 6); + Ref<StyleBoxTexture> graphsbcommentselected = make_stylebox(graph_node_comment_focus_png, 6, 24, 6, 5, 16, 24, 16, 6); + Ref<StyleBoxTexture> graphsbselected = make_stylebox(graph_node_selected_png, 6, 24, 6, 5, 16, 24, 16, 6); Ref<StyleBoxTexture> graphsbdefault = make_stylebox(graph_node_default_png, 4, 4, 4, 4, 6, 4, 4, 4); Ref<StyleBoxTexture> graphsbdeffocus = make_stylebox(graph_node_default_focus_png, 4, 4, 4, 4, 6, 4, 4, 4); - Ref<StyleBoxTexture> graph_bpoint = make_stylebox(graph_node_breakpoint_png, 6, 24, 6, 5, 16, 24, 16, 5); - Ref<StyleBoxTexture> graph_position = make_stylebox(graph_node_position_png, 6, 24, 6, 5, 16, 24, 16, 5); + Ref<StyleBoxTexture> graph_bpoint = make_stylebox(graph_node_breakpoint_png, 6, 24, 6, 5, 16, 24, 16, 6); + Ref<StyleBoxTexture> graph_position = make_stylebox(graph_node_position_png, 6, 24, 6, 5, 16, 24, 16, 6); //graphsb->set_expand_margin_size(MARGIN_LEFT,10); //graphsb->set_expand_margin_size(MARGIN_RIGHT,10); diff --git a/scene/resources/height_map_shape.cpp b/scene/resources/height_map_shape.cpp index 8cd271dab0..f763700d52 100644 --- a/scene/resources/height_map_shape.cpp +++ b/scene/resources/height_map_shape.cpp @@ -85,6 +85,7 @@ void HeightMapShape::_update_shape() { d["min_height"] = min_height; d["max_height"] = max_height; PhysicsServer::get_singleton()->shape_set_data(get_shape(), d); + Shape::_update_shape(); } void HeightMapShape::set_map_width(int p_new) { diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index 67639858ce..6443b44bb6 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -489,6 +489,7 @@ void Mesh::_bind_methods() { ClassDB::bind_method(D_METHOD("get_surface_count"), &Mesh::get_surface_count); ClassDB::bind_method(D_METHOD("surface_get_arrays", "surf_idx"), &Mesh::surface_get_arrays); ClassDB::bind_method(D_METHOD("surface_get_blend_shape_arrays", "surf_idx"), &Mesh::surface_get_blend_shape_arrays); + ClassDB::bind_method(D_METHOD("surface_set_material", "surf_idx", "material"), &Mesh::surface_set_material); ClassDB::bind_method(D_METHOD("surface_get_material", "surf_idx"), &Mesh::surface_get_material); BIND_ENUM_CONSTANT(PRIMITIVE_POINTS); @@ -1305,7 +1306,6 @@ void ArrayMesh::_bind_methods() { ClassDB::bind_method(D_METHOD("surface_get_array_index_len", "surf_idx"), &ArrayMesh::surface_get_array_index_len); ClassDB::bind_method(D_METHOD("surface_get_format", "surf_idx"), &ArrayMesh::surface_get_format); ClassDB::bind_method(D_METHOD("surface_get_primitive_type", "surf_idx"), &ArrayMesh::surface_get_primitive_type); - ClassDB::bind_method(D_METHOD("surface_set_material", "surf_idx", "material"), &ArrayMesh::surface_set_material); ClassDB::bind_method(D_METHOD("surface_find_by_name", "name"), &ArrayMesh::surface_find_by_name); ClassDB::bind_method(D_METHOD("surface_set_name", "surf_idx", "name"), &ArrayMesh::surface_set_name); ClassDB::bind_method(D_METHOD("surface_get_name", "surf_idx"), &ArrayMesh::surface_get_name); diff --git a/scene/resources/mesh.h b/scene/resources/mesh.h index 1457d283bd..b38791b9a6 100644 --- a/scene/resources/mesh.h +++ b/scene/resources/mesh.h @@ -128,6 +128,7 @@ public: virtual Array surface_get_blend_shape_arrays(int p_surface) const = 0; virtual uint32_t surface_get_format(int p_idx) const = 0; virtual PrimitiveType surface_get_primitive_type(int p_idx) const = 0; + virtual void surface_set_material(int p_idx, const Ref<Material> &p_material) = 0; virtual Ref<Material> surface_get_material(int p_idx) const = 0; virtual int get_blend_shape_count() const = 0; virtual StringName get_blend_shape_name(int p_index) const = 0; @@ -215,8 +216,8 @@ public: PrimitiveType surface_get_primitive_type(int p_idx) const; bool surface_is_alpha_sorting_enabled(int p_idx) const; - void surface_set_material(int p_idx, const Ref<Material> &p_material); - Ref<Material> surface_get_material(int p_idx) const; + virtual void surface_set_material(int p_idx, const Ref<Material> &p_material); + virtual Ref<Material> surface_get_material(int p_idx) const; int surface_find_by_name(const String &p_name) const; void surface_set_name(int p_idx, const String &p_name); diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index 2c6f30f429..99286668ce 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -92,8 +92,8 @@ Node *SceneState::instance(GenEditState p_edit_state) const { if (i > 0) { - ERR_EXPLAIN(vformat("Invalid scene: node %s does not specify its parent node.", snames[n.name])) - ERR_FAIL_COND_V(n.parent == -1, NULL) + ERR_EXPLAIN(vformat("Invalid scene: node %s does not specify its parent node.", snames[n.name])); + ERR_FAIL_COND_V(n.parent == -1, NULL); NODE_FROM_ID(nparent, n.parent); #ifdef DEBUG_ENABLED if (!nparent && (n.parent & FLAG_ID_IS_PATH)) { diff --git a/scene/resources/particles_material.cpp b/scene/resources/particles_material.cpp index ef67e6ea80..758475b75e 100644 --- a/scene/resources/particles_material.cpp +++ b/scene/resources/particles_material.cpp @@ -1186,6 +1186,7 @@ void ParticlesMaterial::_bind_methods() { BIND_ENUM_CONSTANT(FLAG_ALIGN_Y_TO_VELOCITY); BIND_ENUM_CONSTANT(FLAG_ROTATE_Y); + BIND_ENUM_CONSTANT(FLAG_DISABLE_Z); BIND_ENUM_CONSTANT(FLAG_MAX); BIND_ENUM_CONSTANT(EMISSION_SHAPE_POINT); diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp index db58fe7823..04d13c8869 100644 --- a/scene/resources/primitive_meshes.cpp +++ b/scene/resources/primitive_meshes.cpp @@ -157,6 +157,12 @@ Mesh::PrimitiveType PrimitiveMesh::surface_get_primitive_type(int p_idx) const { return primitive_type; } +void PrimitiveMesh::surface_set_material(int p_idx, const Ref<Material> &p_material) { + ERR_FAIL_INDEX(p_idx, 1); + + set_material(p_material); +} + Ref<Material> PrimitiveMesh::surface_get_material(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, 1, NULL); diff --git a/scene/resources/primitive_meshes.h b/scene/resources/primitive_meshes.h index 88a26801b7..0045a48736 100644 --- a/scene/resources/primitive_meshes.h +++ b/scene/resources/primitive_meshes.h @@ -72,6 +72,7 @@ public: virtual Array surface_get_blend_shape_arrays(int p_surface) const; virtual uint32_t surface_get_format(int p_idx) const; virtual Mesh::PrimitiveType surface_get_primitive_type(int p_idx) const; + virtual void surface_set_material(int p_idx, const Ref<Material> &p_material); virtual Ref<Material> surface_get_material(int p_idx) const; virtual int get_blend_shape_count() const; virtual StringName get_blend_shape_name(int p_index) const; diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index 6e7bb27e74..0921c0dae9 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -1712,15 +1712,15 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const RES &p_r Vector<StringName> groups = state->get_node_groups(i); String header = "[node"; - header += " name=\"" + String(name) + "\""; + header += " name=\"" + String(name).c_escape() + "\""; if (type != StringName()) { header += " type=\"" + String(type) + "\""; } if (path != NodePath()) { - header += " parent=\"" + String(path.simplified()) + "\""; + header += " parent=\"" + String(path.simplified()).c_escape() + "\""; } if (owner != NodePath() && owner != NodePath(".")) { - header += " owner=\"" + String(owner.simplified()) + "\""; + header += " owner=\"" + String(owner.simplified()).c_escape() + "\""; } if (index >= 0) { header += " index=\"" + itos(index) + "\""; diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 92172912c2..503949fd60 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -232,7 +232,7 @@ Image::Format ImageTexture::get_format() const { #ifndef DISABLE_DEPRECATED Error ImageTexture::load(const String &p_path) { - WARN_DEPRECATED + WARN_DEPRECATED; Ref<Image> img; img.instance(); Error err = img->load(p_path); diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index 9b2e410985..dd595d9ff8 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -297,7 +297,7 @@ Error VisualShader::connect_nodes(Type p_type, int p_from_node, int p_from_port, if (MAX(0, from_port_type - 2) != (MAX(0, to_port_type - 2))) { ERR_EXPLAIN("Incompatible port types (scalar/vec/bool with transform"); - ERR_FAIL_V(ERR_INVALID_PARAMETER) + ERR_FAIL_V(ERR_INVALID_PARAMETER); return ERR_INVALID_PARAMETER; } |