mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-06-07 09:12:37 +00:00
fix: t6 must use two separate structs for quat indices (#824)
Otherwise arraysize cannot be adjusted from appropriate parent struct
This commit is contained in:
@@ -5668,21 +5668,21 @@ namespace T6
|
|||||||
XAnimPartTransData u;
|
XAnimPartTransData u;
|
||||||
};
|
};
|
||||||
|
|
||||||
union XAnimDynamicIndicesQuat
|
|
||||||
{
|
|
||||||
unsigned char _1[1];
|
|
||||||
uint16_t _2[1];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct type_align(4) XQuat2
|
struct type_align(4) XQuat2
|
||||||
{
|
{
|
||||||
int16_t value[2];
|
int16_t value[2];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
union XAnimDynamicIndicesQuat2
|
||||||
|
{
|
||||||
|
unsigned char _1[1];
|
||||||
|
uint16_t _2[1];
|
||||||
|
};
|
||||||
|
|
||||||
struct type_align32(4) XAnimDeltaPartQuatDataFrames2
|
struct type_align32(4) XAnimDeltaPartQuatDataFrames2
|
||||||
{
|
{
|
||||||
XQuat2* frames;
|
XQuat2* frames;
|
||||||
XAnimDynamicIndicesQuat indices;
|
XAnimDynamicIndicesQuat2 indices;
|
||||||
};
|
};
|
||||||
|
|
||||||
union XAnimDeltaPartQuatData2
|
union XAnimDeltaPartQuatData2
|
||||||
@@ -5702,6 +5702,12 @@ namespace T6
|
|||||||
int16_t value[4];
|
int16_t value[4];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
union XAnimDynamicIndicesQuat
|
||||||
|
{
|
||||||
|
unsigned char _1[1];
|
||||||
|
uint16_t _2[1];
|
||||||
|
};
|
||||||
|
|
||||||
struct type_align32(4) XAnimDeltaPartQuatDataFrames
|
struct type_align32(4) XAnimDeltaPartQuatDataFrames
|
||||||
{
|
{
|
||||||
XQuat* frames;
|
XQuat* frames;
|
||||||
|
|||||||
@@ -203,11 +203,13 @@ namespace
|
|||||||
#define DELTA_QUAT_2D_STRUCT XAnimDeltaPartQuat2
|
#define DELTA_QUAT_2D_STRUCT XAnimDeltaPartQuat2
|
||||||
#define DELTA_QUAT_2D_DATA_STRUCT XAnimDeltaPartQuatData2
|
#define DELTA_QUAT_2D_DATA_STRUCT XAnimDeltaPartQuatData2
|
||||||
#define DELTA_QUAT_2D_FRAMES_STRUCT XAnimDeltaPartQuatDataFrames2
|
#define DELTA_QUAT_2D_FRAMES_STRUCT XAnimDeltaPartQuatDataFrames2
|
||||||
|
#define DELTA_QUAT_2D_INDICES_STRUCT XAnimDynamicIndicesQuat2
|
||||||
#else
|
#else
|
||||||
#define DELTA_QUAT_2D_MEMBER quat
|
#define DELTA_QUAT_2D_MEMBER quat
|
||||||
#define DELTA_QUAT_2D_STRUCT XAnimDeltaPartQuat
|
#define DELTA_QUAT_2D_STRUCT XAnimDeltaPartQuat
|
||||||
#define DELTA_QUAT_2D_DATA_STRUCT XAnimDeltaPartQuatData
|
#define DELTA_QUAT_2D_DATA_STRUCT XAnimDeltaPartQuatData
|
||||||
#define DELTA_QUAT_2D_FRAMES_STRUCT XAnimDeltaPartQuatDataFrames
|
#define DELTA_QUAT_2D_FRAMES_STRUCT XAnimDeltaPartQuatDataFrames
|
||||||
|
#define DELTA_QUAT_2D_INDICES_STRUCT XAnimDynamicIndicesQuat
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_DELTA_QUAT_3D
|
#ifdef HAS_DELTA_QUAT_3D
|
||||||
@@ -277,7 +279,7 @@ namespace
|
|||||||
|
|
||||||
const auto numQuatIndices = commonDeltaQuatTrack.m_indices.size();
|
const auto numQuatIndices = commonDeltaQuatTrack.m_indices.size();
|
||||||
const auto indicesArraySize =
|
const auto indicesArraySize =
|
||||||
useByteIndices ? numQuatIndices * sizeof(XAnimDynamicIndicesQuat::_1) : numQuatIndices * sizeof(XAnimDynamicIndicesQuat::_2);
|
useByteIndices ? numQuatIndices * sizeof(DELTA_QUAT_2D_INDICES_STRUCT::_1) : numQuatIndices * sizeof(DELTA_QUAT_2D_INDICES_STRUCT::_2);
|
||||||
|
|
||||||
deltaPart.DELTA_QUAT_2D_MEMBER = static_cast<DELTA_QUAT_2D_STRUCT*>(
|
deltaPart.DELTA_QUAT_2D_MEMBER = static_cast<DELTA_QUAT_2D_STRUCT*>(
|
||||||
memory.AllocRaw(offsetof(DELTA_QUAT_2D_STRUCT, u) + offsetof(DELTA_QUAT_2D_FRAMES_STRUCT, indices) + indicesArraySize));
|
memory.AllocRaw(offsetof(DELTA_QUAT_2D_STRUCT, u) + offsetof(DELTA_QUAT_2D_FRAMES_STRUCT, indices) + indicesArraySize));
|
||||||
|
|||||||
Reference in New Issue
Block a user