diff options
author | Kari Salminen | 2008-01-07 18:58:30 +0000 |
---|---|---|
committer | Kari Salminen | 2008-01-07 18:58:30 +0000 |
commit | 2f50a2416ce229e4b4b37327ca6a48966dd7509b (patch) | |
tree | f9a205b9258213c22e7501511c88617f8a2e7df0 /engines | |
parent | e9f3b27c03cdf3047ad531a2dcb9e631d7d66e81 (diff) | |
download | scummvm-rg350-2f50a2416ce229e4b4b37327ca6a48966dd7509b.tar.gz scummvm-rg350-2f50a2416ce229e4b4b37327ca6a48966dd7509b.tar.bz2 scummvm-rg350-2f50a2416ce229e4b4b37327ca6a48966dd7509b.zip |
Reject AGIPAL-files with over 6 bits per color component. Makes at least fanmade AGI game Naturette II's colors not be messed up anymore.
svn-id: r30326
Diffstat (limited to 'engines')
-rw-r--r-- | engines/agi/graphics.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp index 7a7d234ae8..166285b61a 100644 --- a/engines/agi/graphics.cpp +++ b/engines/agi/graphics.cpp @@ -864,6 +864,18 @@ void GfxMgr::setAGIPal(int p0) { return; } + // Check that all components are maximum 6 bits (VGA used 6 bits per color component). + // Make's 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). + 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; + } + } + _agipalFileNum = p0; initPalette(_agipalPalette); |