コード例 #1
0
        // ---- METHODS (PRIVATE) --------------------------------------------------------------------------------------
        private void Load(BfresLoaderContext context)
        {
            Internal = new Internals();

            Internal.Unknown0x00 = context.Reader.ReadByte();
            if (Internal.Unknown0x00 != 2)
            {
                context.Warnings.Add("FmatAttribute.Unknown0x00 has unexpected value of " + Internal.Unknown0x00);
            }

            Internal.Unknown0x01 = context.Reader.ReadByte();
            if (Internal.Unknown0x01 != 0x00 && Internal.Unknown0x01 != 0x02 && Internal.Unknown0x01 != 0x04
                && Internal.Unknown0x01 != 0x12)
            {
                context.Warnings.Add("FmatAttribute.Unknown0x01 has unexpected value of " + Internal.Unknown0x01);
            }

            Internal.Unknown0x02 = context.Reader.ReadByte();
            if (Internal.Unknown0x02 != 0x00 && Internal.Unknown0x02 != 0x10 && Internal.Unknown0x02 != 0x12
                && Internal.Unknown0x02 != 0x5A)
            {
                context.Warnings.Add("FmatAttribute.Unknown0x02 has unexpected value of " + Internal.Unknown0x02);
            }

            Internal.Unknown0x03 = context.Reader.ReadByte();
            Internal.Unknown0x04 = context.Reader.ReadSByte();
            Internal.Unknown0x05 = context.Reader.ReadByte();
            Internal.Unknown0x06 = context.Reader.ReadUInt16();

            Internal.Unknown0x08 = context.Reader.ReadUInt32();
            if (Internal.Unknown0x08 != 0x80000000)
            {
                context.Warnings.Add("FmatAttribute.Unknown0x08 has unexpected value of " + Internal.Unknown0x08);
            }

            Internal.Unknown0x0C = context.Reader.ReadUInt32();
            if (Internal.Unknown0x0C != 0)
            {
                context.Warnings.Add("FmatAttribute.Unknown0x0C has unexpected value of " + Internal.Unknown0x0C);
            }

            Internal.NameOffset = context.Reader.ReadBfresNameOffset();
            Name = Internal.NameOffset.Name;
            Internal.Index = context.Reader.ReadByte();

            Internal.Unknown0x15 = context.Reader.ReadByte();
            if (Internal.Unknown0x15 != 0)
            {
                context.Warnings.Add("FmatAttribute.Unknown0x15 has unexpected value of " + Internal.Unknown0x15);
            }

            Internal.Unknown0x16 = context.Reader.ReadUInt16();
            if (Internal.Unknown0x16 != 0)
            {
                context.Warnings.Add("FmatAttribute.Unknown0x16 has unexpected value of " + Internal.Unknown0x16);
            }
        }
コード例 #2
0
        // ---- METHODS (PRIVATE) --------------------------------------------------------------------------------------
        private void Load(BfresLoaderContext context)
        {
            Internal = new Internals();

            Internal.NameOffset = context.Reader.ReadBfresNameOffset();
            Name = Internal.NameOffset.Name;
            Internal.TextureOffset = context.Reader.ReadBfresOffset();

            // Referenced texture is linked after loading and mapping the raw data.
        }
コード例 #3
0
ファイル: FmdlParameter.cs プロジェクト: Syroot/NintenTools
        // ---- METHODS (PRIVATE) --------------------------------------------------------------------------------------
        private void Load(BfresLoaderContext context)
        {
            Internal = new Internals();

            Internal.NameOffset = context.Reader.ReadBfresNameOffset();
            Name = Internal.NameOffset.Name;
            Internal.Unknown0x04 = context.Reader.ReadUInt16();
            Internal.Unknown0x06 = context.Reader.ReadUInt16();
            Value = context.Reader.ReadSingle();
        }
