Exemple #1
0
        public void LoadBitMap(string FileName, BntxFile bntxFile)
        {
            DecompressedData.Clear();

            TexName    = Path.GetFileNameWithoutExtension(FileName);
            bntx       = bntxFile;
            Format     = TEX_FORMAT.BC1;
            FormatType = TEX_FORMAT_TYPE.SRGB;

            GenerateMipmaps = true;

            Bitmap Image = new Bitmap(FileName);

            Image = STGenericTexture.SwapBlueRedChannels(Image);

            TexWidth  = (uint)Image.Width;
            TexHeight = (uint)Image.Height;
            MipCount  = (uint)GetTotalMipCount();

            DecompressedData.Add(BitmapExtension.ImageToByte(Image));

            Image.Dispose();
            if (DecompressedData.Count == 0)
            {
                throw new Exception("Failed to load " + Format);
            }
        }