diff options
Diffstat (limited to 'scene/resources/particles_material.h')
-rw-r--r-- | scene/resources/particles_material.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/scene/resources/particles_material.h b/scene/resources/particles_material.h index 4c3a3ba16c..24341d964d 100644 --- a/scene/resources/particles_material.h +++ b/scene/resources/particles_material.h @@ -109,6 +109,14 @@ private: uint32_t key = 0; + static uint32_t hash(const MaterialKey &p_key) { + return hash_djb2_one_32(p_key.key); + } + + bool operator==(const MaterialKey &p_key) const { + return key == p_key.key; + } + bool operator<(const MaterialKey &p_key) const { return key < p_key.key; } @@ -119,7 +127,7 @@ private: int users = 0; }; - static Map<MaterialKey, ShaderData> shader_map; + static HashMap<MaterialKey, ShaderData, MaterialKey> shader_map; MaterialKey current_key; |