diff --git a/BrawlboxHelper/Syroot.NintenTools.NSW.Bfres.dll b/BrawlboxHelper/Syroot.NintenTools.NSW.Bfres.dll index e9e5ba92..aca20202 100644 Binary files a/BrawlboxHelper/Syroot.NintenTools.NSW.Bfres.dll and b/BrawlboxHelper/Syroot.NintenTools.NSW.Bfres.dll differ diff --git a/BrawlboxHelper/Syroot.NintenTools.NSW.Bfres.pdb b/BrawlboxHelper/Syroot.NintenTools.NSW.Bfres.pdb index 80f0d151..87c608a1 100644 Binary files a/BrawlboxHelper/Syroot.NintenTools.NSW.Bfres.pdb and b/BrawlboxHelper/Syroot.NintenTools.NSW.Bfres.pdb differ diff --git a/File_Format_Library/FileFormats/Message/MSBT.cs b/File_Format_Library/FileFormats/Message/MSBT.cs index 191a2b93..e8ab47ba 100644 --- a/File_Format_Library/FileFormats/Message/MSBT.cs +++ b/File_Format_Library/FileFormats/Message/MSBT.cs @@ -268,9 +268,10 @@ namespace FirstPlugin EntryCount = reader.ReadUInt32(); Offsets = reader.ReadUInt32s((int)EntryCount); + Console.WriteLine($""); for (int i = 0; i < EntryCount; i++) { - reader.Position = Offsets[i] + Position; + reader.SeekBegin(Offsets[i] + Position); ReadMessageString(reader, (uint)i); } } @@ -279,13 +280,20 @@ namespace FirstPlugin { List chars = new List(); - short charCheck = reader.ReadInt16(); - while (charCheck != 0) + byte charCheck = reader.ReadByte(); + byte charCheck2 = reader.ReadByte(); + while (charCheck != 0 && charCheck2 != 0) { - chars.Add((byte)(charCheck >> 8)); - chars.Add((byte)(charCheck & 255)); + chars.Add(charCheck); + chars.Add(charCheck2); - charCheck = reader.ReadInt16(); + if (reader.Position < reader.BaseStream.Length - 2) + { + charCheck = reader.ReadByte(); + charCheck2 = reader.ReadByte(); + } + else + break; } TextData.Add(new StringEntry(chars.ToArray()) { Index = index, }); diff --git a/Switch_Toolbox_Library/Helpers/TreeHelper.cs b/Switch_Toolbox_Library/Helpers/TreeHelper.cs index af01fb07..a08c9d01 100644 --- a/Switch_Toolbox_Library/Helpers/TreeHelper.cs +++ b/Switch_Toolbox_Library/Helpers/TreeHelper.cs @@ -111,9 +111,9 @@ namespace Toolbox.Library if (ParentPath != string.Empty) FilePath = FilePath.Replace(ParentPath, string.Empty); - var path = Path.Combine(overridePath, FilePath); + var path = $"{overridePath}/{FilePath}"; - progressBar.Task = $"Extracting File {file}"; + progressBar.Task = $"Extracting File {FileName}"; progressBar.Value = (Curfile++ * 100) / Collection.Count(); progressBar.Refresh(); CreateDirectoryIfExists($"{path}"); diff --git a/Switch_Toolbox_Library/IO/FileReader.cs b/Switch_Toolbox_Library/IO/FileReader.cs index d2c5e1b5..56275067 100644 --- a/Switch_Toolbox_Library/IO/FileReader.cs +++ b/Switch_Toolbox_Library/IO/FileReader.cs @@ -19,6 +19,12 @@ namespace Toolbox.Library.IO this.Position = 0; } + public FileReader(Stream stream, Encoding encoding, bool leaveOpen = false) + : base(stream, encoding, leaveOpen) + { + this.Position = 0; + } + public FileReader(string fileName, bool leaveOpen = false) : this(new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite), leaveOpen) { diff --git a/Toolbox/Lib/Syroot.NintenTools.NSW.Bfres.dll b/Toolbox/Lib/Syroot.NintenTools.NSW.Bfres.dll index e9e5ba92..aca20202 100644 Binary files a/Toolbox/Lib/Syroot.NintenTools.NSW.Bfres.dll and b/Toolbox/Lib/Syroot.NintenTools.NSW.Bfres.dll differ diff --git a/Toolbox/Lib/Syroot.NintenTools.NSW.Bfres.pdb b/Toolbox/Lib/Syroot.NintenTools.NSW.Bfres.pdb index 80f0d151..87c608a1 100644 Binary files a/Toolbox/Lib/Syroot.NintenTools.NSW.Bfres.pdb and b/Toolbox/Lib/Syroot.NintenTools.NSW.Bfres.pdb differ diff --git a/Toolbox/Shader/Layout/Legacy/Bflyt.frag b/Toolbox/Shader/Layout/Legacy/Bflyt.frag index 1c65c766..57a134c8 100644 --- a/Toolbox/Shader/Layout/Legacy/Bflyt.frag +++ b/Toolbox/Shader/Layout/Legacy/Bflyt.frag @@ -34,10 +34,9 @@ void main() { // Convert to sRGB. vec3 whiteColorSRGB = pow(whiteColor.rgb, vec3(1.0 / gamma)); - vec3 blackColorSRGB = pow(blackColor.rgb, vec3(1.0 / gamma)); - vec3 whiteInterpolation = whiteColor.rgb * textureMap0.rgb; - vec3 blackInterpolation = (vec3(1) - textureMap0.rgb) * blackColorSRGB.rgb; + vec3 whiteInterpolation = whiteColorSRGB.rgb * textureMap0.rgb; + vec3 blackInterpolation = (vec3(1) - textureMap0.rgb) * blackColor.rgb; vec3 colorBlend = whiteInterpolation + blackInterpolation;