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

dreammaster noreply at scummvm.org
Tue Feb 13 04:01:07 UTC 2024


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:
c4ce19126e M4: Finish fixing shadow rendering


Commit: c4ce19126e45360a971dfa2c3aec685786c33702
    https://github.com/scummvm/scummvm/commit/c4ce19126e45360a971dfa2c3aec685786c33702
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2024-02-12T20:00:59-08:00

Commit Message:
M4: Finish fixing shadow rendering

Changed paths:
    engines/m4/graphics/gr_surface.cpp


diff --git a/engines/m4/graphics/gr_surface.cpp b/engines/m4/graphics/gr_surface.cpp
index 5b3484c323f..57ccd03cd2a 100644
--- a/engines/m4/graphics/gr_surface.cpp
+++ b/engines/m4/graphics/gr_surface.cpp
@@ -152,34 +152,32 @@ void M4Surface::drawInner(const Buffer &src, const byte *depthCodes, int x, int
 			if (destX >= 0 && v != 0 && (!depthP || depth == 0 || srcDepth < depth)) {
 				if (inverseColorTable) {
 					// Handling for shadows
-					if (v == 128)
-						continue;
-
-					const byte *palP = palette + *destP * 3;
-					uint rgb = (uint32)palP[0] | ((uint32)palP[1] << 8) |
-						((uint32)palP[2] << 16);
-					rgb >>= 2;
-
-					// Red component
-					adjusted = (rgb & 0xff) * v;
-					adjusted = MIN((uint)(adjusted >> 8), 31U);
-					total = adjusted << 10;
-
-					// Green component
-					rgb >>= 8;
-					adjusted = (rgb & 0xff) * v;
-					adjusted = MIN((uint)(adjusted >> 8), 31U);
-					total |= (adjusted << 5);
-
-					// Blue component
-					rgb >>= 8;
-					adjusted = (rgb & 0xff) * v;
-					adjusted = MIN((uint)(adjusted >> 8), 31U);
-					total |= adjusted;
-
-					// Write out pixel from inverse table
-					*destP = inverseColorTable[total];
-
+					if (v != 128) {
+						const byte *palP = palette + *destP * 3;
+						uint rgb = (uint32)palP[0] | ((uint32)palP[1] << 8) |
+							((uint32)palP[2] << 16);
+						rgb >>= 2;
+
+						// Red component
+						adjusted = (rgb & 0xff) * v;
+						adjusted = MIN((uint)(adjusted >> 8), 31U);
+						total = adjusted << 10;
+
+						// Green component
+						rgb >>= 8;
+						adjusted = (rgb & 0xff) * v;
+						adjusted = MIN((uint)(adjusted >> 8), 31U);
+						total |= (adjusted << 5);
+
+						// Blue component
+						rgb >>= 8;
+						adjusted = (rgb & 0xff) * v;
+						adjusted = MIN((uint)(adjusted >> 8), 31U);
+						total |= adjusted;
+
+						// Write out pixel from inverse table
+						*destP = inverseColorTable[total];
+					}
 				} else {
 					// Normal pixel
 					*destP = v;




More information about the Scummvm-git-logs mailing list