aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Bouclet2016-09-25 10:00:54 +0200
committerBastien Bouclet2016-09-25 10:00:54 +0200
commit9a2fdf96ade19b6b06e5f198dc4d3175130906f1 (patch)
treece6ad70b31ff3ab00dc1d7950e55bb857037a797
parent51bef09e4a541ae4ff0a9cf020b5f663e828187e (diff)
downloadscummvm-rg350-9a2fdf96ade19b6b06e5f198dc4d3175130906f1.tar.gz
scummvm-rg350-9a2fdf96ade19b6b06e5f198dc4d3175130906f1.tar.bz2
scummvm-rg350-9a2fdf96ade19b6b06e5f198dc4d3175130906f1.zip
MOHAWK: Use the color of the first pixel as the transparent cursor color
Fixes #9568
-rw-r--r--engines/mohawk/cursors.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/mohawk/cursors.cpp b/engines/mohawk/cursors.cpp
index 72eebca917..abc1322340 100644
--- a/engines/mohawk/cursors.cpp
+++ b/engines/mohawk/cursors.cpp
@@ -120,7 +120,11 @@ void MystCursorManager::setCursor(uint16 id) {
// Myst ME stores some cursors as 24bpp images instead of 8bpp
if (surface->format.bytesPerPixel == 1) {
- CursorMan.replaceCursor(surface->getPixels(), surface->w, surface->h, hotspotX, hotspotY, 255);
+ // The transparent color is almost always 255, except for the main cursor (100)
+ // in the D'ni archive, where it is 0.
+ // Using the color of the first pixel as the transparent color seems to always work.
+ byte transparentColor = ((byte *)surface->getPixels())[0];
+ CursorMan.replaceCursor(surface->getPixels(), surface->w, surface->h, hotspotX, hotspotY, transparentColor);
// We're using the screen palette for the original game, but we need
// to use this for any 8bpp cursor in ME.