예제 #1
0
        public override void Replace(string FileName)
        {
            Bfres.Structs.FTEX ftex = new Bfres.Structs.FTEX();
            ftex.ReplaceTexture(FileName, Format, 1, SwizzlePattern, SupportedFormats, true, true, false, false, true);
            if (ftex.texture != null)
            {
                TextureTGLP.Format      = (ushort)ConvertToGx2(ftex.Format);
                TextureTGLP.SheetHeight = (ushort)ftex.texture.Height;
                TextureTGLP.SheetWidth  = (ushort)ftex.texture.Width;
                TextureTGLP.SheetDataList[SheetIndex] = ftex.texture.Data;
                Format = ftex.Format;
                Width  = ftex.texture.Width;
                Height = ftex.texture.Height;

                if (Format == TEX_FORMAT.BC4_UNORM)
                {
                    RedChannel   = STChannelType.One;
                    GreenChannel = STChannelType.One;
                    BlueChannel  = STChannelType.One;
                    AlphaChannel = STChannelType.Red;
                }

                //  UpdateEditor();
            }
        }
예제 #2
0
        public override void Replace(string FileName)
        {
            Bfres.Structs.FTEX ftex = new Bfres.Structs.FTEX();
            ftex.ReplaceTexture(FileName, Format, 1, 0, SupportedFormats, true, true, false);
            if (ftex.texture != null)
            {
                TextureTGLP.Format      = (ushort)ConvertToGx2(ftex.Format);
                TextureTGLP.SheetHeight = (ushort)ftex.texture.Height;
                TextureTGLP.SheetWidth  = (ushort)ftex.texture.Width;
                TextureTGLP.SheetDataList[SheetIndex] = ftex.texture.Data;
                Format = ftex.Format;
                Width  = ftex.texture.Width;
                Height = ftex.texture.Height;

                UpdateEditor();
            }
        }
예제 #3
0
        public override void Replace(string FileName)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter      = FileFilters.GTX;
            ofd.Multiselect = false;
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                Bfres.Structs.FTEX ftex = new Bfres.Structs.FTEX();
                ftex.ReplaceTexture(ofd.FileName, Format, 1, SupportedFormats, true, true, false, (uint)(SheetIndex * 2));
                if (ftex.texture != null)
                {
                    TextureTGLP.Format      = (ushort)ConvertToGx2(Format);
                    TextureTGLP.SheetHeight = (ushort)ftex.texture.Height;
                    TextureTGLP.SheetWidth  = (ushort)ftex.texture.Width;
                    TextureTGLP.SheetDataList[SheetIndex] = ftex.texture.Data;

                    UpdateEditor();
                }
            }
        }