Fix m_IndexBuffer decompression when m_IndexFormat != 0. Close #147

This might be a game-specific behavior.. but it should be safe to add, in theory
This commit is contained in:
VaDiM
2026-06-20 13:48:36 +03:00
parent 23604f9a32
commit 728d2c0de5
+3 -1
View File
@@ -1238,7 +1238,9 @@ namespace AssetStudio
//IndexBuffer
if (m_CompressedMesh.m_Triangles.m_NumItems > 0)
{
m_IndexBuffer = Array.ConvertAll(m_CompressedMesh.m_Triangles.UnpackInts(), x => (uint)x);
m_IndexBuffer = m_Use16BitIndices
? Array.ConvertAll(m_CompressedMesh.m_Triangles.UnpackInts(), x => (uint)x)
: MemoryMarshal.Cast<byte, uint>(m_CompressedMesh.m_Triangles.m_Data).ToArray(); //sus
}
//Color
if (m_CompressedMesh.m_Colors?.m_NumItems > 0)