From 9a9d310e96f961389e89d0a437f598d3fcd2f60e Mon Sep 17 00:00:00 2001 From: KillzXGaming Date: Tue, 16 Jul 2019 16:19:47 -0400 Subject: [PATCH] Fix wii u bffnt having invalid tiling on import --- .../FileFormats/Font/BFFNT.cs | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/Switch_FileFormatsMain/FileFormats/Font/BFFNT.cs b/Switch_FileFormatsMain/FileFormats/Font/BFFNT.cs index 18dd1ef5..45fe3514 100644 --- a/Switch_FileFormatsMain/FileFormats/Font/BFFNT.cs +++ b/Switch_FileFormatsMain/FileFormats/Font/BFFNT.cs @@ -257,22 +257,16 @@ namespace FirstPlugin 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(FileName, Format, 1, SupportedFormats, true, true, false, SwizzlePattern); + if (ftex.texture != null) { - 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; + TextureTGLP.Format = (ushort)ConvertToGx2(Format); + TextureTGLP.SheetHeight = (ushort)ftex.texture.Height; + TextureTGLP.SheetWidth = (ushort)ftex.texture.Width; + TextureTGLP.SheetDataList[SheetIndex] = ftex.texture.Data; - UpdateEditor(); - } + UpdateEditor(); } } @@ -367,13 +361,13 @@ namespace FirstPlugin //Swizzle and create surface var surface = GX2.CreateGx2Texture(data, Text, - (uint)2, + (uint)4, (uint)0, (uint)Width, (uint)Height, (uint)1, (uint)Gx2Format, - (uint)Swizzle, + (uint)SwizzlePattern, (uint)1, (uint)MipCount );