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:
Jan
2020-02-23 02:02:11 +01:00
parent ccef1dca28
commit 8ec525d3d2
7 changed files with 376 additions and 1 deletions

View File

@ -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;
}

View File

@ -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);
};