From 6839d90a9b838f9cb7ad69ff573654f8dce176ef Mon Sep 17 00:00:00 2001 From: August <33284629+CosmicDreamsOfCode@users.noreply.github.com> Date: Tue, 29 Nov 2022 23:32:03 +0000 Subject: [PATCH] "Fix" for some Sparks of Hope textures (#548) * i dont get it * fix textures that dont have the extra data --- BrawlboxHelper/BrawlboxHelper.dll | Bin 22016 -> 22016 bytes .../Syroot.NintenTools.NSW.Bfres.dll | Bin 240640 -> 240640 bytes Switch_Toolbox_Library/FileFormats/DDS.cs | 13 +++++++++++++ 3 files changed, 13 insertions(+) diff --git a/BrawlboxHelper/BrawlboxHelper.dll b/BrawlboxHelper/BrawlboxHelper.dll index 7fed3a8cec92b6c2d5a20e2c5a5dd8f970b4ab7c..a0a78e032f8108db342b1ecdca348faab3422a1a 100644 GIT binary patch delta 166 zcmZoz!`QHfaY6@6-#oT06MJMBvnH+#XB3^x$XL%z|Onkio^s4AYcOG*vS+9v}IqOd62}iPuI0qH)s3YQl(5rpp2_k zOmKc_QF7|!|9&Uv27i^!d;!0hnR0A53x>RB IoM^xf07rH;m;e9( delta 207 zcmZoz!`QHfaY6@6{lyROCiciM_Dx(F&S*WEk+Gg}%H&2MnZKEliP=@adrhlddX})? zw)`nP_1CYNY!-1ZVCS8AvSBj=5HJC8^W=$s+RjCnR&Y+AR_4|iH|f=j5aYXyKpAJN zn9$Pu6?R-ds}AUQ)rhy`+Na%pHNMSPo|;VJpW~9}8M< zgcwfR9uUeb*j~DbxtkLJAKEvs delta 128 zcmZp;!PjtuZ$byllS};5HugL$pWI-}(p*^4URc4ny|9Am{2hTFak<75YIbgO9cNFA z{Hd<6Js^}>#)oC=6RU^Q3l=g52)vmhZrH21-?@M1;$JLp_f<~6u#mY`0V?{~A1Vq| ZpEzH@L+{l8tjZN^B0}3s7cqBp0syw0I;8*r diff --git a/Switch_Toolbox_Library/FileFormats/DDS.cs b/Switch_Toolbox_Library/FileFormats/DDS.cs index ff352417..2da8bf62 100644 --- a/Switch_Toolbox_Library/FileFormats/DDS.cs +++ b/Switch_Toolbox_Library/FileFormats/DDS.cs @@ -581,6 +581,19 @@ namespace Toolbox.Library } reader.TemporarySeek((int)(4 + header.size + DX10HeaderSize), SeekOrigin.Begin); + var UbiExtraData = reader.ReadUInt16(); + reader.TemporarySeek(-2, SeekOrigin.Current); + if (UbiExtraData == 12816 || UbiExtraData == 1331 && IsDX10) //me when ubisoft | for some reason theres some extra data on some mario rabbids textures god knows what it is + { + if (header.width == 1024 && header.height == 1024) + { + reader.TemporarySeek((int)(4 + 30 + header.size + DX10HeaderSize), SeekOrigin.Begin); + } + if (header.width == 512 && header.height == 512) + { + reader.TemporarySeek((int)(4 + 26 + header.size + DX10HeaderSize), SeekOrigin.Begin); + } + } bdata = reader.ReadBytes((int)(reader.BaseStream.Length - reader.BaseStream.Position)); Format = GetFormat();