From 8d45f27965fa60a54d3a57972f197315c2d03aa2 Mon Sep 17 00:00:00 2001 From: XProger Date: Sun, 1 Mar 2020 05:28:16 +0300 Subject: [PATCH] fix vertex weld for TR4 --- src/mesh.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mesh.h b/src/mesh.h index 27ef7f0..b41ed44 100644 --- a/src/mesh.h +++ b/src/mesh.h @@ -731,9 +731,10 @@ struct MeshBuilder { short4 *VAR = new short4[RANGE.vCount];\ for (int i = 0; i < RANGE.vCount; i++) {\ VAR[i] = vertices[RANGE.vStart + i].coord;\ - VAR[i].x += jointsPos[VAR[i].w].x;\ - VAR[i].y += jointsPos[VAR[i].w].y;\ - VAR[i].z += jointsPos[VAR[i].w].z;\ + int index = VAR[i].w / 2;\ + VAR[i].x += jointsPos[index].x;\ + VAR[i].y += jointsPos[index].y;\ + VAR[i].z += jointsPos[index].z;\ } COORD_FILL(vSkin, rangeSkin);