mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-11 07:18:11 -05:00
Unlinker: Make zone files creators game dependent and in the unlinker project instead of the ObjWriting component
This commit is contained in:
18
src/ZoneCommon/Game/T6/CommonT6.cpp
Normal file
18
src/ZoneCommon/Game/T6/CommonT6.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
#include "CommonT6.h"
|
||||
|
||||
int CommonT6::Com_HashKey(const char* str, const int maxLen)
|
||||
{
|
||||
if (str == nullptr)
|
||||
return 0;
|
||||
|
||||
int hash = 0;
|
||||
for (int i = 0; i < maxLen; i++)
|
||||
{
|
||||
if (str[i] == '\0')
|
||||
break;
|
||||
|
||||
hash += str[i] * (0x77 + i);
|
||||
}
|
||||
|
||||
return hash ^ ((hash ^ (hash >> 10)) >> 10);
|
||||
}
|
7
src/ZoneCommon/Game/T6/CommonT6.h
Normal file
7
src/ZoneCommon/Game/T6/CommonT6.h
Normal file
@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
class CommonT6
|
||||
{
|
||||
public:
|
||||
static int Com_HashKey(const char* str, int maxLen);
|
||||
};
|
Reference in New Issue
Block a user