Example #1
0
        public MDXTexture(BinaryReader br)
        {
            TextureType = (EMDXTextureType)br.ReadUInt32();
            Flags       = (EMDXTextureFlags)br.ReadUInt32();

            // This points off to a null-terminated string, so we'll pop off the null byte when deserializing it
            Filename = new string(br.ReadMDXArray <char>().ToArray()).TrimEnd('\0');
        }
Example #2
0
 public MDXTexture(byte[] data)
 {
     using (MemoryStream ms = new MemoryStream(data))
     {
         using (BinaryReader br = new BinaryReader(ms))
         {
             this.TextureType    = (EMDXTextureType)br.ReadUInt32();
             this.Flags          = (EMDXTextureFlags)br.ReadUInt32();
             this.FilenameLength = br.ReadUInt32();
             this.FilenameOffset = br.ReadUInt32();
         }
     }
 }