mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-03 09:23:37 +00:00
Cine::Palette: Remove unnecessary and needlessly complicating saving of the last loaded palette data's endian type.
svn-id: r39710
This commit is contained in:
parent
f7da5230e3
commit
80ab6ccf44
@ -222,10 +222,6 @@ Palette &Palette::fillWithBlack() {
|
||||
return *this;
|
||||
}
|
||||
|
||||
EndianType Palette::endianType() const {
|
||||
return (_bigEndian ? CINE_BIG_ENDIAN : CINE_LITTLE_ENDIAN);
|
||||
}
|
||||
|
||||
Graphics::PixelFormat Palette::colorFormat() const {
|
||||
return _format;
|
||||
}
|
||||
@ -248,10 +244,6 @@ void Palette::setColorFormat(const Graphics::PixelFormat format) {
|
||||
_bMax = (1 << _bBits) - 1;
|
||||
}
|
||||
|
||||
void Palette::setEndianType(const EndianType endian) {
|
||||
_bigEndian = isBigEndian(endian);
|
||||
}
|
||||
|
||||
// a.k.a. transformPaletteRange
|
||||
Palette &Palette::saturatedAddColor(Palette& output, byte firstIndex, byte lastIndex, signed r, signed g, signed b) {
|
||||
assert(firstIndex < colorCount() && lastIndex < colorCount());
|
||||
@ -292,7 +284,6 @@ Palette &Palette::load(const byte *buf, const uint size, const Graphics::PixelFo
|
||||
assert(format.gShift / 8 == (format.gShift + MAX<int>(0, 8 - format.gLoss - 1)) / 8); // G must be inside one byte
|
||||
assert(format.bShift / 8 == (format.bShift + MAX<int>(0, 8 - format.bLoss - 1)) / 8); // B must be inside one byte
|
||||
|
||||
setEndianType(endian);
|
||||
setColorFormat(format);
|
||||
|
||||
_colors.clear();
|
||||
|
@ -132,11 +132,6 @@ public:
|
||||
|
||||
Palette &fillWithBlack();
|
||||
|
||||
/*! \brief The original endian type in which this palette was loaded.
|
||||
* \note This will always return either CINE_BIG_ENDIAN or CINE_LITTLE_ENDIAN (So no CINE_NATIVE_ENDIAN).
|
||||
*/
|
||||
EndianType endianType() const;
|
||||
|
||||
/*! \brief The original color format in which this palette was loaded. */
|
||||
Graphics::PixelFormat colorFormat() const;
|
||||
|
||||
@ -145,15 +140,13 @@ public:
|
||||
|
||||
private:
|
||||
void setColorFormat(const Graphics::PixelFormat format);
|
||||
void setEndianType(const EndianType endian);
|
||||
Cine::Palette::Color saturatedAddColor(Cine::Palette::Color baseColor, signed r, signed g, signed b) const;
|
||||
|
||||
private:
|
||||
// The used source format, its endianness etc.
|
||||
// The used source format and some values calculated from it
|
||||
Graphics::PixelFormat _format;
|
||||
uint _rBits, _gBits, _bBits;
|
||||
uint _rMax, _gMax, _bMax;
|
||||
bool _bigEndian;
|
||||
|
||||
Common::Array<Color> _colors;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user