Esempio n. 1
0
 public void UpdateFromDDS(DDSFile file)
 {
     if (!RunInit)
     {
         InitMapping();
     }
     data           = file.data;
     DataSize       = file.data.Length;
     SameAsDataSize = (short)file.data.Length;
     Width          = (ushort)file.Width;
     Height         = (ushort)(file.Height);
     MimmapLevels   = (byte)(file.MipMapCount + 1);
     EncodingType   = DXTMapping[file.PixelFormat];
 }
Esempio n. 2
0
        public DDSFile GetDDSFile()
        {
            var ddsFile = new DDSFile();

            ddsFile.Size        = 124;
            ddsFile.Height      = Height;
            ddsFile.Width       = Width;
            ddsFile.MipMapCount = (uint)(MimmapLevels - 1);
            ddsFile.PixelFormat = DDSFile.EncodingValues[EncodingType - 8];
            ddsFile.Pitch       = 0;
            ddsFile.Depth       = 0;
            if (MimmapLevels > 1)
            {
                ddsFile.Caps = 8 | 0x400000;
            }
            else
            {
                ddsFile.Caps = 0;
            }
            ddsFile.Caps |= 0x1000;
            ddsFile.data  = data;
            return(ddsFile);
        }