mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-11 07:18:11 -05:00
ObjWriting: Dump FontIcon assets as csv files
According to the asset names this seems to be their original format. however since i didn't find any examples of that asset in raw form i just tried to come up with a realistic csv style for it
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
#include "CommonT6.h"
|
||||
|
||||
#include <cctype>
|
||||
|
||||
int CommonT6::Com_HashKey(const char* str, const int maxLen)
|
||||
{
|
||||
if (str == nullptr)
|
||||
@ -15,4 +17,23 @@ int CommonT6::Com_HashKey(const char* str, const int maxLen)
|
||||
}
|
||||
|
||||
return hash ^ ((hash ^ (hash >> 10)) >> 10);
|
||||
}
|
||||
|
||||
int CommonT6::Com_HashString(const char* str, const int len)
|
||||
{
|
||||
if (!str)
|
||||
return 0;
|
||||
|
||||
int result = 0x1505;
|
||||
int offset = 0;
|
||||
while(str[offset])
|
||||
{
|
||||
if (len > 0 && offset >= len)
|
||||
break;
|
||||
|
||||
const int c = tolower(str[offset++]);
|
||||
result = c + 33 * result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
@ -4,4 +4,5 @@ class CommonT6
|
||||
{
|
||||
public:
|
||||
static int Com_HashKey(const char* str, int maxLen);
|
||||
static int Com_HashString(const char* str, int len);
|
||||
};
|
Reference in New Issue
Block a user