mirror of
https://github.com/yuzu-emu/FasTC
synced 2024-11-23 16:43:45 +00:00
When going from 344(3/4) pixels to 4555, the alpha channel only has a zero appended to it. Hence we must clear that bit for each pixel that was transparent during decoding.
This commit is contained in:
parent
f5e0aa4f9f
commit
dd625fca71
1 changed files with 24 additions and 0 deletions
|
@ -143,6 +143,30 @@ namespace PVRTCC {
|
|||
if(bDebugImages)
|
||||
imgB.DebugOutput("UnscaledImgB");
|
||||
|
||||
// Go through and change the alpha value of any pixel that came from
|
||||
// a transparent block. For some reason, alpha is not treated the same
|
||||
// as the other channels (to minimize hardware costs?) and the channels
|
||||
// do not their MSBs replicated.
|
||||
for(uint32 j = 0; j < blocksH; j++) {
|
||||
for(uint32 i = 0; i < blocksW; i++) {
|
||||
const uint32 blockIdx = j * blocksW + i;
|
||||
Block &b = blocks[blockIdx];
|
||||
|
||||
uint8 bitDepths[4];
|
||||
b.GetColorA().GetBitDepth(bitDepths);
|
||||
if(bitDepths[0] > 0) {
|
||||
Pixel &p = imgA(i, j);
|
||||
p.A() = p.A() & 0xFE;
|
||||
}
|
||||
|
||||
b.GetColorB().GetBitDepth(bitDepths);
|
||||
if(bitDepths[0] > 0) {
|
||||
Pixel &p = imgB(i, j);
|
||||
p.A() = p.A() & 0xFE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Bilinearly upscale the images.
|
||||
imgA.BilinearUpscale(2, wrapMode);
|
||||
imgB.BilinearUpscale(2, wrapMode);
|
||||
|
|
Loading…
Reference in a new issue