When packing ARGB pixels make sure to convert them to 8-bit depth first

This commit is contained in:
Pavel Krajcevski 2013-08-31 16:05:50 -04:00
parent 1ffbdea2b8
commit 8c2127c08a
2 changed files with 18 additions and 11 deletions

View file

@ -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

View file

@ -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 {