示例#1
0
 public Texture LoadTextureFromStream(GraphicsDevice device, string name, byte[] chunkFile)
 {
     var record = m_Headers[name];
     var offset = record.Offset;
     //using(var fs = new MemoryStream(chunkFile))
     {
         //  fs.Seek((int)offset, SeekOrigin.Begin);
         return(Tex16.DecodeFromBytes(device, chunkFile, (int)offset));
     }
 }
示例#2
0
        //public Texture LoadTextureFromFile(GraphicsDevice device, string name) {
        //    var record = m_Headers[name];
        //    var offset = record.Offset;
        //    using(var fs = new FileStream(m_FileName, FileMode.Open, FileAccess.Read, FileShare.Read))
        //    {
        //        fs.Seek(offset, SeekOrigin.Begin);
        //        return Tex16.DecodeStream(device, fs);
        //    }
        //}

        public Texture LoadTextureFromStream(GraphicsDevice device, string name, FileStream fs)
        {
            var record = m_Headers[name];
            var offset = record.Offset;
            //using(var fs = new FileStream(m_FileName, FileMode.Open, FileAccess.Read, FileShare.Read))
            {
                fs.Seek((int)offset, SeekOrigin.Begin);
                return(Tex16.DecodeStream(device, fs));
            }
        }