コード例 #4
0
ファイル: FsklSkeleton.cs プロジェクト: Syroot/NintenTools
        // ---- METHODS (PRIVATE) --------------------------------------------------------------------------------------
        private void Load(BfresLoaderContext context)
        {
            Internal = new Internals();

            // Read magic bytes.
            if (context.Reader.ReadString(4) != "FSKL")
            {
                throw new BfresException("FsklSkeleton identifier invalid");
            }

            Internal.Unknown0x04 = context.Reader.ReadUInt16();
            if (Internal.Unknown0x04 != 0)
            {
                context.Warnings.Add("FsklSkeleton.Unknown0x04 has unexpected value of " + Internal.Unknown0x04);
            }
            Internal.Unknown0x06 = context.Reader.ReadUInt16();
            if (Internal.Unknown0x06 != 0x1100 && Internal.Unknown0x06 != 0x1200)
            {
                context.Warnings.Add("FsklSkeleton.Unknown0x06 has unexpected value of " + Internal.Unknown0x06);
            }

            Internal.BoneCount = context.Reader.ReadUInt16();
            Internal.InverseIndexCount = context.Reader.ReadUInt16();
            Internal.ExtraIndexCount = context.Reader.ReadUInt16();

            Internal.Unknown0x0E = context.Reader.ReadUInt16();
            if (Internal.Unknown0x0E != 0)
            {
                context.Warnings.Add("FsklSkeleton.Unknown0x0E has unexpected value of " + Internal.Unknown0x0E);
            }

            Internal.BoneIndexGroupOffset = context.Reader.ReadBfresOffset();
            Internal.BoneArrayOffset = context.Reader.ReadBfresOffset();
            Internal.InverseIndexArrayOffset = context.Reader.ReadBfresOffset();
            Internal.InverseMatrixArrayOffset = context.Reader.ReadBfresOffset();

            if (context.Reader.ReadUInt32() != 0)
            {
                context.Warnings.Add("FsklSkeleton padding not empty");
            }

            // Restore the position after the header, to allow consecutive header reads for the parent.
            using (context.Reader.TemporarySeek())
            {
                LoadBones(context);
            }
        }
コード例 #5
0
ファイル: FshpIndexBuffer.cs プロジェクト: Syroot/NintenTools
        // ---- METHODS (PRIVATE) --------------------------------------------------------------------------------------
        private void Load(BfresLoaderContext context)
        {
            Internal = new Internals();

            Internal.Unknown0x00 = context.Reader.ReadUInt32();
            Internal.Size = context.Reader.ReadUInt32();
            Internal.Unknown0x08 = context.Reader.ReadUInt32();
            Internal.Unknown0x0C = context.Reader.ReadUInt16();
            Internal.Unknown0x0E = context.Reader.ReadUInt16();
            Internal.Unknown0x10 = context.Reader.ReadUInt32();
            Internal.DataOffset = context.Reader.ReadBfresOffset();

            // Restore the position after the header, to allow consecutive header reads for the parent.
            using (context.Reader.TemporarySeek())
            {
                LoadData(context);
            }
        }
コード例 #6
0
        // ---- METHODS (PRIVATE) --------------------------------------------------------------------------------------
        private void Load(BfresLoaderContext context)
        {
            Internal = new Internals();

            // Read magic bytes.
            if (context.Reader.ReadString(4) != "FVTX")
            {
                throw new BfresException("FvtxVertexData identifier invalid");
            }

            Internal.AttributeCount = context.Reader.ReadByte();
            Internal.BufferCount = context.Reader.ReadByte();
            Internal.Index = context.Reader.ReadUInt16();
            Internal.NumberOfElements = context.Reader.ReadUInt32();

            Internal.Unknown0x0C = context.Reader.ReadUInt32();
            if (Internal.Unknown0x0C != 0x00000000 && Internal.Unknown0x0C != 0x01000000
                && Internal.Unknown0x0C != 0x02000000 && Internal.Unknown0x0C != 0x03000000
                && Internal.Unknown0x0C != 0x04000000)
            {
                context.Warnings.Add("FvtxVertexData.Unknown0x0C has unexpected value of " + Internal.Unknown0x0C);
            }

            Internal.AttributeArrayOffset = context.Reader.ReadBfresOffset();
            Internal.AttributeIndexGroupOffset = context.Reader.ReadBfresOffset();
            Internal.BufferArrayOffset = context.Reader.ReadBfresOffset();

            if (context.Reader.ReadUInt32() != 0)
            {
                context.Warnings.Add("FvtxVertexData padding not empty");
            }

            // Restore the position after the header, to allow consecutive header reads for the parent.
            using (context.Reader.TemporarySeek())
            {
                LoadData(context);
                LoadAttributes(context);
            }
        }
コード例 #7
0
        // ---- METHODS (PRIVATE) --------------------------------------------------------------------------------------
        private void Load(BfresLoaderContext context)
        {
            Internal = new Internals();

            Internal.NameOffset = context.Reader.ReadBfresNameOffset();
            Name = Internal.NameOffset.Name;

            Internal.Unknown0x04 = context.Reader.ReadUInt16();
            if (Internal.Unknown0x04 != 1)
            {
                context.Warnings.Add("FmatMaterial.Unknown0x04 has unexpected value of " + Internal.Unknown0x04);
            }

            Internal.Unknown0x06 = context.Reader.ReadByte();

            Internal.Unknown0x07 = context.Reader.ReadByte();
            if (Internal.Unknown0x07 != 0)
            {
                context.Warnings.Add("FmatMaterial.Unknown0x07 has unexpected value of " + Internal.Unknown0x07);
            }

            Value = context.Reader.ReadUInt32();
        }
コード例 #8
0
ファイル: FshpLodModel.cs プロジェクト: Syroot/NintenTools
        // ---- METHODS (PRIVATE) --------------------------------------------------------------------------------------
        private void Load(BfresLoaderContext context)
        {
            Internal = new Internals();

            Internal.Unknown0x00 = context.Reader.ReadUInt32();
            if (Internal.Unknown0x00 != 4)
            {
                context.Warnings.Add("FshpLodModel.Unknown0x00 has unexpected value of " + Internal.Unknown0x00);
            }

            Internal.Unknown0x04 = context.Reader.ReadUInt32();
            if (Internal.Unknown0x04 != 4)
            {
                context.Warnings.Add("FshpLodModel.Unknown0x04 has unexpected value of " + Internal.Unknown0x04);
            }

            TotalPointCount = context.Reader.ReadUInt32();
            Internal.VisibilityGroupCount = context.Reader.ReadUInt16();

            Internal.Unknown0x0E = context.Reader.ReadUInt16();
            if (Internal.Unknown0x0E != 0)
            {
                context.Warnings.Add("FshpLodModel.Unknown0x0E has unexpected value of " + Internal.Unknown0x0E);
            }

            Internal.VisibilityGroupOffset = context.Reader.ReadBfresOffset();
            Internal.IndexBufferOffset = context.Reader.ReadBfresOffset();
            SkipElements = context.Reader.ReadUInt32();

            // Restore the position after the header, to allow consecutive header reads for the parent.
            using (context.Reader.TemporarySeek())
            {
                LoadVisibilityGroup(context);
                LoadIndexBuffer(context);
            }
        }
コード例 #9
0
ファイル: FshpLodModel.cs プロジェクト: Syroot/NintenTools
 private void LoadVisibilityGroup(BfresLoaderContext context)
 {
     context.Reader.Position = Internal.VisibilityGroupOffset.ToFile;
     VisibilityGroups = new List<FshpVisibilityGroup>(Internal.VisibilityGroupCount);
     for (int i = 0; i < Internal.VisibilityGroupCount; i++)
     {
         VisibilityGroups.Add(new FshpVisibilityGroup(context));
     }
 }
コード例 #10
0
ファイル: FshpLodModel.cs プロジェクト: Syroot/NintenTools
 private void LoadIndexBuffer(BfresLoaderContext context)
 {
     context.Reader.Position = Internal.IndexBufferOffset.ToFile;
     IndexBuffer = new FshpIndexBuffer(context);
 }
コード例 #11
0
ファイル: FmatMaterial.cs プロジェクト: Syroot/NintenTools
        private void LoadRenderParameters(BfresLoaderContext context)
        {
            context.Reader.Position = Internal.RenderParameterIndexGroupOffset.ToFile;
            Internal.RenderParameterIndexGroup = new BfresIndexGroup(context);
            if (Internal.RenderParameterIndexGroup.NodeCount != Internal.RenderParameterCount)
            {
                context.Warnings.Add("FmatMaterial.RenderParameterIndexGroup has node count unequal to header");
            }

            // Load the referenced instances into the list.
            RenderParameters = new List<FmatRenderParameter>((int)Internal.RenderParameterIndexGroup.NodeCount);
            for (int i = 1; i < Internal.RenderParameterIndexGroup.Nodes.Length; i++)
            {
                BfresIndexGroupNode node = Internal.RenderParameterIndexGroup[i];
                context.Reader.Position = node.DataPointer.ToFile;
                RenderParameters.Add(new FmatRenderParameter(context));
            }
        }
コード例 #12
0
 // ---- CONSTRUCTORS -------------------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="FmatTextureAttributeSelector"/> class from the given
 /// <see cref="BfresLoaderContext"/>. The reader of the context has to be positioned at the start of the data.
 /// </summary>
 /// <param name="context">The loader context providing information about how to load the data.</param>
 internal FmatTextureAttributeSelector(BfresLoaderContext context)
 {
     Load(context);
 }
コード例 #13
0
        private void LoadAttributes(BfresLoaderContext context)
        {
            // Read in the attributes from the array and directly map them to the buffers.
            context.Reader.Position = Internal.AttributeArrayOffset.ToFile;

            for (int i = 0; i < Internal.AttributeCount; i++)
            {
                FvtxVertexAttribute attribute = new FvtxVertexAttribute(context);
                if (Data[attribute.Internal.BufferIndex].Attributes == null)
                {
                    Data[attribute.Internal.BufferIndex].Attributes = new List<FvtxVertexAttribute>();
                }
                Data[attribute.Internal.BufferIndex].Attributes.Add(attribute);
            }

            // Read in the index group.
            context.Reader.Position = Internal.AttributeIndexGroupOffset.ToFile;
            Internal.AttributeIndexGroup = new BfresIndexGroup(context);
        }
コード例 #14
0
ファイル: FmatMaterial.cs プロジェクト: Syroot/NintenTools
 private void LoadShaderControl(BfresLoaderContext context)
 {
     context.Reader.Position = Internal.ShaderControlOffset.ToFile;
     ShaderControl = new FmatShaderControl(context);
 }
コード例 #15
0
ファイル: FmatMaterial.cs プロジェクト: Syroot/NintenTools
 private void LoadTextureSelectors(BfresLoaderContext context)
 {
     context.Reader.Position = Internal.TextureSelectorOffset.ToFile;
     TextureSelectors = new List<FmatTextureSelector>(Internal.TextureSelectorCount);
     for (int i = 0; i < Internal.TextureSelectorCount; i++)
     {
         TextureSelectors.Add(new FmatTextureSelector(context));
     }
 }
コード例 #16
0
 // ---- CONSTRUCTORS -------------------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="FmatMaterialStructure"/> class from the given
 /// <see cref="BfresLoaderContext"/>. The reader of the context has to be positioned at the start of the data.
 /// </summary>
 /// <param name="context">The loader context providing information about how to load the data.</param>
 internal FmatMaterialStructure(BfresLoaderContext context)
 {
     Load(context);
 }
コード例 #17
0
ファイル: FtexSection.cs プロジェクト: Syroot/NintenTools
 private void LoadData(BfresLoaderContext context)
 {
     context.Reader.Position = Internal.DataOffset.ToFile;
     Data = context.Reader.ReadBytes((int)Internal.DataLength);
 }
