diff --git a/File_Format_Library/FileFormats/Layout/CAFE/BFLYT.cs b/File_Format_Library/FileFormats/Layout/CAFE/BFLYT.cs index 620aeec3..ad8e0950 100644 --- a/File_Format_Library/FileFormats/Layout/CAFE/BFLYT.cs +++ b/File_Format_Library/FileFormats/Layout/CAFE/BFLYT.cs @@ -504,7 +504,7 @@ namespace LayoutBXLYT.Cafe else TextureManager.Platform = TextureManager.PlatformType.WiiU; - TextureManager.ArchiveParent = FileInfo.IFileInfo.ArchiveParent; + TextureManager.LayoutFile = this; bool setRoot = false; bool setGroupRoot = false; diff --git a/File_Format_Library/FileFormats/Layout/TextureManager.cs b/File_Format_Library/FileFormats/Layout/TextureManager.cs index febacfb5..d9254996 100644 --- a/File_Format_Library/FileFormats/Layout/TextureManager.cs +++ b/File_Format_Library/FileFormats/Layout/TextureManager.cs @@ -11,12 +11,17 @@ namespace LayoutBXLYT { public class TextureManager : IDisposable { + public BxlytHeader LayoutFile; + public Dictionary BinaryContainers = new Dictionary(); //The archive to put textures in if necessary public Dictionary ArchiveFile = new Dictionary(); - public IArchiveFile ArchiveParent; + public IArchiveFile ArchiveParent + { + get { return LayoutFile.FileInfo.IFileInfo.ArchiveParent; } + } public PlatformType Platform = PlatformType.WiiU; @@ -55,6 +60,8 @@ namespace LayoutBXLYT break; case PlatformType.WiiU: { + if (ArchiveParent == null) return null; + foreach (var file in ArchiveParent.Files) { if (file.FileName == name) @@ -92,6 +99,8 @@ namespace LayoutBXLYT case PlatformType.WiiU: { var archive = ArchiveParent; + if (archive == null) return null; + var bflim = BFLIM.CreateNewFromImage(); if (bflim == null) return textures;