Stop decoding BC1 punchthrough alpha in BC2&3

This commit is contained in:
Jan Solanti 2019-10-16 00:21:15 +03:00 committed by Andrew Murray
parent d374015504
commit 097f7d0f56

View File

@ -69,7 +69,7 @@ decode_565(UINT16 x) {
}
static void
decode_bc1_color(rgba *dst, const UINT8 *src) {
decode_bc1_color(rgba *dst, const UINT8 *src, int separate_alpha) {
bc1_color col;
rgba p[4];
int n, cw;
@ -150,13 +150,13 @@ decode_bc3_alpha(char *dst, const UINT8 *src, int stride, int o) {
static void
decode_bc1_block(rgba *col, const UINT8 *src) {
decode_bc1_color(col, src);
decode_bc1_color(col, src, 0);
}
static void
decode_bc2_block(rgba *col, const UINT8 *src) {
int n, bitI, byI, av;
decode_bc1_color(col, src + 8);
decode_bc1_color(col, src + 8, 1);
for (n = 0; n < 16; n++) {
bitI = n * 4;
byI = bitI >> 3;
@ -168,7 +168,7 @@ decode_bc2_block(rgba *col, const UINT8 *src) {
static void
decode_bc3_block(rgba *col, const UINT8 *src) {
decode_bc1_color(col, src + 8);
decode_bc1_color(col, src + 8, 1);
decode_bc3_alpha((char *)col, src, sizeof(col[0]), 3);
}