mirror of
https://github.com/yuzu-emu/FasTC.git
synced 2025-01-23 07:01:02 +00:00
When packing ARGB pixels make sure to convert them to 8-bit depth first
This commit is contained in:
parent
1ffbdea2b8
commit
8c2127c08a
|
@ -147,4 +147,21 @@ namespace PVRTCC {
|
|||
}
|
||||
}
|
||||
|
||||
uint32 Pixel::PackRGBA() const {
|
||||
Pixel eightBit(*this);
|
||||
const uint8 eightBitDepth[4] = { 8, 8, 8, 8 };
|
||||
eightBit.ChangeBitDepth(eightBitDepth);
|
||||
|
||||
uint32 r = 0;
|
||||
r |= eightBit.A();
|
||||
r <<= 8;
|
||||
r |= eightBit.B();
|
||||
r <<= 8;
|
||||
r |= eightBit.G();
|
||||
r <<= 8;
|
||||
r |= eightBit.R();
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
} // namespace PVRTCC
|
||||
|
|
|
@ -105,17 +105,7 @@ class Pixel {
|
|||
}
|
||||
}
|
||||
|
||||
uint32 PackRGBA() const {
|
||||
uint32 r = 0;
|
||||
r |= m_A;
|
||||
r <<= 8;
|
||||
r |= m_B;
|
||||
r <<= 8;
|
||||
r |= m_G;
|
||||
r <<= 8;
|
||||
r |= m_R;
|
||||
return r;
|
||||
}
|
||||
uint32 PackRGBA() const;
|
||||
|
||||
private:
|
||||
union {
|
||||
|
|
Loading…
Reference in a new issue