From 6ccf0161276bc21852889a5ce149af56392a380b Mon Sep 17 00:00:00 2001 From: Kari Salminen Date: Wed, 11 Mar 2009 20:04:08 +0000 Subject: 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 --- engines/cine/pal.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/cine/pal.cpp') 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(0, 8 - format.rLoss - 1)) / 8); // R must be inside one byte + assert(format.gShift / 8 == (format.gShift + MAX(0, 8 - format.gLoss - 1)) / 8); // G must be inside one byte + assert(format.bShift / 8 == (format.bShift + MAX(0, 8 - format.bLoss - 1)) / 8); // B must be inside one byte _rBits = (8 - format.rLoss); _gBits = (8 - format.gLoss); -- cgit v1.2.3