From 9a2fdf96ade19b6b06e5f198dc4d3175130906f1 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sun, 25 Sep 2016 10:00:54 +0200 Subject: MOHAWK: Use the color of the first pixel as the transparent cursor color Fixes #9568 --- engines/mohawk/cursors.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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. -- cgit v1.2.3