1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-13 13:31:48 +00:00

Replace most uses of Map by HashMap

* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
This commit is contained in:
reduz
2022-05-13 15:04:37 +02:00
committed by Rémi Verschelde
parent 396def9b66
commit 746dddc067
587 changed files with 3707 additions and 3538 deletions

View File

@@ -297,7 +297,7 @@ private:
RID depth;
RID fb; //for copying
Map<RID, uint32_t> shadow_owners;
HashMap<RID, uint32_t> shadow_owners;
};
RID_Owner<ShadowAtlas> shadow_atlas_owner;
@@ -345,7 +345,7 @@ private:
RID side_fb[6];
};
Map<int, ShadowCubemap> shadow_cubemaps;
HashMap<int, ShadowCubemap> shadow_cubemaps;
ShadowCubemap *_get_shadow_cubemap(int p_size);
void _create_shadow_cubemaps();
@@ -387,7 +387,7 @@ private:
Rect2 directional_rect;
Set<RID> shadow_atlases; //shadow atlases where this light is registered
RBSet<RID> shadow_atlases; //shadow atlases where this light is registered
ForwardID forward_id = -1;
@@ -921,7 +921,7 @@ private:
RID version;
RID pipeline;
Map<StringName, ShaderLanguage::ShaderNode::Uniform> uniforms;
HashMap<StringName, ShaderLanguage::ShaderNode::Uniform> uniforms;
Vector<ShaderCompiler::GeneratedCode::Texture> texture_uniforms;
Vector<uint32_t> ubo_offsets;
@@ -929,7 +929,7 @@ private:
String path;
String code;
Map<StringName, Map<int, RID>> default_texture_params;
HashMap<StringName, HashMap<int, RID>> default_texture_params;
bool uses_time = false;
@@ -954,7 +954,7 @@ private:
virtual void set_render_priority(int p_priority) {}
virtual void set_next_pass(RID p_pass) {}
virtual bool update_parameters(const Map<StringName, Variant> &p_parameters, bool p_uniform_dirty, bool p_textures_dirty);
virtual bool update_parameters(const HashMap<StringName, Variant> &p_parameters, bool p_uniform_dirty, bool p_textures_dirty);
virtual ~FogMaterialData();
};