Swap R and B manually decoded textures for opengl rendering
This commit is contained in:
parent
b8135703ec
commit
4b330c475b
@ -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!");
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user