MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / TTFSurfaceCacheHash

Function TTFSurfaceCacheHash

src/openrct2/drawing/TTF.cpp:169–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169static uint32_t TTFSurfaceCacheHash(TTF_Font* font, std::string_view text)
170{
171 uint32_t hash = static_cast<uint32_t>(((reinterpret_cast<uintptr_t>(font) * 23) ^ 0xAAAAAAAA) & 0xFFFFFFFF);
172 for (auto c : text)
173 {
174 hash = Numerics::ror32(hash, 3) ^ (c * 13);
175 }
176 return hash;
177}
178
179static void TTFSurfaceCacheDispose(ttf_cache_entry* entry)
180{

Callers 2

TTFSurfaceCacheGetOrAddFunction · 0.85
TTFGetWidthCacheGetOrAddFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected