diff options
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/canvas_item_material.h | 2 | ||||
-rw-r--r-- | scene/resources/concave_polygon_shape_3d.h | 4 | ||||
-rw-r--r-- | scene/resources/font.cpp | 8 | ||||
-rw-r--r-- | scene/resources/material.cpp | 2 | ||||
-rw-r--r-- | scene/resources/particles_material.h | 2 | ||||
-rw-r--r-- | scene/resources/primitive_meshes.cpp | 4 | ||||
-rw-r--r-- | scene/resources/resource_format_text.cpp | 6 | ||||
-rw-r--r-- | scene/resources/surface_tool.cpp | 3 |
8 files changed, 16 insertions, 15 deletions
diff --git a/scene/resources/canvas_item_material.h b/scene/resources/canvas_item_material.h index 7c44c125a8..160c67d6b1 100644 --- a/scene/resources/canvas_item_material.h +++ b/scene/resources/canvas_item_material.h @@ -64,7 +64,7 @@ private: uint32_t key = 0; static uint32_t hash(const MaterialKey &p_key) { - return hash_djb2_one_32(p_key.key); + return hash_murmur3_one_32(p_key.key); } bool operator==(const MaterialKey &p_key) const { return key == p_key.key; diff --git a/scene/resources/concave_polygon_shape_3d.h b/scene/resources/concave_polygon_shape_3d.h index 4711e38468..a265590edd 100644 --- a/scene/resources/concave_polygon_shape_3d.h +++ b/scene/resources/concave_polygon_shape_3d.h @@ -43,8 +43,8 @@ class ConcavePolygonShape3D : public Shape3D { Vector3 a; Vector3 b; static uint32_t hash(const DrawEdge &p_edge) { - uint32_t h = hash_djb2_one_32(HashMapHasherDefault::hash(p_edge.a)); - return hash_djb2_one_32(HashMapHasherDefault::hash(p_edge.b), h); + uint32_t h = hash_murmur3_one_32(HashMapHasherDefault::hash(p_edge.a)); + return hash_murmur3_one_32(HashMapHasherDefault::hash(p_edge.b), h); } bool operator==(const DrawEdge &p_edge) const { return (a == p_edge.a && b == p_edge.b); diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index 8a353f4b49..46f23424dd 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -2273,7 +2273,7 @@ Size2 Font::get_string_size(const String &p_text, int p_size, HorizontalAlignmen uint64_t hash = p_text.hash64(); if (p_alignment == HORIZONTAL_ALIGNMENT_FILL) { - hash = hash_djb2_one_64(hash_djb2_one_float(p_width), hash); + hash = hash_djb2_one_64(hash_murmur3_one_float(p_width), hash); hash = hash_djb2_one_64(p_flags, hash); } hash = hash_djb2_one_64(p_size, hash); @@ -2297,7 +2297,7 @@ Size2 Font::get_multiline_string_size(const String &p_text, float p_width, int p } uint64_t hash = p_text.hash64(); - uint64_t wrp_hash = hash_djb2_one_64(hash_djb2_one_float(p_width), hash); + uint64_t wrp_hash = hash_djb2_one_64(hash_murmur3_one_float(p_width), hash); wrp_hash = hash_djb2_one_64(p_flags, wrp_hash); wrp_hash = hash_djb2_one_64(p_size, wrp_hash); @@ -2335,7 +2335,7 @@ void Font::draw_string(RID p_canvas_item, const Point2 &p_pos, const String &p_t uint64_t hash = p_text.hash64(); if (p_alignment == HORIZONTAL_ALIGNMENT_FILL) { - hash = hash_djb2_one_64(hash_djb2_one_float(p_width), hash); + hash = hash_djb2_one_64(hash_murmur3_one_float(p_width), hash); hash = hash_djb2_one_64(p_flags, hash); } hash = hash_djb2_one_64(p_size, hash); @@ -2374,7 +2374,7 @@ void Font::draw_multiline_string(RID p_canvas_item, const Point2 &p_pos, const S } uint64_t hash = p_text.hash64(); - uint64_t wrp_hash = hash_djb2_one_64(hash_djb2_one_float(p_width), hash); + uint64_t wrp_hash = hash_djb2_one_64(hash_murmur3_one_float(p_width), hash); wrp_hash = hash_djb2_one_64(p_flags, wrp_hash); wrp_hash = hash_djb2_one_64(p_size, wrp_hash); diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index fc207d358e..b7a3b677f5 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -2209,7 +2209,7 @@ Ref<Material> BaseMaterial3D::get_material_for_2d(bool p_shaded, bool p_transpar if (p_fixed_size) { hash |= 1 << 9; } - hash = hash_djb2_one_64(p_filter, hash); + hash = hash_murmur3_one_64(p_filter, hash); if (materials_for_2d.has(hash)) { if (r_shader_rid) { diff --git a/scene/resources/particles_material.h b/scene/resources/particles_material.h index 24341d964d..af45593f38 100644 --- a/scene/resources/particles_material.h +++ b/scene/resources/particles_material.h @@ -110,7 +110,7 @@ private: uint32_t key = 0; static uint32_t hash(const MaterialKey &p_key) { - return hash_djb2_one_32(p_key.key); + return hash_murmur3_one_32(p_key.key); } bool operator==(const MaterialKey &p_key) const { diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp index f8fb51ae42..b2fd8eb895 100644 --- a/scene/resources/primitive_meshes.cpp +++ b/scene/resources/primitive_meshes.cpp @@ -2435,7 +2435,7 @@ void TextMesh::_create_mesh_array(Array &p_arr) const { } if (glyphs[i].font_rid != RID()) { uint32_t hash = hash_one_uint64(glyphs[i].font_rid.get_id()); - hash = hash_djb2_one_32(glyphs[i].index, hash); + hash = hash_murmur3_one_32(glyphs[i].index, hash); _generate_glyph_mesh_data(hash, glyphs[i]); GlyphMeshData &gl_data = cache[hash]; @@ -2494,7 +2494,7 @@ void TextMesh::_create_mesh_array(Array &p_arr) const { } if (glyphs[i].font_rid != RID()) { uint32_t hash = hash_one_uint64(glyphs[i].font_rid.get_id()); - hash = hash_djb2_one_32(glyphs[i].index, hash); + hash = hash_murmur3_one_32(glyphs[i].index, hash); const GlyphMeshData &gl_data = cache[hash]; diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index 9d586c6f03..0320585b5a 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -1564,17 +1564,17 @@ String ResourceFormatSaverTextInstance::_write_resources(void *ud, const Ref<Res String ResourceFormatSaverTextInstance::_write_resource(const Ref<Resource> &res) { if (external_resources.has(res)) { - return "ExtResource( \"" + external_resources[res] + "\" )"; + return "ExtResource(\"" + external_resources[res] + "\")"; } else { if (internal_resources.has(res)) { - return "SubResource( \"" + internal_resources[res] + "\" )"; + return "SubResource(\"" + internal_resources[res] + "\")"; } else if (!res->is_built_in()) { if (res->get_path() == local_path) { //circular reference attempt return "null"; } //external resource String path = relative_paths ? local_path.path_to_file(res->get_path()) : res->get_path(); - return "Resource( \"" + path + "\" )"; + return "Resource(\"" + path + "\")"; } else { ERR_FAIL_V_MSG("null", "Resource was not pre cached for the resource section, bug?"); //internal resource diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp index 77d6e3c6f9..9829c7e86b 100644 --- a/scene/resources/surface_tool.cpp +++ b/scene/resources/surface_tool.cpp @@ -141,7 +141,8 @@ uint32_t SurfaceTool::VertexHasher::hash(const Vertex &p_vtx) { h = hash_djb2_buffer((const uint8_t *)p_vtx.bones.ptr(), p_vtx.bones.size() * sizeof(int), h); h = hash_djb2_buffer((const uint8_t *)p_vtx.weights.ptr(), p_vtx.weights.size() * sizeof(float), h); h = hash_djb2_buffer((const uint8_t *)&p_vtx.custom[0], sizeof(Color) * RS::ARRAY_CUSTOM_COUNT, h); - h = hash_djb2_one_32(p_vtx.smooth_group, h); + h = hash_murmur3_one_32(p_vtx.smooth_group, h); + h = hash_fmix32(h); return h; } |