Пример #1
0
 public void GetMaterialTextures(TexBlock texBlock)
 {
     foreach (Material mat in MaterialList)
     {
         mat.GetTextures(texBlock);
     }
 }
Пример #2
0
 public void GetTextures(TexBlock texBlock)
 {
     for (int i = 0; i < textureIndexes.Count; i++)
     {
         if (textureIndexes[i] == -1)
         {
             continue;
         }
         Textures.Add(texBlock.Textures[textureIndexes[i]]);
     }
 }
Пример #3
0
        /// <summary>
        /// Loads data from a .bin file via a stream.
        /// </summary>
        /// <param name="reader">Stream to load data from</param>
        private void OpenModel(EndianBinaryReader reader)
        {
            Version = reader.ReadByte();
            if (Version != 2)
            {
                throw new FormatException("Model version wasn't 2!");
            }

            Name = new string(reader.ReadChars(11));
            Name = Name.Trim('\0');

            TextureData = new TexBlock(reader);
            TextureData.GetTextureSettings(reader);
            VertexData   = new VertexAttribBlock(reader);
            MaterialData = new MaterialBlock(reader);
            MaterialData.GetMaterialTextures(TextureData);
        }