From f6cd674c24dfa1f98c0e0054237dcd5e88038d3a Mon Sep 17 00:00:00 2001 From: PabloMK7 Date: Thu, 24 Feb 2022 02:22:38 +0100 Subject: [PATCH] BCLAN: Fix writing of PAI1 section (#459) Fixes writing of PAI1 section in BCLAN files (tested with Mario Kart 7 bclan files): 1. The offset of the strings is relative to the start of the table, not the start of the PAI1 section. 2. 4 bytes of padding after the strings are needed for proper alignment of the rest of the section. --- File_Format_Library/FileFormats/Layout/CTR/BCLAN.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/File_Format_Library/FileFormats/Layout/CTR/BCLAN.cs b/File_Format_Library/FileFormats/Layout/CTR/BCLAN.cs index a30c5493..50236b1d 100644 --- a/File_Format_Library/FileFormats/Layout/CTR/BCLAN.cs +++ b/File_Format_Library/FileFormats/Layout/CTR/BCLAN.cs @@ -313,9 +313,10 @@ namespace LayoutBXLYT writer.Write(new uint[Textures.Count]); for (int i = 0; i < Textures.Count; i++) { - writer.WriteUint32Offset(startOfsPos + (i * 4), startPos); + writer.WriteUint32Offset(startOfsPos + (i * 4), startOfsPos); writer.WriteString(Textures[i]); } + writer.Align(4); } if (Entries.Count > 0) {