diff options
author | Kari Salminen | 2009-03-11 20:04:08 +0000 |
---|---|---|
committer | Kari Salminen | 2009-03-11 20:04:08 +0000 |
commit | 6ccf0161276bc21852889a5ce149af56392a380b (patch) | |
tree | 4eb0b0e9fdce58b5f67471010f85d9229c2eb320 /engines | |
parent | 3e7fe64a2248d95bccc937aef8aced0a80e984c7 (diff) | |
download | scummvm-rg350-6ccf0161276bc21852889a5ce149af56392a380b.tar.gz scummvm-rg350-6ccf0161276bc21852889a5ce149af56392a380b.tar.bz2 scummvm-rg350-6ccf0161276bc21852889a5ce149af56392a380b.zip |
Fix assertions in palette loading function to really test that each color component fits inside a single byte (Easier to parse that way).
svn-id: r39333
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cine/pal.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/cine/pal.cpp b/engines/cine/pal.cpp index 55f9576590..b2cb9b3451 100644 --- a/engines/cine/pal.cpp +++ b/engines/cine/pal.cpp @@ -207,9 +207,9 @@ Palette &Palette::loadCineHighPal(const byte *colors, const uint numColors) { Palette &Palette::load(const byte *colors, const Graphics::PixelFormat format, const uint numColors) { assert(format.aLoss == 8); // No alpha - assert(format.rShift % 8 == ((format.rShift + (8 - format.rLoss - 1)) % 8)); // R must be inside one byte - assert(format.gShift % 8 == ((format.gShift + (8 - format.gLoss - 1)) % 8)); // G must be inside one byte - assert(format.bShift % 8 == ((format.bShift + (8 - format.bLoss - 1)) % 8)); // B must be inside one byte + assert(format.rShift / 8 == (format.rShift + MAX<int>(0, 8 - format.rLoss - 1)) / 8); // R must be inside one byte + 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 _rBits = (8 - format.rLoss); _gBits = (8 - format.gLoss); |