From 2230efbd27cc7c4f0985e387b2a2f293c94fe6c8 Mon Sep 17 00:00:00 2001 From: Jan Laupetin Date: Thu, 19 Jun 2025 21:07:11 +0200 Subject: [PATCH] chore: make xquat and xquat2 structs to improve handling from zcg --- src/Common/Game/IW3/IW3_Assets.h | 7 +++++-- src/Common/Game/IW4/IW4_Assets.h | 14 ++++++++++---- src/Common/Game/IW5/IW5_Assets.h | 14 ++++++++++---- src/Common/Game/T5/T5_Assets.h | 7 +++++-- src/Common/Game/T6/T6_Assets.h | 10 ++++++++-- 5 files changed, 38 insertions(+), 14 deletions(-) diff --git a/src/Common/Game/IW3/IW3_Assets.h b/src/Common/Game/IW3/IW3_Assets.h index 2958e8bc..3959562c 100644 --- a/src/Common/Game/IW3/IW3_Assets.h +++ b/src/Common/Game/IW3/IW3_Assets.h @@ -255,7 +255,10 @@ namespace IW3 XAnimPartTransData u; }; - typedef tdef_align32(4) short XQuat[2]; + struct type_align(4) XQuat + { + int16_t value[4]; + }; union XAnimDynamicIndicesQuat { @@ -272,7 +275,7 @@ namespace IW3 union XAnimDeltaPartQuatData { XAnimDeltaPartQuatDataFrames frames; - int16_t frame0[2]; + XQuat frame0; }; struct XAnimDeltaPartQuat diff --git a/src/Common/Game/IW4/IW4_Assets.h b/src/Common/Game/IW4/IW4_Assets.h index d0a9b181..9636bdf2 100644 --- a/src/Common/Game/IW4/IW4_Assets.h +++ b/src/Common/Game/IW4/IW4_Assets.h @@ -371,7 +371,10 @@ namespace IW4 uint16_t _2[1]; }; - typedef tdef_align32(4) short XQuat2[2]; + struct type_align(4) XQuat2 + { + int16_t value[2]; + }; struct type_align32(4) XAnimDeltaPartQuatDataFrames2 { @@ -382,7 +385,7 @@ namespace IW4 union XAnimDeltaPartQuatData2 { XAnimDeltaPartQuatDataFrames2 frames; - int16_t frame0[2]; + XQuat2 frame0; }; struct XAnimDeltaPartQuat2 @@ -397,7 +400,10 @@ namespace IW4 uint16_t _2[1]; }; - typedef tdef_align32(4) short XQuat[4]; + struct type_align(4) XQuat + { + int16_t value[4]; + }; struct XAnimDeltaPartQuatDataFrames { @@ -408,7 +414,7 @@ namespace IW4 union XAnimDeltaPartQuatData { XAnimDeltaPartQuatDataFrames frames; - int16_t frame0[4]; + XQuat frame0; }; struct XAnimDeltaPartQuat diff --git a/src/Common/Game/IW5/IW5_Assets.h b/src/Common/Game/IW5/IW5_Assets.h index ef9a37b6..e4753a01 100644 --- a/src/Common/Game/IW5/IW5_Assets.h +++ b/src/Common/Game/IW5/IW5_Assets.h @@ -379,7 +379,10 @@ namespace IW5 uint16_t _2[1]; }; - typedef tdef_align32(4) short XQuat2[2]; + struct type_align(4) XQuat2 + { + int16_t value[2]; + }; struct type_align32(4) XAnimDeltaPartQuatDataFrames2 { @@ -390,7 +393,7 @@ namespace IW5 union XAnimDeltaPartQuatData2 { XAnimDeltaPartQuatDataFrames2 frames; - short frame0[2]; + XQuat2 frame0; }; struct XAnimDeltaPartQuat2 @@ -405,7 +408,10 @@ namespace IW5 uint16_t _2[1]; }; - typedef tdef_align32(4) short XQuat[4]; + struct type_align(4) XQuat + { + int16_t value[4]; + }; struct XAnimDeltaPartQuatDataFrames { @@ -416,7 +422,7 @@ namespace IW5 union XAnimDeltaPartQuatData { XAnimDeltaPartQuatDataFrames frames; - short frame0[4]; + XQuat frame0; }; struct XAnimDeltaPartQuat diff --git a/src/Common/Game/T5/T5_Assets.h b/src/Common/Game/T5/T5_Assets.h index fa562d38..8ccbd52a 100644 --- a/src/Common/Game/T5/T5_Assets.h +++ b/src/Common/Game/T5/T5_Assets.h @@ -385,7 +385,10 @@ namespace T5 XAnimPartTransData u; }; - typedef tdef_align32(4) short XQuat[2]; + struct type_align(4) XQuat + { + int16_t value[4]; + }; union XAnimDynamicIndicesQuat { @@ -402,7 +405,7 @@ namespace T5 union XAnimDeltaPartQuatData { XAnimDeltaPartQuatDataFrames frames; - int16_t frame0[2]; + XQuat frame0; }; struct XAnimDeltaPartQuat diff --git a/src/Common/Game/T6/T6_Assets.h b/src/Common/Game/T6/T6_Assets.h index b607c7cc..4eec23ae 100644 --- a/src/Common/Game/T6/T6_Assets.h +++ b/src/Common/Game/T6/T6_Assets.h @@ -5650,7 +5650,10 @@ namespace T6 uint16_t _2[1]; }; - typedef tdef_align32(4) int16_t XQuat2[2]; + struct type_align(4) XQuat2 + { + int16_t value[2]; + }; struct type_align32(4) XAnimDeltaPartQuatDataFrames2 { @@ -5676,7 +5679,10 @@ namespace T6 uint16_t _2[1]; }; - typedef tdef_align32(4) int16_t XQuat[4]; + struct type_align(4) XQuat + { + int16_t value[4]; + }; struct type_align32(4) XAnimDeltaPartQuatDataFrames {