diff --git a/3DS/3DS.csproj b/3DS/3DS.csproj index 5e86813..f9ae328 100644 --- a/3DS/3DS.csproj +++ b/3DS/3DS.csproj @@ -84,7 +84,6 @@ - diff --git a/3DS/NintendoWare/SND/CSTM.cs b/3DS/NintendoWare/SND/CSTM.cs index d9c9a0e..1fbef5d 100644 --- a/3DS/NintendoWare/SND/CSTM.cs +++ b/3DS/NintendoWare/SND/CSTM.cs @@ -5,7 +5,6 @@ using System.Text; using LibEveryFileExplorer.Files; using System.Drawing; using System.IO; -using _3DS.DSP; using LibEveryFileExplorer.SND; using CommonFiles; using LibEveryFileExplorer.IO; @@ -685,7 +684,7 @@ namespace _3DS.NintendoWare.SND if (Channel >= Info.StreamInfo.NrChannels) return null; if (Info.StreamInfo.Format == 2) { - ADPCM worker = new ADPCM(Info.CodecInfos[Channel].Table); + DSPADPCM worker = new DSPADPCM(Info.CodecInfos[Channel].Table); List Data = new List(); for (int i = 0; i < this.Data.Data.Length; i += (int)Info.StreamInfo.BlockSize * Info.StreamInfo.NrChannels) { diff --git a/LibEveryFileExplorer/LibEveryFileExplorer.csproj b/LibEveryFileExplorer/LibEveryFileExplorer.csproj index 0ab8e86..6c4b579 100644 --- a/LibEveryFileExplorer/LibEveryFileExplorer.csproj +++ b/LibEveryFileExplorer/LibEveryFileExplorer.csproj @@ -89,6 +89,7 @@ True Resource.resx + diff --git a/3DS/DSP/ADPCM.cs b/LibEveryFileExplorer/SND/DSPADPCM.cs similarity index 93% rename from 3DS/DSP/ADPCM.cs rename to LibEveryFileExplorer/SND/DSPADPCM.cs index 5e1f930..75c103c 100644 --- a/3DS/DSP/ADPCM.cs +++ b/LibEveryFileExplorer/SND/DSPADPCM.cs @@ -4,14 +4,14 @@ using System.Linq; using System.Text; using LibEveryFileExplorer.Math; -namespace _3DS.DSP +namespace LibEveryFileExplorer.SND { - public class ADPCM + public class DSPADPCM { Int16[] Table; double Last1 = 0; double Last2 = 0; - public ADPCM(Int16[] CoefTable) + public DSPADPCM(Int16[] CoefTable) { Table = CoefTable; } diff --git a/NDS/UI/TEX0Viewer.Designer.cs b/NDS/UI/TEX0Viewer.Designer.cs index fa2ef8f..57d97a9 100644 --- a/NDS/UI/TEX0Viewer.Designer.cs +++ b/NDS/UI/TEX0Viewer.Designer.cs @@ -35,6 +35,10 @@ this.listBox2 = new System.Windows.Forms.ListBox(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); + this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); + this.toolStripButton2 = new System.Windows.Forms.ToolStripButton(); + this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); + this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -44,6 +48,7 @@ this.splitContainer2.Panel2.SuspendLayout(); this.splitContainer2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.toolStrip1.SuspendLayout(); this.SuspendLayout(); // // splitContainer1 @@ -116,12 +121,45 @@ // // toolStrip1 // + this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripButton2, + this.toolStripButton1}); this.toolStrip1.Location = new System.Drawing.Point(0, 0); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Size = new System.Drawing.Size(350, 25); this.toolStrip1.TabIndex = 1; this.toolStrip1.Text = "toolStrip1"; // + // toolStripButton1 + // + this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton1.Enabled = false; + this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image"))); + this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton1.Name = "toolStripButton1"; + this.toolStripButton1.Size = new System.Drawing.Size(23, 22); + this.toolStripButton1.Text = "Export Texture"; + this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click); + // + // toolStripButton2 + // + this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton2.Enabled = false; + this.toolStripButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton2.Image"))); + this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton2.Name = "toolStripButton2"; + this.toolStripButton2.Size = new System.Drawing.Size(23, 22); + this.toolStripButton2.Text = "Import Texture"; + // + // openFileDialog1 + // + this.openFileDialog1.FileName = "openFileDialog1"; + // + // saveFileDialog1 + // + this.saveFileDialog1.DefaultExt = "png"; + this.saveFileDialog1.Filter = "PNG Images (*.png)|*.png"; + // // TEX0Viewer // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -140,6 +178,8 @@ ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); this.splitContainer2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.toolStrip1.ResumeLayout(false); + this.toolStrip1.PerformLayout(); this.ResumeLayout(false); } @@ -152,5 +192,9 @@ private System.Windows.Forms.ListBox listBox2; private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.ToolStrip toolStrip1; + private System.Windows.Forms.ToolStripButton toolStripButton2; + private System.Windows.Forms.ToolStripButton toolStripButton1; + private System.Windows.Forms.OpenFileDialog openFileDialog1; + private System.Windows.Forms.SaveFileDialog saveFileDialog1; } } diff --git a/NDS/UI/TEX0Viewer.cs b/NDS/UI/TEX0Viewer.cs index 3372b79..3d1c8cc 100644 --- a/NDS/UI/TEX0Viewer.cs +++ b/NDS/UI/TEX0Viewer.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Text; using System.Windows.Forms; using NDS.NitroSystem.G3D; +using System.Drawing.Imaging; namespace NDS.UI { @@ -50,9 +51,23 @@ namespace NDS.UI try { b = tex.ToBitmap(Textures.dictPltt[listBox2.SelectedIndex].Value); + toolStripButton1.Enabled = true;//export + } + catch + { + toolStripButton1.Enabled = false;//export } - catch { } finally { pictureBox1.Image = b; } } + + private void toolStripButton1_Click(object sender, EventArgs e) + { + saveFileDialog1.FileName = Textures.dictTex[listBox1.SelectedIndex].Key + ".png"; + if (saveFileDialog1.ShowDialog() == DialogResult.OK + && saveFileDialog1.FileName.Length > 0) + { + pictureBox1.Image.Save(saveFileDialog1.FileName, ImageFormat.Png); + } + } } } diff --git a/NDS/UI/TEX0Viewer.resx b/NDS/UI/TEX0Viewer.resx index 57a51a5..e127d83 100644 --- a/NDS/UI/TEX0Viewer.resx +++ b/NDS/UI/TEX0Viewer.resx @@ -128,4 +128,39 @@ 17, 17 + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAINSURBVDhPYxh4EFZb6xtSV5dODgbpZQiorc34TyYA6WUI + KCvL/Pvv3/9za4RJwiA9IL0MniUl2b/+/v1/ZZMkFiz1/+pmqf/XtkrDMYgPEgfpAellcMvNzf3+58// + ZW2G/w8v0v5/d7cSHN/bo/z/wX7V/0+Oa/1/dlYPTIP4IHGQHpBeBqfMzPzPv379j7S0/B9rZ/d/SYvJ + /yeHNMG4KFHsv6+z4P/th1L/7zqdB6bXrQv8v3qF7/+AoKD/IvLyOxhsUlML3//8+d9aUvK/l4bG/0hz + 0/9Ti43+r+s1/u9gJvi/paXl/z9ggIH8DMMgPkicS0DgEoNlfHzxm+/f/+f7coJxUQDP/7oYif8NcVL/ + NeU5/9fU1PwHufDd169wDOKDxDn5+a8ymERGlr749u3/oQUCGNhcj/V/eXn5/zPXrv1/CVQDwyA+SBxo + wA0GvdDQimdfvvzvymDDwKqyzP/DwsL+Gxsbo2ATE5P/4eHh/zl4eO4wyDk51b0EhsHjz58xsIWNzf/g + 4OD/x44d/3/o0GEwBrEtLCz+R0RE/Gfh4nrAwKmiksGrq9uGDTOzsT0JDAz8v3373v9KSkrAGNgCZtva + 2v6Pior6z8TCcg+UHdiAWAyIpdAxIyPjOiC+snbtbrDTV67c9h/EdnJy+h8bG/sfKHcBqA4v4AbirczM + zF3IGCj2GIIZVgIAnv30daMwYj8AAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHFSURBVDhPzZBfKOthHMa/t26mbOqsmHKjxcXq7FAuWLkS + F/6cG8s57YoT0lIzdjEhfxpaHc5KJ7JThrFdkC0Zyp9FkuICpSUUWfw4HdqMPed95+fUuTM3PPWp9316 + P8/FS+8nn83m6tcg6kQlJtO3aDSKFwOAO6JOVGww1Nw/PMDh9WJ8dhLeMQ0W7NJ/+Owy+EakmOfYP+CR + DXBH1IkK9fra23AYQ243IqFLOF2tWJxUY82ZCv+UAn53GvwuBVbYfXkiHRE2wB3KKCoyPfPD4QDnPiRA + OJuHx6XFxowKuytqHB2VYX+nAJuzSqxPZyLMBgrq6upJodG0sPN/uREEnB4u4Xi3DXurpQgEtDi5qImx + s6TGlkeFO/Yuv6pKT9Ls7PZnOmw2cG6EK+xtL6LdpEW3/hM8U5U4DQ7g4PA7fvaUYu5XDv6wgVydrkH8 + ASJ1RYUhEAzCbLUidHcJS181Ri0SOHolcPYnwueWYXo4CePWxFj/mw1wR9SJssrLjQfn52i2WNDc1YrG + L7IYxq/J6GyQY3QwDSP9iljXpJPjmg1wR9SJUvLyWgRWxgN3RJ0oQansihemSZ7sp8gZH+Mgi/HmIfoL + mcCdW7XvzrgAAAAASUVORK5CYII= + + + + 122, 17 + + + 262, 17 + \ No newline at end of file