Matteo Bruni (@Mystral) commented about dlls/d3dx9_36/surface.c:
/* STB doesn't do DXT2/DXT3, we'll do the alpha part ourselves. */for (y = 0; y < 4; ++y){uint8_t *tmp_row = &block_buf[y * 4 * 4];dst_data_offset[0] = (tmp_row[7] & 0xf0);dst_data_offset[0] |= (tmp_row[3] >> 4);dst_data_offset[1] = (tmp_row[15] & 0xf0);dst_data_offset[1] |= (tmp_row[11] >> 4);/** Set all alpha values to 0xff so they aren't considered during* compression.*/tmp_row[3] = tmp_row[7] = tmp_row[11] = tmp_row[15] = 0xff;
Is it okay to modify the source data here? I think at least a comment on top of the function might be in order.