aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Snover2017-09-24 22:12:47 -0500
committerColin Snover2017-09-24 22:56:58 -0500
commit5bb3ca5a6b83691628502525d463a788df54a4d1 (patch)
tree18b8685990192ea169e0399e1a50c6009d80f338
parent76806732e032771d51d9015720d32eeed874a3cd (diff)
downloadscummvm-rg350-5bb3ca5a6b83691628502525d463a788df54a4d1.tar.gz
scummvm-rg350-5bb3ca5a6b83691628502525d463a788df54a4d1.tar.bz2
scummvm-rg350-5bb3ca5a6b83691628502525d463a788df54a4d1.zip
SCI32: Fix bad cursor outlines in RAMA
-rw-r--r--engines/sci/graphics/remap32.h9
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];
}