mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-10 14:58:10 -05:00
Add T6 assetloader for string tables
This commit is contained in:
@ -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)
|
||||
|
@ -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);
|
||||
};
|
Reference in New Issue
Block a user