BFRES : Fix loading bone attributes from 4 byte format when 3 byte stride

This commit is contained in:
KillzXGaming 2023-05-27 19:26:32 -04:00
parent 0d33f4ead1
commit d0fc51c57d

View file

@ -326,16 +326,24 @@ namespace FirstPlugin
if (vec4w0.Length > 0) if (vec4w0.Length > 0)
{ {
if (fshp.VertexSkinCount > 0)
v.boneWeights.Add(vec4w0[i].X); v.boneWeights.Add(vec4w0[i].X);
if (fshp.VertexSkinCount > 1)
v.boneWeights.Add(vec4w0[i].Y); v.boneWeights.Add(vec4w0[i].Y);
if (fshp.VertexSkinCount > 2)
v.boneWeights.Add(vec4w0[i].Z); v.boneWeights.Add(vec4w0[i].Z);
if (fshp.VertexSkinCount > 3)
v.boneWeights.Add(vec4w0[i].W); v.boneWeights.Add(vec4w0[i].W);
} }
if (vec4i0.Length > 0) if (vec4i0.Length > 0)
{ {
if (fshp.VertexSkinCount > 0)
v.boneIds.Add((int)vec4i0[i].X); v.boneIds.Add((int)vec4i0[i].X);
if (fshp.VertexSkinCount > 1)
v.boneIds.Add((int)vec4i0[i].Y); v.boneIds.Add((int)vec4i0[i].Y);
if (fshp.VertexSkinCount > 2)
v.boneIds.Add((int)vec4i0[i].Z); v.boneIds.Add((int)vec4i0[i].Z);
if (fshp.VertexSkinCount > 3)
v.boneIds.Add((int)vec4i0[i].W); v.boneIds.Add((int)vec4i0[i].W);
} }