From 5bb3ca5a6b83691628502525d463a788df54a4d1 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Sun, 24 Sep 2017 22:12:47 -0500 Subject: SCI32: Fix bad cursor outlines in RAMA --- engines/sci/graphics/remap32.h | 9 +++++++++ 1 file changed, 9 insertions(+) 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]; } -- cgit v1.2.3