Add T6 assetloader for string tables

This commit is contained in:
Jan
2021-03-23 01:30:10 +01:00
parent 3529214596
commit 3ed63415a7
5 changed files with 127 additions and 1 deletions

View File

@ -19,6 +19,22 @@ int CommonT6::Com_HashKey(const char* str, const int maxLen)
return hash ^ ((hash ^ (hash >> 10)) >> 10);
}
int CommonT6::Com_HashString(const char* str)
{
if (!str)
return 0;
auto result = 0x1505;
auto offset = 0;
while(str[offset])
{
const auto c = tolower(str[offset++]);
result = c + 33 * result;
}
return result;
}
int CommonT6::Com_HashString(const char* str, const int len)
{
if (!str)

View File

@ -337,5 +337,6 @@ class CommonT6
{
public:
static int Com_HashKey(const char* str, int maxLen);
static int Com_HashString(const char* str);
static int Com_HashString(const char* str, int len);
};