1
0
mirror of synced 2024-11-12 02:00:50 +01:00

Some archive parent fixes for texture manager

This commit is contained in:
KillzXGaming 2019-10-14 18:38:55 -04:00
parent 858a85f641
commit 8529b0b818
2 changed files with 11 additions and 2 deletions

View File

@ -504,7 +504,7 @@ namespace LayoutBXLYT.Cafe
else else
TextureManager.Platform = TextureManager.PlatformType.WiiU; TextureManager.Platform = TextureManager.PlatformType.WiiU;
TextureManager.ArchiveParent = FileInfo.IFileInfo.ArchiveParent; TextureManager.LayoutFile = this;
bool setRoot = false; bool setRoot = false;
bool setGroupRoot = false; bool setGroupRoot = false;

View File

@ -11,12 +11,17 @@ namespace LayoutBXLYT
{ {
public class TextureManager : IDisposable public class TextureManager : IDisposable
{ {
public BxlytHeader LayoutFile;
public Dictionary<string, BNTX> BinaryContainers = new Dictionary<string, BNTX>(); public Dictionary<string, BNTX> BinaryContainers = new Dictionary<string, BNTX>();
//The archive to put textures in if necessary //The archive to put textures in if necessary
public Dictionary<string, IArchiveFile> ArchiveFile = new Dictionary<string, IArchiveFile>(); public Dictionary<string, IArchiveFile> ArchiveFile = new Dictionary<string, IArchiveFile>();
public IArchiveFile ArchiveParent; public IArchiveFile ArchiveParent
{
get { return LayoutFile.FileInfo.IFileInfo.ArchiveParent; }
}
public PlatformType Platform = PlatformType.WiiU; public PlatformType Platform = PlatformType.WiiU;
@ -55,6 +60,8 @@ namespace LayoutBXLYT
break; break;
case PlatformType.WiiU: case PlatformType.WiiU:
{ {
if (ArchiveParent == null) return null;
foreach (var file in ArchiveParent.Files) foreach (var file in ArchiveParent.Files)
{ {
if (file.FileName == name) if (file.FileName == name)
@ -92,6 +99,8 @@ namespace LayoutBXLYT
case PlatformType.WiiU: case PlatformType.WiiU:
{ {
var archive = ArchiveParent; var archive = ArchiveParent;
if (archive == null) return null;
var bflim = BFLIM.CreateNewFromImage(); var bflim = BFLIM.CreateNewFromImage();
if (bflim == null) if (bflim == null)
return textures; return textures;