1
0
mirror of synced 2025-01-19 09:17:30 +01:00

Swap R and B manually decoded textures for opengl rendering

This commit is contained in:
KillzXGaming 2019-08-30 19:23:39 -04:00
parent b8135703ec
commit 4b330c475b
2 changed files with 4 additions and 3 deletions

View File

@ -1090,7 +1090,7 @@ namespace Toolbox.Library
return false;
}
private static byte[] ConvertBgraToRgba(byte[] bytes)
public static byte[] ConvertBgraToRgba(byte[] bytes)
{
if (bytes == null)
throw new Exception("Data block returned null. Make sure the parameters and image properties are correct!");

View File

@ -272,14 +272,15 @@ namespace Toolbox.Library.Rendering
default:
if (Runtime.UseDirectXTexDecoder)
{
return STGenericTexture.DecodeBlock(ImageData,
return STGenericTexture.ConvertBgraToRgba(
STGenericTexture.DecodeBlock(ImageData,
width,
height,
GenericTexture.Format,
new byte[0],
GenericTexture.Parameters,
PALETTE_FORMAT.None,
GenericTexture.PlatformSwizzle);
GenericTexture.PlatformSwizzle));
}
else
return ImageData;