TextureDecoder: Fix a RGBA/BGRA copy/paste typo
We were decoding to BGRA32 textures in our RGBA32 texture decoder. Since this is the same for the BGRA32 decoder implementation, this is most likely a copy/paste typo, rather than the texture actually being bit-swapped. Fix this. I'm not sure of any games that use the C14X2 texture format, so I'm not sure this fixes any games, but it does make the code cleaner for when we clean it up in the future, and merge some of these similar loops.
This commit is contained in:
parent
a5297f6da8
commit
6682a2fadd
|
@ -945,7 +945,7 @@ PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int he
|
||||||
for (int y = 0; y < height; y += 4)
|
for (int y = 0; y < height; y += 4)
|
||||||
for (int x = 0, yStep = (y / 4) * Wsteps4; x < width; x += 4, yStep++)
|
for (int x = 0, yStep = (y / 4) * Wsteps4; x < width; x += 4, yStep++)
|
||||||
for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++)
|
for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++)
|
||||||
decodebytesC14X2_5A3_To_BGRA32(dst + (y + iy) * width + x, (u16*)(src + 8 * xStep), tlutaddr);
|
decodebytesC14X2_5A3_To_RGBA(dst + (y + iy) * width + x, (u16*)(src + 8 * xStep), tlutaddr);
|
||||||
}
|
}
|
||||||
else if (tlutfmt == 0)
|
else if (tlutfmt == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1349,7 +1349,7 @@ static PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width,
|
||||||
for (int y = 0; y < height; y += 4)
|
for (int y = 0; y < height; y += 4)
|
||||||
for (int x = 0, yStep = (y / 4) * Wsteps4; x < width; x += 4, yStep++)
|
for (int x = 0, yStep = (y / 4) * Wsteps4; x < width; x += 4, yStep++)
|
||||||
for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++)
|
for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++)
|
||||||
decodebytesC14X2_5A3_To_BGRA32(dst + (y + iy) * width + x, (u16*)(src + 8 * xStep), tlutaddr);
|
decodebytesC14X2_5A3_To_RGBA(dst + (y + iy) * width + x, (u16*)(src + 8 * xStep), tlutaddr);
|
||||||
}
|
}
|
||||||
else if (tlutfmt == 0)
|
else if (tlutfmt == 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue