public byte[] GetImageBytesForMip(Texture2DMipInfo info, MEGame game, bool useLowerMipsIfTFCMissing, string gamePathToUse = null, List <string> additionalTFCs = null) { byte[] imageBytes = null; try { imageBytes = GetTextureData(info, game, gamePathToUse, true, additionalTFCs); } catch (FileNotFoundException e) { if (useLowerMipsIfTFCMissing) { //External archive not found - using built in mips (will be hideous, but better than nothing) info = Mips.FirstOrDefault(x => x.storageType == StorageTypes.pccUnc); if (info != null) { imageBytes = GetTextureData(info, game, gamePathToUse); } } else { throw e; //rethrow } } if (imageBytes == null) { throw new Exception(GetLocalizedCouldNotFetchTextureDataMessage(info?.Export.InstancedFullPath, info?.Export.FileRef.FilePath)); } return(imageBytes); }
public FTexture2DMipMap?GetFirstMip() => Mips.FirstOrDefault(x => x.Data.Data != null);
public Texture2DMipInfo GetTopMip() { return(Mips.FirstOrDefault(x => x.storageType != StorageTypes.empty)); }