Write IPak base skeleton without data

This commit is contained in:
Jan
2023-10-07 19:41:54 +02:00
parent 23d0fe1eb0
commit 8514378465
15 changed files with 390 additions and 62 deletions

View File

@ -58,6 +58,16 @@ int Common::Com_HashString(const char* str, const int len)
return result;
}
uint32_t Common::R_HashString(const char* str, uint32_t hash)
{
for (const auto* pos = str; *pos; pos++)
{
hash = 33 * hash ^ (*pos | 0x20);
}
return hash;
}
PackedTexCoords Common::Vec2PackTexCoords(const vec2_t* in)
{
return PackedTexCoords{ Pack32::Vec2PackTexCoords(in->v) };

View File

@ -10,6 +10,7 @@ namespace T6
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);
static uint32_t R_HashString(const char* str, uint32_t hash);
static PackedTexCoords Vec2PackTexCoords(const vec2_t* in);
static PackedUnitVec Vec3PackUnitVec(const vec3_t* in);