Skip to content

Commit

Permalink
Merge pull request #267 from Laupetin/refactor/generalize-xmodel-loading
Browse files Browse the repository at this point in the history
feat: generalize xmodel loading for IW5
  • Loading branch information
Laupetin authored Sep 22, 2024
2 parents 5549f71 + d4d8e83 commit 042c68a
Show file tree
Hide file tree
Showing 70 changed files with 4,474 additions and 2,226 deletions.
1 change: 1 addition & 0 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ include "tools/scripts/linking.lua"
include "tools/scripts/options.lua"
include "tools/scripts/platform.lua"
include "tools/scripts/version.lua"
include "tools/scripts/source_templating.lua"

-- ==================
-- Workspace
Expand Down
21 changes: 21 additions & 0 deletions raw/iw5/partclassification.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
J_Hip_RI,right_leg_upper
J_Hip_LE,left_leg_upper
J_Knee_RI,right_leg_lower
J_SpineUpper,torso_upper
J_Knee_LE,left_leg_lower
J_Ankle_RI,right_foot
J_Ankle_LE,left_foot
J_Clavicle_RI,torso_upper
J_Clavicle_LE,torso_upper
J_Shoulder_RI,right_arm_upper
J_Shoulder_LE,left_arm_upper
J_Neck,neck
J_Head,head
J_Elbow_RI,right_arm_lower
J_Elbow_LE,left_arm_lower
J_Wrist_RI,right_hand
J_Wrist_LE,left_hand
J_MainRoot,torso_lower
TAG_WEAPON_LEFT,gun
TAG_WEAPON_RIGHT,gun
J_Helmet,helmet
19 changes: 19 additions & 0 deletions raw/iw5/partclassification_mp.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
J_Hip_RI,right_leg_upper
J_Hip_LE,left_leg_upper
J_Knee_RI,right_leg_lower
J_SpineUpper,torso_lower
J_SpineLower,torso_lower
J_MainRoot,torso_lower
J_Knee_LE,left_leg_lower
J_Ankle_RI,right_foot
J_Ankle_LE,left_foot
J_Clavicle_RI,torso_upper
J_Clavicle_LE,torso_upper
J_Shoulder_RI,right_arm_upper
J_Shoulder_LE,left_arm_upper
J_Neck,neck
J_Head,head
J_Elbow_RI,right_arm_lower
J_Elbow_LE,left_arm_lower
J_Wrist_RI,right_hand
J_Wrist_LE,left_hand
15 changes: 15 additions & 0 deletions src/Common/Game/IW5/CommonIW5.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ namespace IW5
public:
static int StringTable_HashString(const char* str);

static constexpr uint32_t R_HashString(const char* str, uint32_t hash)
{
for (const auto* pos = str; *pos; pos++)
{
hash = 33 * hash ^ (*pos | 0x20);
}

return hash;
}

static constexpr uint32_t R_HashString(const char* string)
{
return R_HashString(string, 0u);
}

static PackedTexCoords Vec2PackTexCoords(const float (&in)[2]);
static PackedUnitVec Vec3PackUnitVec(const float (&in)[3]);
static GfxColor Vec4PackGfxColor(const float (&in)[4]);
Expand Down
Loading

0 comments on commit 042c68a

Please sign in to comment.