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;
|
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!");
|
||||||
|
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user