コード例 #18
0
ファイル: FtexSection.cs プロジェクト: Syroot/NintenTools
        // ---- METHODS (PRIVATE) --------------------------------------------------------------------------------------
        private void Load(BfresLoaderContext context)
        {
            Internal = new Internals();

            // Read magic bytes.
            if (context.Reader.ReadString(4) != "FTEX")
            {
                throw new BfresException("FtexSection identifier invalid");
            }

            // Read section properties.
            SurfaceDim = (SurfaceDim)context.Reader.ReadInt32();
            Width = context.Reader.ReadUInt32();
            Height = context.Reader.ReadUInt32();
            Depth = context.Reader.ReadUInt32();

            MipmapCount = context.Reader.ReadUInt32();
            Format = (SurfaceFormat)context.Reader.ReadInt32();
            AntiAliasMode = (AntiAliasMode)context.Reader.ReadInt32();
            Usage = (SurfaceUse)context.Reader.ReadInt32();

            Internal.DataLength = context.Reader.ReadUInt32();
            Internal.Unknown0x28 = context.Reader.ReadUInt32();
            Internal.MipmapSize = context.Reader.ReadUInt32();
            Internal.Unknown0x30 = context.Reader.ReadUInt32();

            TileMode = (TileMode)context.Reader.ReadUInt32();
            Swizzle = context.Reader.ReadUInt32();
            Alignment = context.Reader.ReadUInt32();
            Pitch = context.Reader.ReadUInt32();

            Internal.Unknown0x44 = context.Reader.ReadBytes(0x6C);
            Internal.DataOffset = context.Reader.ReadBfresOffset();
            Internal.MipmapOffset = context.Reader.ReadBfresOffset();

            Internal.Unknown0xB8 = context.Reader.ReadUInt32();
            Internal.Unknown0xBC = context.Reader.ReadUInt32();

            LoadData(context);
            LoadMipmapData(context);
        }
コード例 #19
0
ファイル: FshpIndexBuffer.cs プロジェクト: Syroot/NintenTools
 // ---- CONSTRUCTORS -------------------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="FshpIndexBuffer"/> class from the given
 /// <see cref="BfresLoaderContext"/>. The reader of the context has to be positioned at the start of the data.
 /// </summary>
 /// <param name="context">The loader context providing information about how to load the data.</param>
 internal FshpIndexBuffer(BfresLoaderContext context)
 {
     Load(context);
 }
コード例 #20
0
ファイル: FmatMaterial.cs プロジェクト: Syroot/NintenTools
        private void LoadShadowParameters(BfresLoaderContext context)
        {
            // Load the index group.
            if (!Internal.ShadowParameterIndexGroupOffset.IsEmpty)
            {
                context.Reader.Position = Internal.ShadowParameterIndexGroupOffset.ToFile;
                Internal.ShadowParameterIndexGroup = new BfresIndexGroup(context);
            }

            // Load the referenced shadow parameters into the list.
            ShadowParameters = new List<FmatShadowParameter>();
            if (Internal.ShadowParameterIndexGroup != null)
            {
                for (int i = 1; i < Internal.ShadowParameterIndexGroup.Nodes.Length; i++)
                {
                    BfresIndexGroupNode node = Internal.ShadowParameterIndexGroup[i];
                    context.Reader.Position = node.DataPointer.ToFile;
                    ShadowParameters.Add(new FmatShadowParameter(context));
                }
            }
        }
コード例 #21
0
ファイル: FmdlParameter.cs プロジェクト: Syroot/NintenTools
 // ---- CONSTRUCTORS -------------------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="FmdlParameter"/> class from the given
 /// <see cref="BfresLoaderContext"/>. The reader of the context has to be positioned at the start of the data.
 /// </summary>
 /// <param name="context">The loader context providing information about how to load the data.</param>
 internal FmdlParameter(BfresLoaderContext context)
 {
     Load(context);
 }
コード例 #22
0
ファイル: FshpLodModel.cs プロジェクト: Syroot/NintenTools
 // ---- CONSTRUCTORS -------------------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="FshpLodModel"/> class from the given
 /// <see cref="BfresLoaderContext"/>. The reader of the context has to be positioned at the start of the data.
 /// </summary>
 /// <param name="context">The loader context providing information about how to load the data.</param>
 internal FshpLodModel(BfresLoaderContext context)
 {
     Load(context);
 }
コード例 #23
0
ファイル: FmatMaterial.cs プロジェクト: Syroot/NintenTools
 // ---- CONSTRUCTORS -------------------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="FmatMaterial"/> class from the given
 /// <see cref="BfresLoaderContext"/>. The reader of the context has to be positioned at the start of the data.
 /// </summary>
 /// <param name="context">The loader context providing information about how to load the data.</param>
 internal FmatMaterial(BfresLoaderContext context)
 {
     Load(context);
 }
コード例 #24
0
ファイル: FmatMaterial.cs プロジェクト: Syroot/NintenTools
        private void LoadTextureAttributeSelectors(BfresLoaderContext context)
        {
            // Load the array.
            context.Reader.Position = Internal.TextureAttributeSelectorOffset.ToFile;
            TextureAttributeSelectors = new List<FmatTextureAttributeSelector>(Internal.TextureAttributeSelectorCount);
            for (int i = 0; i < Internal.TextureAttributeSelectorCount; i++)
            {
                TextureAttributeSelectors.Add(new FmatTextureAttributeSelector(context));
            }

            // Load the index group, just for internal use and fun.
            context.Reader.Position = Internal.TextureAttributeSelectorIndexGroupOffset.ToFile;
            Internal.TextureAttributeSelectorIndexGroup = new BfresIndexGroup(context);
            if (Internal.TextureAttributeSelectorIndexGroup.NodeCount != Internal.TextureAttributeSelectorCount)
            {
                context.Warnings.Add("FmatMaterial.TextureAttributeSelectorIndexGroup has node count unequal to "
                    + "header");
            }
        }
コード例 #25
0
ファイル: FtexSection.cs プロジェクト: Syroot/NintenTools
 // ---- CONSTRUCTORS -------------------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="FtexSection"/> class from the given
 /// <see cref="BfresLoaderContext"/>. The reader of the context has to be positioned at the start of the data.
 /// </summary>
 /// <param name="context">The loader context providing information about how to load the data.</param>
 internal FtexSection(BfresLoaderContext context)
 {
     Load(context);
 }
コード例 #26
0
ファイル: FshpIndexBuffer.cs プロジェクト: Syroot/NintenTools
 private void LoadData(BfresLoaderContext context)
 {
     context.Reader.Position = Internal.DataOffset.ToFile;
     Data = context.Reader.ReadUInt16s((int)Internal.Size / 2);
 }
コード例 #27
0
ファイル: FtexSection.cs プロジェクト: Syroot/NintenTools
 private void LoadMipmapData(BfresLoaderContext context)
 {
     if (!Internal.MipmapOffset.IsEmpty)
     {
         context.Reader.Position = Internal.MipmapOffset.ToFile;
         MipmapData = context.Reader.ReadBytes((int)Internal.MipmapSize);
     }
 }
コード例 #28
0
 private void LoadData(BfresLoaderContext context)
 {
     context.Reader.Position = Internal.BufferArrayOffset.ToFile;
     Data = new List<FvtxVertexData>(Internal.BufferCount);
     for (int i = 0; i < Internal.BufferCount; i++)
     {
         Data.Add(new FvtxVertexData(context));
     }
 }
