chore: call common djb2 implementations in game hashing funcs

This commit is contained in:
Jan Laupetin
2026-02-23 08:15:05 +01:00
parent 9502ebfc26
commit f7e0cb3c45
10 changed files with 318 additions and 164 deletions
-18
View File
@@ -2,26 +2,8 @@
#include "Utils/Pack.h"
#include <cctype>
using namespace IW4;
int Common::StringTable_HashString(const char* str)
{
if (!str)
return 0;
auto result = 0;
auto offset = 0;
while (str[offset])
{
const auto c = tolower(str[offset++]);
result = c + 31 * result;
}
return result;
}
PackedTexCoords Common::Vec2PackTexCoords(const float (&in)[2])
{
return PackedTexCoords{pack32::Vec2PackTexCoordsVU(in)};