Decompile fn_11892 (FrameTextHash::operator())

Batch #11094 by cremane: 1 byte-identical, 0 confirmed by peer review.

- fn_11892 FrameTextHash::operator(): byte-identical

Merged automatically: every function is byte-identical to the original.
This commit is contained in:
ragnarok-clanker 2026-11-04 20:03:25 +00:00
commit 5e63266d91

View file

@ -1,29 +1,11 @@
#include "UI/Window/FrameTextCache.h"
namespace {
// INLINED
std::uint32_t HashWord(std::uint32_t value) {
std::uint32_t hash = 0x811C9DC5u;
for (unsigned shift = 0; shift < 32; shift += 8) {
hash = 16777619u * (hash ^ ((value >> shift) & 255));
}
return hash;
}
}
// OFFSET: 0x008C4CF0
// FUNCTION: fn_11892
std::size_t FrameTextHash::operator()(const FrameTextKey& key) const {
std::uint32_t hash = 0x811C9DC5u;
for (unsigned char value : key.text) {
hash = 16777619u * (hash ^ value);
}
hash ^= HashWord(key.word1) + 0x9E3779B9u + (hash << 6) + (hash >> 2);
hash ^= HashWord(key.word0) + 0x9E3779B9u + (hash << 6) + (hash >> 2);
std::size_t hash = std::hash<std::string>()(key.text);
hash ^= std::hash<std::uint32_t>()(key.word1) + 0x9E3779B9u + (hash << 6) + (hash >> 2);
hash ^= std::hash<std::uint32_t>()(key.word0) + 0x9E3779B9u + (hash << 6) + (hash >> 2);
return hash;
}