[Scummvm-git-logs] scummvm master -> a92582ef0e5015f25c85f9a1d6ba96ba737328dd

sluicebox 22204938+sluicebox at users.noreply.github.com
Sat May 1 21:31:50 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a92582ef0e SCI32: Translate Mac colors when drawing CelObjColor


Commit: a92582ef0e5015f25c85f9a1d6ba96ba737328dd
    https://github.com/scummvm/scummvm/commit/a92582ef0e5015f25c85f9a1d6ba96ba737328dd
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2021-05-01T14:29:18-07:00

Commit Message:
SCI32: Translate Mac colors when drawing CelObjColor

Fixes several kSetShowStyle transitions such as the iris effect
in LSL6 Hi-res Mac at the end of the beach scene at night (room 860)

Changed paths:
    engines/sci/graphics/celobj32.cpp
    engines/sci/graphics/celobj32.h
    engines/sci/graphics/palette32.cpp
    engines/sci/graphics/palette32.h
    engines/sci/graphics/transitions32.cpp


diff --git a/engines/sci/graphics/celobj32.cpp b/engines/sci/graphics/celobj32.cpp
index b222c12209..ba6653a48e 100644
--- a/engines/sci/graphics/celobj32.cpp
+++ b/engines/sci/graphics/celobj32.cpp
@@ -1343,7 +1343,7 @@ CelObjColor::CelObjColor(const uint8 color, const int16 width, const int16 heigh
 	_yResolution = g_sci->_gfxFrameout->getScriptHeight();
 	_hunkPaletteOffset = 0;
 	_mirrorX = false;
-	_isMacSource = false;
+	_isMacSource = (g_sci->getPlatform() == Common::kPlatformMacintosh);
 	_remap = false;
 	_width = width;
 	_height = height;
@@ -1359,7 +1359,7 @@ void CelObjColor::draw(Buffer &target, const Common::Rect &targetRect, const Com
 	error("Unsupported method");
 }
 void CelObjColor::draw(Buffer &target, const Common::Rect &targetRect) const {
-	target.fillRect(targetRect, _info.color);
+	target.fillRect(targetRect, translateMacColor(_isMacSource, _info.color));
 }
 
 CelObjColor *CelObjColor::duplicate() const {
diff --git a/engines/sci/graphics/celobj32.h b/engines/sci/graphics/celobj32.h
index 1c65b9c703..fe0e6bd8ea 100644
--- a/engines/sci/graphics/celobj32.h
+++ b/engines/sci/graphics/celobj32.h
@@ -337,7 +337,7 @@ public:
 	bool _mirrorX;
 
 	/**
-	 * If true, the source for this cel is a Mac pic or view whose pixels for
+	 * If true, the source for this cel is a Mac pic or view or color whose pixels for
 	 * entries 0 and 255 must be swapped when drawing since we use the PC palette.
 	 */
 	bool _isMacSource;
diff --git a/engines/sci/graphics/palette32.cpp b/engines/sci/graphics/palette32.cpp
index e66f979105..cdd68a73a5 100644
--- a/engines/sci/graphics/palette32.cpp
+++ b/engines/sci/graphics/palette32.cpp
@@ -438,6 +438,14 @@ int16 GfxPalette32::matchColor(const uint8 r, const uint8 g, const uint8 b) {
 	return bestIndex;
 }
 
+uint8 GfxPalette32::getPlatformBlack() const {
+	return (g_sci->getPlatform() == Common::kPlatformMacintosh) ? 255 : 0;
+}
+
+uint8 GfxPalette32::getPlatformWhite() const {
+	return (g_sci->getPlatform() == Common::kPlatformMacintosh) ? 0 : 255;
+}
+
 void GfxPalette32::submit(const Palette &palette) {
 	// If `_needsUpdate` is already set, there is no need to test whether
 	// this palette submission causes a change to `_sourcePalette` since it is
diff --git a/engines/sci/graphics/palette32.h b/engines/sci/graphics/palette32.h
index 2d00b86501..ed6a3eabb1 100644
--- a/engines/sci/graphics/palette32.h
+++ b/engines/sci/graphics/palette32.h
@@ -267,6 +267,16 @@ public:
 	 */
 	int16 matchColor(const uint8 r, const uint8 g, const uint8 b);
 
+	/**
+	 * Gets the palette index for black based on the platform
+	 */
+	uint8 getPlatformBlack() const;
+
+	/**
+	 * Gets the palette index for white based on the platform
+	 */
+	uint8 getPlatformWhite() const;
+
 	/**
 	 * Submits a palette to display. Entries marked as "used" in the submitted
 	 * palette are merged into `_sourcePalette`.
diff --git a/engines/sci/graphics/transitions32.cpp b/engines/sci/graphics/transitions32.cpp
index 0e00ab5ef3..fd75cc426e 100644
--- a/engines/sci/graphics/transitions32.cpp
+++ b/engines/sci/graphics/transitions32.cpp
@@ -207,7 +207,7 @@ void GfxTransitions32::kernelSetShowStyle(const uint16 argc, const reg_t planeOb
 		color = back;
 	} else {
 		isFadeUp = true;
-		color = 0;
+		color = g_sci->_gfxPalette32->getPlatformBlack();
 	}
 
 	Plane *plane = g_sci->_gfxFrameout->getPlanes().findByObject(planeObj);




More information about the Scummvm-git-logs mailing list