コード例 #29
0
        // ---- METHODS (PRIVATE) --------------------------------------------------------------------------------------
        private void Load(BfresLoaderContext context)
        {
            Internal = new Internals();

            Internal.Unknown0x00 = context.Reader.ReadUInt32();
            if (Internal.Unknown0x00 >= 0x14)
            {
                context.Warnings.Add("FmatMaterialStructure.Unknown0x00 has unexpected value of "
                    + Internal.Unknown0x00);
            }

            Internal.Unknown0x04 = context.Reader.ReadUInt16();
            if (Internal.Unknown0x04 != 0x0028)
            {
                context.Warnings.Add("FmatMaterialStructure.Unknown0x04 has unexpected value of "
                    + Internal.Unknown0x04);
            }

            Internal.Unknown0x06 = context.Reader.ReadUInt16();
            if (Internal.Unknown0x06 != 0x0240 && Internal.Unknown0x06 != 0x0242 && Internal.Unknown0x06 != 0x0243)
            {
                context.Warnings.Add("FmatMaterialStructure.Unknown0x06 has unexpected value of "
                    + Internal.Unknown0x06);
            }

            Internal.Unknown0x08 = context.Reader.ReadUInt32();
            if (Internal.Unknown0x08 != 0x49749732 && Internal.Unknown0x08 != 0x49749736)
            {
                context.Warnings.Add("FmatMaterialStructure.Unknown0x08 has unexpected value of "
                    + Internal.Unknown0x08);
            }

            Internal.Unknown0x0C = context.Reader.ReadUInt32();
            if (Internal.Unknown0x0C > 0x0E)
            {
                context.Warnings.Add("FmatMaterialStructure.Unknown0x0C has unexpected value of "
                    + Internal.Unknown0x0C);
            }

            Internal.Unknown0x10 = context.Reader.ReadSingle();
            if (Internal.Unknown0x10 >= 1f)
            {
                context.Warnings.Add("FmatMaterialStructure.Unknown0x10 has unexpected value of "
                    + Internal.Unknown0x10);
            }

            Internal.Unknown0x14 = context.Reader.ReadUInt16();
            if (Internal.Unknown0x14 != 0x00CC)
            {
                context.Warnings.Add("FmatMaterialStructure.Unknown0x14 has unexpected value of "
                    + Internal.Unknown0x14);
            }

            Internal.Unknown0x16 = context.Reader.ReadUInt16();
            if (Internal.Unknown0x16 != 0x0000 && Internal.Unknown0x16 != 0x0100)
            {
                context.Warnings.Add("FmatMaterialStructure.Unknown0x16 has unexpected value of "
                    + Internal.Unknown0x16);
            }

            Internal.Unknown0x18 = context.Reader.ReadUInt32();
            if (Internal.Unknown0x18 != 0)
            {
                context.Warnings.Add("FmatMaterialStructure.Unknown0x18 has unexpected value of "
                    + Internal.Unknown0x18);
            }

            Internal.Unknown0x1C = context.Reader.ReadUInt16();
            if (Internal.Unknown0x1C != 0x2001)
            {
                context.Warnings.Add("FmatMaterialStructure.Unknown0x1C has unexpected value of "
                    + Internal.Unknown0x1C);
            }

            Internal.Unknown0x1E = context.Reader.ReadByte();
            if (Internal.Unknown0x1E != 1 && Internal.Unknown0x1E != 0x05)
            {
                context.Warnings.Add("FmatMaterialStructure.Unknown0x1E has unexpected value of "
                    + Internal.Unknown0x1E);
            }

            Internal.Unknown0x1F = context.Reader.ReadByte();
            if (Internal.Unknown0x1F != 1 && Internal.Unknown0x1F != 4)
            {
                context.Warnings.Add("FmatMaterialStructure.Unknown0x1F has unexpected value of "
                    + Internal.Unknown0x1F);
            }

            // 16 empty bytes
            if (!Array.TrueForAll(context.Reader.ReadUInt32s(4), (i) => { return i == 0; }))
            {
                context.Warnings.Add("FmatMaterialStructure padding not empty");
            }
        }
コード例 #30
0
 // ---- CONSTRUCTORS -------------------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="FvtxVertexBuffer"/> class from the given
 /// <see cref="BfresLoaderContext"/>. The reader of the context has to be positioned at the start of the data.
 /// </summary>
 /// <param name="context">The loader context providing information about how to load the data.</param>
 internal FvtxVertexBuffer(BfresLoaderContext context)
 {
     Load(context);
 }