diff options
-rw-r--r-- | engines/sci/graphics/remap32.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/engines/sci/graphics/remap32.h b/engines/sci/graphics/remap32.h index 1b9628c7be..407e879e7c 100644 --- a/engines/sci/graphics/remap32.h +++ b/engines/sci/graphics/remap32.h @@ -345,6 +345,15 @@ public: assert(index < _remaps.size()); const SingleRemap &singleRemap = _remaps[index]; assert(singleRemap._type != kRemapNone); + // SSCI never really properly handled attempts to draw to a target with + // pixels above the remap color maximum. In RAMA, the cursor views have + // a remap color outlining the cursor, and so get drawn into a target + // surface filled with a skip color of 255. In SSCI, this causes the + // remapped color to be read from some statically allocated, never + // written memory and so always ends up being 0 (black). + if (targetColor >= ARRAYSIZE(singleRemap._remapColors)) { + return 0; + } return singleRemap._remapColors[targetColor]; } |