示例#1
0
        public static HwIndexArray FromData(BinaryReader reader, GameType gameType)
        {
            var  array             = new HwIndexArray();
            uint indexElementCount = reader.ReadUInt32();

            if (indexElementCount > 0)
            {
                array.Flags = reader.ReadUInt32();
                var format        = (BaseIndexFormat)reader.ReadUInt32();
                var streamingMode = (BaseRenderDataStreamingMode)reader.ReadUInt32();

                array.ResourceDataHash = BaseGGUUID.FromData(reader);
                array.Buffer           = HwBuffer.FromIndexData(reader, gameType, format, streamingMode, indexElementCount);
            }

            return(array);
        }
        public static HwIndexArray FromData(BinaryReader reader, GameType gameType)
        {
            var  x = new HwIndexArray();
            uint indexElementCount = reader.ReadUInt32();

            if (indexElementCount > 0)
            {
                x.Flags = reader.ReadUInt32();
                var  format      = (BaseIndexFormat)reader.ReadUInt32();
                uint isStreaming = reader.ReadUInt32();

                if (isStreaming != 0 && isStreaming != 1)
                {
                    throw new InvalidDataException("Must be true or false");
                }

                x.ResourceGUID = new BaseGGUUID().FromData(reader);
                x.Buffer       = HwBuffer.FromIndexData(reader, gameType, format, isStreaming != 0, indexElementCount);
            }

            return(x);
        }