Пример #1
0
        private static byte[] GetIndexBuffer(IExportContainer container, Mesh origin)
        {
            if (Mesh.HasLODData(container.Version))
            {
                return(LODConverter.GenerateIndexBuffer(container, ref origin.LODData[0]));
            }
            else
            {
#warning TODO: convert MeshTopology.Deprecated indices to MeshTopology.Triangles
                if (container.Platform == container.ExportPlatform ||
                    container.Platform != Platform.XBox360 && container.ExportPlatform != Platform.XBox360)
                {
                    return(origin.IndexBuffer.ToArray());
                }
                else
                {
                    AlignType align = GetUse16bitIndices(container, origin) == 0 ? AlignType.Align4 : AlignType.Align2;
                    return(origin.IndexBuffer.SwapBytes(align));
                }
            }
        }