Ejemplo n.º 1
0
        public void Load(System.IO.Stream stream)
        {
            CanSave    = true;
            CanRename  = true;
            CanReplace = true;

            using (var reader = new FileReader(stream))
            {
                //Parse with the IGZ structure class and get the texture info block
                IGZStructure = new IGZ_Structure();
                IGZStructure.Read(reader);

                if (IGZStructure.TextureInfo == null)
                {
                    CanSave = false;
                    return;
                }

                //Set all the info from the parsed struct
                var texInfo = IGZStructure.TextureInfo;
                Width          = texInfo.Width;
                Height         = texInfo.Height;
                Format         = texInfo.FormatInfo.Format;
                PlatformFormat = texInfo.FormatInfo.Platform;
                ArrayCount     = texInfo.ArrayCount;
                Depth          = texInfo.Depth;

                //Don't set the platform swizzle because they don't seem to be swizzled?
                //    PlatformSwizzle = texInfo.FormatInfo.Platform;

                //Grab the first entry from the string table
                if (IGZStructure.StringTable.Count > 0)
                {
                    Text = IGZStructure.StringTable[0];
                }
                else
                {
                    Text = FileName;
                }

                Parameters.FlipY = true;
            }
        }
Ejemplo n.º 2
0
 public bool Identify(System.IO.Stream stream)
 {
     return(IGZ_Structure.Identify(stream));
 }