diff options
-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); |