Open aerofly opened 7 months ago
Hello,
the current code when generating the mipmap level 2x2 for DXT1 textures is broken. The error is in the function
bool CCodecBuffer_RGB888::ReadBlockRGBA(CMP_DWORD x, CMP_DWORD y, CMP_BYTE w, CMP_BYTE h, CMP_BYTE block[])
and this line
CMP_BYTE* pDestData = (CMP_BYTE*)&pdwBlock[j * dwWidth];
It should actually be
CMP_BYTE* pDestData = (CMP_BYTE*)&pdwBlock[j * w];
Otherwise the pixels are not properly duplicated into the 4x4 block. Some other ReadBlockRGBA functions also have this small issue.
This issue is probably also causing this
Can you confirm if this is actually a bug and if my fix is working properly?
Hello,
the current code when generating the mipmap level 2x2 for DXT1 textures is broken. The error is in the function
bool CCodecBuffer_RGB888::ReadBlockRGBA(CMP_DWORD x, CMP_DWORD y, CMP_BYTE w, CMP_BYTE h, CMP_BYTE block[])
and this line
CMP_BYTE* pDestData = (CMP_BYTE*)&pdwBlock[j * dwWidth];
It should actually be
CMP_BYTE* pDestData = (CMP_BYTE*)&pdwBlock[j * w];
Otherwise the pixels are not properly duplicated into the 4x4 block. Some other ReadBlockRGBA functions also have this small issue.
This issue is probably also causing this
Can you confirm if this is actually a bug and if my fix is working properly?