1
0
mirror of synced 2025-01-19 17:18:44 +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; return false;
} }
private static byte[] ConvertBgraToRgba(byte[] bytes) public static byte[] ConvertBgraToRgba(byte[] bytes)
{ {
if (bytes == null) if (bytes == null)
throw new Exception("Data block returned null. Make sure the parameters and image properties are correct!"); 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: default:
if (Runtime.UseDirectXTexDecoder) if (Runtime.UseDirectXTexDecoder)
{ {
return STGenericTexture.DecodeBlock(ImageData, return STGenericTexture.ConvertBgraToRgba(
STGenericTexture.DecodeBlock(ImageData,
width, width,
height, height,
GenericTexture.Format, GenericTexture.Format,
new byte[0], new byte[0],
GenericTexture.Parameters, GenericTexture.Parameters,
PALETTE_FORMAT.None, PALETTE_FORMAT.None,
GenericTexture.PlatformSwizzle); GenericTexture.PlatformSwizzle));
} }
else else
return ImageData; return ImageData;