diff --git a/CUE4Parse b/CUE4Parse index a5aa9a75..5b38fc68 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit a5aa9a7551440ce4cd9a0147dbf8757701cae23c +Subproject commit 5b38fc685da2f574262d54639f687945660cdf00 diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index 2bca8b90..a387e007 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -759,7 +759,7 @@ public void Extract(CancellationToken cancellationToken, string fullPath, bool a break; } - case "bin" when fileName.Contains("AssetRegistry"): + case "bin" when fileName.Contains("AssetRegistry", StringComparison.OrdinalIgnoreCase): { if (Provider.TryCreateReader(fullPath, out var archive)) { @@ -892,7 +892,7 @@ public void ExtractAndScroll(CancellationToken cancellationToken, string fullPat TabControl.SelectedTab.SetDocumentText(verseDigest.ReadableCode, false, false); return true; } - case UTexture2D { IsVirtual: false } texture when isNone || saveTextures: + case UTexture { IsVirtual: false } texture when isNone || saveTextures: { TabControl.SelectedTab.AddImage(texture, saveTextures, updateUi); return false; diff --git a/FModel/ViewModels/TabControlViewModel.cs b/FModel/ViewModels/TabControlViewModel.cs index 064ed0cc..3e603eb0 100644 --- a/FModel/ViewModels/TabControlViewModel.cs +++ b/FModel/ViewModels/TabControlViewModel.cs @@ -228,8 +228,8 @@ public void ClearImages() }); } - public void AddImage(UTexture2D texture, bool save, bool updateUi) - => AddImage(texture.Name, texture.bRenderNearestNeighbor, texture.Decode(UserSettings.Default.OverridedPlatform), save, updateUi); + public void AddImage(UTexture texture, bool save, bool updateUi) + => AddImage(texture.Name, texture.RenderNearestNeighbor, texture.Decode(UserSettings.Default.OverridedPlatform), save, updateUi); public void AddImage(string name, bool rnn, SKBitmap[] img, bool save, bool updateUi) { diff --git a/FModel/Views/Snooper/Models/Model.cs b/FModel/Views/Snooper/Models/Model.cs index fd04527b..1bbdf26e 100644 --- a/FModel/Views/Snooper/Models/Model.cs +++ b/FModel/Views/Snooper/Models/Model.cs @@ -440,10 +440,10 @@ public void PickingRender(Shader shader) public void Dispose() { - _ebo.Dispose(); - _vbo.Dispose(); - _matrixVbo.Dispose(); - _vao.Dispose(); + _ebo?.Dispose(); + _vbo?.Dispose(); + _matrixVbo?.Dispose(); + _vao?.Dispose(); Skeleton?.Dispose(); for (int socket = 0; socket < Sockets.Count; socket++) { diff --git a/FModel/Views/Snooper/Options.cs b/FModel/Views/Snooper/Options.cs index 56b49c3c..59968359 100644 --- a/FModel/Views/Snooper/Options.cs +++ b/FModel/Views/Snooper/Options.cs @@ -182,7 +182,7 @@ public bool TryGetTexture(UTexture2D o, bool fix, out Texture texture) var guid = o.LightingGuid; if (!Textures.TryGetValue(guid, out texture) && o.GetMipByMaxSize(UserSettings.Default.PreviewMaxTextureSize) is { } mip) { - TextureDecoder.DecodeTexture(mip, o.Format, o.isNormalMap, _platform, out var data, out _); + TextureDecoder.DecodeTexture(mip, o.Format, o.IsNormalMap, _platform, out var data, out _); texture = new Texture(data, mip.SizeX, mip.SizeY, o); if (fix) TextureHelper.FixChannels(_game, texture);