mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-10 23:08:05 -05:00
Add AssetLoader for IW5 StringTable
This commit is contained in:
@ -4,6 +4,22 @@
|
||||
|
||||
using namespace IW5;
|
||||
|
||||
int Common::StringTable_HashString(const char* str)
|
||||
{
|
||||
if (!str)
|
||||
return 0;
|
||||
|
||||
auto result = 0;
|
||||
auto offset = 0;
|
||||
while (str[offset])
|
||||
{
|
||||
const auto c = tolower(str[offset++]);
|
||||
result = c + 31 * result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
PackedTexCoords Common::Vec2PackTexCoords(const vec2_t* in)
|
||||
{
|
||||
return PackedTexCoords{ Pack32::Vec2PackTexCoords(reinterpret_cast<const float*>(in)) };
|
||||
|
@ -7,6 +7,8 @@ namespace IW5
|
||||
class Common
|
||||
{
|
||||
public:
|
||||
static int StringTable_HashString(const char* str);
|
||||
|
||||
static PackedTexCoords Vec2PackTexCoords(const vec2_t* in);
|
||||
static PackedUnitVec Vec3PackUnitVec(const vec3_t* in);
|
||||
static GfxColor Vec4PackGfxColor(const vec4_t* in);
|
||||
|
Reference in New Issue
Block a user