diff --git a/.gitignore b/.gitignore index 59a3d509..9358f7bb 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ Release/ .vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-shm .vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide .vs/Switch_Toolbox/v15/.suo +.vs/Switch_Toolbox/v15/.suo diff --git a/.vs/Switch_Toolbox/v15/.suo b/.vs/Switch_Toolbox/v15/.suo index 5dec7181..d2cf4e1e 100644 Binary files a/.vs/Switch_Toolbox/v15/.suo and b/.vs/Switch_Toolbox/v15/.suo differ diff --git a/Switch_FileFormatsMain/FileFormats/Texture/FTEX.cs b/Switch_FileFormatsMain/FileFormats/Texture/FTEX.cs index b2fffade..3b95ff49 100644 --- a/Switch_FileFormatsMain/FileFormats/Texture/FTEX.cs +++ b/Switch_FileFormatsMain/FileFormats/Texture/FTEX.cs @@ -470,9 +470,9 @@ namespace FirstPlugin case ((int)GTX.GX2SurfaceFormat.GX2_SURFACE_FORMAT_T_BC5_SNORM): decomp = DDSCompressor.DecompressBC5(data, (int)Width, (int)Height, true); break; case ((int)GTX.GX2SurfaceFormat.GX2_SURFACE_FORMAT_TC_R8_G8_B8_A8_SNORM): - break; + decomp = DDS_PixelDecode.DecodeR8G8B8A8(data, (int)Width, (int)Height); break; case ((int)GTX.GX2SurfaceFormat.GX2_SURFACE_FORMAT_TC_R8_G8_B8_A8_UINT): - break; + decomp = DDS_PixelDecode.DecodeR8G8B8A8(data, (int)Width, (int)Height); break; default: decomp = Properties.Resources.TextureError; Console.WriteLine($"Format {Format} not supported!"); diff --git a/Switch_FileFormatsMain/GUI/TextureUI/BNTXEditor.cs b/Switch_FileFormatsMain/GUI/TextureUI/BNTXEditor.cs index 43231e0c..3843b969 100644 --- a/Switch_FileFormatsMain/GUI/TextureUI/BNTXEditor.cs +++ b/Switch_FileFormatsMain/GUI/TextureUI/BNTXEditor.cs @@ -53,7 +53,6 @@ namespace FirstPlugin mipLevelCounterLabel.Text = $"{CurMipDisplayLevel} / {textureData.mipmaps[CurArrayDisplayLevel].Count - 1}"; arrayLevelCounterLabel.Text = $"{CurArrayDisplayLevel} / {textureData.mipmaps.Count - 1}"; - if (Thread != null && Thread.IsAlive) Thread.Abort(); diff --git a/Switch_FileFormatsMain/GUI/TextureUI/BinaryTextureImporterList.Designer.cs b/Switch_FileFormatsMain/GUI/TextureUI/BinaryTextureImporterList.Designer.cs index 7f364583..b285d4be 100644 --- a/Switch_FileFormatsMain/GUI/TextureUI/BinaryTextureImporterList.Designer.cs +++ b/Switch_FileFormatsMain/GUI/TextureUI/BinaryTextureImporterList.Designer.cs @@ -184,6 +184,7 @@ this.MipmapNum.Name = "MipmapNum"; this.MipmapNum.Size = new System.Drawing.Size(130, 16); this.MipmapNum.TabIndex = 20; + this.MipmapNum.ValueChanged += new System.EventHandler(this.MipmapNum_ValueChanged); // // WidthLabel // @@ -248,7 +249,8 @@ this.Controls.Add(this.button2); this.Controls.Add(this.button1); this.ForeColor = System.Drawing.Color.White; - this.Text = "BinaryTextureImporterList"; + this.Text = "Texture Importer"; + this.Load += new System.EventHandler(this.BinaryTextureImporterList_Load); ((System.ComponentModel.ISupportInitialize)(this.SwizzleNum)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.MipmapNum)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); diff --git a/Switch_FileFormatsMain/GUI/TextureUI/BinaryTextureImporterList.cs b/Switch_FileFormatsMain/GUI/TextureUI/BinaryTextureImporterList.cs index 73597579..6ff38e40 100644 --- a/Switch_FileFormatsMain/GUI/TextureUI/BinaryTextureImporterList.cs +++ b/Switch_FileFormatsMain/GUI/TextureUI/BinaryTextureImporterList.cs @@ -137,8 +137,8 @@ namespace FirstPlugin })); Thread.Start(); - // WidthLabel.Text = $"Width {pictureBox1.Image.Width}"; - // HeightLabel.Text = $"Height {pictureBox1.Image.Height}"; + // WidthLabel.Text = $"Width {pictureBox1.Image.Width}"; + // HeightLabel.Text = $"Height {pictureBox1.Image.Height}"; } private void button1_Click(object sender, EventArgs e) @@ -162,7 +162,29 @@ namespace FirstPlugin formatComboBox.SelectedItem = SelectedTexSettings.Format; SetupSettings(); + + MipmapNum.Value = 0; + + uint num = Math.Max(SelectedTexSettings.TexHeight, SelectedTexSettings.TexWidth); + while (true) + { + num >>= 1; + if (num > 0) + ++MipmapNum.Value; + else + break; + } + MipmapNum.Maximum = MipmapNum.Value; } } + + private void BinaryTextureImporterList_Load(object sender, EventArgs e) + { + } + + private void MipmapNum_ValueChanged(object sender, EventArgs e) + { + SelectedTexSettings.MipCount = (uint)MipmapNum.Value; + } } }