mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-06-04 09:12:54 +00:00
fix: correct texture color channel mapping and mipmap conversion for Linux
This commit is contained in:
parent
2aa0058a8d
commit
f8510b88f0
|
|
@ -568,7 +568,7 @@ void Texture::transferFromImage(BufferedImage *image)
|
|||
#ifdef _XBOX
|
||||
int byteRemapRGBA[] = { 0, 1, 2, 3 };
|
||||
#else
|
||||
int byteRemapRGBA[] = { 3, 0, 1, 2 };
|
||||
int byteRemapRGBA[] = { 0, 1, 2, 3 };
|
||||
#endif
|
||||
int byteRemapBGRA[] = { 3, 2, 1, 0 };
|
||||
// #endif
|
||||
|
|
|
|||
|
|
@ -611,7 +611,7 @@ void Textures::loadTexture(BufferedImage *img, int id, bool blur, bool clamp)
|
|||
// Swap ARGB to RGBA
|
||||
for( int i = 0; i < ww * hh ; i++ )
|
||||
{
|
||||
tempData[i] = ( tempData[i] >> 24 ) | (tempData[i] << 8 );
|
||||
tempData[i] = ( tempData[i] << 8 ) | ( ( tempData[i] >> 24 ) & 0xff );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue