From d958f509241714f140c95e7afa0005b1fe5c8352 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 24 Mar 2014 22:33:49 -0400 Subject: MADS: Fix incorrect palette for player sprites --- engines/mads/palette.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/engines/mads/palette.cpp b/engines/mads/palette.cpp index 4a62cca5bc..f57766ebf1 100644 --- a/engines/mads/palette.cpp +++ b/engines/mads/palette.cpp @@ -107,10 +107,10 @@ int PaletteUsage::process(Common::Array &palette, uint flags) { bool flag1 = false; if (hasUsage) { - if (varA || !_vm->_palette->_paletteUsage[0]) + if (varA || _vm->_palette->_paletteUsage.empty()) hasUsage = false; - if (varA && _vm->_palette->_paletteUsage[0]) + if (varA && !_vm->_palette->_paletteUsage.empty()) flag1 = true; } @@ -178,10 +178,9 @@ int PaletteUsage::process(Common::Array &palette, uint flags) { } if (!var48 && !varA) { - int var2 = !(palette[palIndex]._flags & 0x20) && ( - ((flags & 0x2000) && !(palette[palIndex]._flags & 0x40)) || - ((flags & 0x1000) && (palCount > 0)) - ) ? 1 : 0x7fff; + int var2 = (palette[palIndex]._flags & 0x20) || + (((flags & 0x2000) || (palette[palIndex]._flags & 0x4000)) && + ((flags & 0x1000) || (palCount == 0))) ? 0x7fff : 1; int var36 = (palette[palIndex]._flags & 0x80) ? 0 : 2; for (int idx = palLow; idx < palIdx; ++idx) { -- cgit v1.2.3