diff --git a/src/ObjLoading/Game/T6/XModel/JsonXModelLoader.cpp b/src/ObjLoading/Game/T6/XModel/JsonXModelLoader.cpp index fc0813ea..503e5621 100644 --- a/src/ObjLoading/Game/T6/XModel/JsonXModelLoader.cpp +++ b/src/ObjLoading/Game/T6/XModel/JsonXModelLoader.cpp @@ -467,6 +467,13 @@ namespace memcpy(surface.triIndices, sortedTris.data(), sizeof(std::remove_pointer_t) * surface.triCount); } + static void AddBoneToXSurfacePartBits(XSurface& surface, const size_t boneIndex) + { + const auto partBitsIndex = boneIndex / 32u; + const auto shiftValue = 31u - (boneIndex % 32u); + surface.partBits[partBitsIndex] |= 1 << shiftValue; + } + void CreateVertListData(XSurface& surface, const std::vector& vertexIndices, const XModelCommon& common) { ReorderRigidTrisByBoneIndex(vertexIndices, surface, common); @@ -504,6 +511,8 @@ namespace currentVertexTail = currentVertexHead; currentTriTail = currentTriHead; + + AddBoneToXSurfacePartBits(surface, boneIndex); } }