Prefix Cine's endian types with CINE_ so they don't clash with already defined LITTLE_ENDIAN and/or BIG_ENDIAN on some platforms.

svn-id: r39453
This commit is contained in:
Kari Salminen 2009-03-16 20:57:17 +00:00
parent 739a31db12
commit 9dc2f16f16
2 changed files with 11 additions and 8 deletions

View file

@ -171,11 +171,11 @@ byte shiftByteLeft(const byte value, const signed shiftLeft) {
/*! \brief Is given endian type big endian? (Handles native endian type too, otherwise this would be trivial). */
bool isBigEndian(const EndianType endianType) {
assert(endianType == NATIVE_ENDIAN || endianType == LITTLE_ENDIAN || endianType == BIG_ENDIAN);
assert(endianType == CINE_NATIVE_ENDIAN || endianType == CINE_LITTLE_ENDIAN || endianType == CINE_BIG_ENDIAN);
// Handle explicit little and big endian types here
if (endianType != NATIVE_ENDIAN) {
return (endianType == BIG_ENDIAN);
if (endianType != CINE_NATIVE_ENDIAN) {
return (endianType == CINE_BIG_ENDIAN);
}
// Handle native endian type here
@ -212,7 +212,7 @@ uint Palette::colorCount() const {
}
const EndianType Palette::endianType() const {
return (_bigEndian ? BIG_ENDIAN : LITTLE_ENDIAN);
return (_bigEndian ? CINE_BIG_ENDIAN : CINE_LITTLE_ENDIAN);
}
Graphics::PixelFormat Palette::colorFormat() const {

View file

@ -41,11 +41,14 @@ static const Graphics::PixelFormat kSystemPalFormat = {4, 0, 0, 0, 8, 0, 8, 16,
/*! \brief Endian types. Used at least by Palette class's load and save functions.
* TODO: Move somewhere more general as this is definitely not Cine-engine specific
*
* NOTE: It seems LITTLE_ENDIAN and/or BIG_ENDIAN were defined already on some platforms so
* therefore renamed the enumerations to something not clashing by giving them "CINE_"-prefixes.
*/
enum EndianType {
NATIVE_ENDIAN,
LITTLE_ENDIAN,
BIG_ENDIAN
CINE_NATIVE_ENDIAN,
CINE_LITTLE_ENDIAN,
CINE_BIG_ENDIAN
};
struct PalEntry {
@ -111,7 +114,7 @@ public:
uint colorCount() const;
/*! \brief The original endian type in which this palette was loaded.
* \note This will always return either BIG_ENDIAN or LITTLE_ENDIAN (So no NATIVE_ENDIAN).
* \note This will always return either CINE_BIG_ENDIAN or CINE_LITTLE_ENDIAN (So no CINE_NATIVE_ENDIAN).
*/
const EndianType endianType() const;