Example #1
0
        public DdtFile(System.IO.Stream fileStream)
        {
            using (BrgBinaryReader reader = new BrgBinaryReader(new LittleEndianBitConverter(), fileStream))
            {
                reader.ReadInt32();
                type = (DdtType)reader.ReadByte();
                alphaBits = reader.ReadByte();
                texelFormat = (DdtTexelFormat)reader.ReadByte();
                mipMap = reader.ReadByte();
                Height = reader.ReadInt32();
                Width = reader.ReadInt32();

                int length = 0;
                for (int i = 0; i < mipMap; i++)
                {
                    reader.ReadInt32();
                    length += reader.ReadInt32();
                }

                imageData = reader.ReadBytes(length);
            }
        }
Example #2
0
        public DdtFile(System.IO.Stream fileStream)
        {
            using (BrgBinaryReader reader = new BrgBinaryReader(new LittleEndianBitConverter(), fileStream))
            {
                reader.ReadInt32();
                type        = (DdtType)reader.ReadByte();
                alphaBits   = reader.ReadByte();
                texelFormat = (DdtTexelFormat)reader.ReadByte();
                mipMap      = reader.ReadByte();
                Height      = reader.ReadInt32();
                Width       = reader.ReadInt32();

                int length = 0;
                for (int i = 0; i < mipMap; i++)
                {
                    reader.ReadInt32();
                    length += reader.ReadInt32();
                }

                imageData = reader.ReadBytes(length);
            }
        }