Skip to content

Commit

Permalink
Fixes for texture refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
GMatrixGames committed Jun 5, 2023
1 parent 6dce30b commit 84f5d4d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CUE4Parse
Submodule CUE4Parse updated 30 files
+2 −0 CUE4Parse-Conversion/CUE4Parse-Conversion.csproj
+ CUE4Parse-Conversion/Resources/tegra_swizzle_x64.dll
+0 −159 CUE4Parse-Conversion/Textures/FormatHelper.cs
+0 −180 CUE4Parse-Conversion/Textures/PlatformDecoders.cs
+170 −68 CUE4Parse-Conversion/Textures/PlatformDeswizzlers.cs
+207 −201 CUE4Parse-Conversion/Textures/TextureDecoder.cs
+0 −93 CUE4Parse/UE4/Assets/Exports/Texture/EPixelFormat.cs
+4 −4 CUE4Parse/UE4/Assets/Exports/Texture/FTexture2DMipMap.cs
+119 −72 CUE4Parse/UE4/Assets/Exports/Texture/FTexturePlatformData.cs
+11 −7 CUE4Parse/UE4/Assets/Exports/Texture/FVirtualTextureBuiltData.cs
+225 −0 CUE4Parse/UE4/Assets/Exports/Texture/PixelFormat.cs
+23 −0 CUE4Parse/UE4/Assets/Exports/Texture/TextureCompressionSettings.cs
+3 −4 CUE4Parse/UE4/Assets/Exports/Texture/UCurveLinearColorAtlas.cs
+22 −23 CUE4Parse/UE4/Assets/Exports/Texture/ULightMapTexture2D.cs
+2 −15 CUE4Parse/UE4/Assets/Exports/Texture/UMediaTexture.cs
+3 −4 CUE4Parse/UE4/Assets/Exports/Texture/UShadowMapTexture2D.cs
+166 −14 CUE4Parse/UE4/Assets/Exports/Texture/UTexture.cs
+28 −206 CUE4Parse/UE4/Assets/Exports/Texture/UTexture2D.cs
+16 −2 CUE4Parse/UE4/Assets/Exports/Texture/UTexture2DArray.cs
+18 −2 CUE4Parse/UE4/Assets/Exports/Texture/UTextureCube.cs
+3 −4 CUE4Parse/UE4/Assets/Exports/Texture/UTextureLightProfile.cs
+2 −15 CUE4Parse/UE4/Assets/Exports/Texture/UTextureRenderTarget.cs
+2 −6 CUE4Parse/UE4/Assets/Exports/Texture/UTextureRenderTarget2D.cs
+3 −6 CUE4Parse/UE4/Assets/Exports/Texture/UTextureRenderTargetCube.cs
+1 −1 CUE4Parse/UE4/Assets/Exports/Texture/UVirtualTexture2D.cs
+18 −2 CUE4Parse/UE4/Assets/Exports/Texture/UVolumeTexture.cs
+5 −3 CUE4Parse/UE4/Objects/UObject/FField.cs
+326 −4 CUE4Parse/UE4/Objects/UObject/UnrealType.cs
+5 −4 CUE4Parse/UE4/Objects/UObject/UnrealTypeLegacy.cs
+1 −1 CUE4Parse/Utils/EnumUtils.cs
4 changes: 2 additions & 2 deletions FModel/ViewModels/CUE4ParseViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions FModel/ViewModels/TabControlViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
8 changes: 4 additions & 4 deletions FModel/Views/Snooper/Models/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
{
Expand Down
2 changes: 1 addition & 1 deletion FModel/Views/Snooper/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 84f5d4d

Please sign in to comment.