Exemple #1
0
 private void UpdateProperties()
 {
     properties         = new POWEProperties();
     properties.ID      = ID2;
     properties.Width   = Width;
     properties.Height  = Height;
     properties.NumMips = (byte)MipCount;
     properties.Format  = Format;
 }
Exemple #2
0
        public void Read(FileReader reader)
        {
            //Magic and ID not pointed to for sub entries so just skip them for now
            //     uint magic = reader.ReadUInt32();
            //   if (magic != Identifier)
            //         throw new Exception($"Invalid texture header magic! Expected {Identifier.ToString("x")}. Got {Identifier.ToString("x")}");
            //     ID = reader.ReadUInt32();

            CanReplace = true;
            CanRename  = false;
            CanDelete  = false;

            ID2    = reader.ReadUInt32();
            Width  = reader.ReadUInt16();
            Height = reader.ReadUInt16();
            var numMips  = reader.ReadByte();
            var unk      = reader.ReadByte(); //padding?
            var numArray = reader.ReadByte();

            Unknown   = reader.ReadByte();
            TexFormat = reader.ReadByte();
            Unknown2  = reader.ReadByte();
            Unknown3  = reader.ReadUInt16();

            if (FormatTable.ContainsKey(TexFormat))
            {
                Format = FormatTable[TexFormat];
            }
            else
            {
                Format = TEX_FORMAT.ASTC_8x8_UNORM;
                Console.WriteLine("Unknown Format!" + TexFormat.ToString("X"));
            }

            MipCount   = 1;
            ArrayCount = numArray;

            properties         = new POWEProperties();
            properties.ID      = ID2;
            properties.Width   = Width;
            properties.Height  = Height;
            properties.NumMips = numMips;
            properties.Format  = Format;
        }
        public void Read(FileReader reader)
        {
            //Magic and ID not pointed to for sub entries so just skip them for now
            //     uint magic = reader.ReadUInt32();
            //   if (magic != Identifier)
            //         throw new Exception($"Invalid texture header magic! Expected {Identifier.ToString("x")}. Got {Identifier.ToString("x")}");
            //     ID = reader.ReadUInt32();

            PlatformSwizzle = PlatformSwizzle.Platform_3DS;

            ImageSize = reader.ReadUInt32();
            ID2       = reader.ReadUInt32();
            reader.Seek(0x8);
            Width  = reader.ReadUInt16();
            Height = reader.ReadUInt16();
            reader.Seek(3);
            var numMips = reader.ReadByte();

            reader.Seek(0x14);
            byte FormatCtr = reader.ReadByte();

            reader.Seek(3);

            MipCount = 1;
            Format   = CTR_3DS.ConvertPICAToGenericFormat((CTR_3DS.PICASurfaceFormat)FormatCtr);

            Parameters       = new ImageParameters();
            Parameters.FlipY = true;

            properties         = new POWEProperties();
            properties.ID      = ID2;
            properties.Width   = Width;
            properties.Height  = Height;
            properties.NumMips = numMips;
            properties.Format  = Format;
        }