aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorKari Salminen2008-01-30 01:58:43 +0000
committerKari Salminen2008-01-30 01:58:43 +0000
commitd92dbac6726d1beb8a9986021e702f76cd6aff8e (patch)
tree3991a7685f5c19847617481176d1f4764b814099 /engines
parentfe5277794372e7d89c2fce41ff8a6f06880e37d3 (diff)
downloadscummvm-rg350-d92dbac6726d1beb8a9986021e702f76cd6aff8e.tar.gz
scummvm-rg350-d92dbac6726d1beb8a9986021e702f76cd6aff8e.tar.bz2
scummvm-rg350-d92dbac6726d1beb8a9986021e702f76cd6aff8e.zip
Fix for bug #1881170 (AGI: palette-related glitches reported). Made AGIPAL use only the lowest 6 bits of each color component (This should be the way the original AGIPAL-hack behaves too).
svn-id: r30708
Diffstat (limited to 'engines')
-rw-r--r--engines/agi/graphics.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp
index 3cef23bfa1..a4554919de 100644
--- a/engines/agi/graphics.cpp
+++ b/engines/agi/graphics.cpp
@@ -864,18 +864,20 @@ void GfxMgr::setAGIPal(int p0) {
return;
}
- // Check that all components are maximum 6 bits (VGA used 6 bits per color component).
- // Makes at least Naturette 2's colors not be messed up anymore (Naturette 2 provides
- // AGIPAL-files that use 8 bits per color component. Haven't seen any other game that
- // provides such files and don't know of *any* AGI interpreter that supports such files.
- // So I presume they have been left over to Naturette 2's release file by accident).
+ // Use only the lowest 6 bits of each color component (Red, Green and Blue)
+ // because VGA used only 6 bits per color component (i.e. VGA had 18-bit colors).
+ // This should now be identical to the original AGIPAL-hack's behaviour.
+ bool validVgaPalette = true;
for (int i = 0; i < 16 * 3; i++) {
if (_agipalPalette[i] >= (1 << 6)) {
- warning("Invalid AGIPAL palette (Over 6 bits per color component) in '%s'. Not changing palette", filename);
- return;
+ _agipalPalette[i] &= 0x3F; // Leave only the lowest 6 bits of each color component
+ validVgaPalette = false;
}
}
+ if (!validVgaPalette)
+ warning("Invalid AGIPAL palette (Over 6 bits per color component) in '%s'. Using only the lowest 6 bits per color component", filename);
+
_agipalFileNum = p0;
initPalette(_agipalPalette);