Skip to content

Commit 9e02194

Browse files
committed
Merge pull request #107289 from dementive/add-missing-color-hash
Add missing Color hash function
2 parents 29382f8 + d2814eb commit 9e02194

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

core/templates/hashfuncs.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,13 @@ struct HashMapHasherDefault {
389389
h = hash_murmur3_one_real(p_vec.w, h);
390390
return hash_fmix32(h);
391391
}
392+
static _FORCE_INLINE_ uint32_t hash(const Color &p_vec) {
393+
uint32_t h = hash_murmur3_one_float(p_vec.r);
394+
h = hash_murmur3_one_float(p_vec.g, h);
395+
h = hash_murmur3_one_float(p_vec.b, h);
396+
h = hash_murmur3_one_float(p_vec.a, h);
397+
return hash_fmix32(h);
398+
}
392399
static _FORCE_INLINE_ uint32_t hash(const Rect2i &p_rect) {
393400
uint32_t h = hash_murmur3_one_32(uint32_t(p_rect.position.x));
394401
h = hash_murmur3_one_32(uint32_t(p_rect.position.y), h);

0 commit comments

Comments
 (0)