[Scummvm-git-logs] scummvm master -> 94f6298eeceb0536d359cbdb6d40015f944f0018

sev- noreply at scummvm.org
Fri Feb 9 20:07:59 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:
94f6298eec SCUMM: MOONBASE: Partial fix for distortion effect


Commit: 94f6298eeceb0536d359cbdb6d40015f944f0018
    https://github.com/scummvm/scummvm/commit/94f6298eeceb0536d359cbdb6d40015f944f0018
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-02-09T21:07:40+01:00

Commit Message:
SCUMM: MOONBASE: Partial fix for distortion effect

Now, the pitch is computed correctly, still, the displacement
is too big and looks inverted.

Changed paths:
    engines/scumm/he/moonbase/distortion.cpp


diff --git a/engines/scumm/he/moonbase/distortion.cpp b/engines/scumm/he/moonbase/distortion.cpp
index 367457dde97..8c0d1e997d0 100644
--- a/engines/scumm/he/moonbase/distortion.cpp
+++ b/engines/scumm/he/moonbase/distortion.cpp
@@ -68,8 +68,6 @@ static void blitDistortionCore(
 	int dy = dstRect.top;
 
 	int baseX, baseY;
-	const byte *srcData = (const byte *)srcBitmap->getBasePtr(0, 0);
-	int srcPitch = srcBitmap->pitch;
 
 	switch (transferOp) {
 	case kReflectionClipped:
@@ -90,7 +88,8 @@ static void blitDistortionCore(
 		int dx = idx;
 
 		for (int i = cw; --i >= 0;) {
-			uint16 p = READ_LE_UINT16(is);
+			uint16 p = READ_BE_UINT16(is);
+
 			int sx = baseX + dx + ((p >> 5) & 0x1f); // G color
 			int sy = baseY + dy + (p & 0x1f);        // B color;
 
@@ -112,7 +111,7 @@ static void blitDistortionCore(
 				sy = MAX<int>(srcClipRect->top, MIN<int>(sy, srcClipRect->bottom));
 			}
 
-			*d = *((const uint16 *)(srcData + sy * srcPitch + sx * 2));
+			*d = *((const uint16 *)srcBitmap->getBasePtr(sx, sy));
 
 			++d;
 			++is;
@@ -170,7 +169,7 @@ void Moonbase::blitDistortion(byte *bufferData, const int bufferWidth, const int
 		int r_reach = READ_LE_UINT16(blockData); blockData += 2;
 		int t_reach = READ_LE_UINT16(blockData); blockData += 2;
 		int b_reach = READ_LE_UINT16(blockData); blockData += 2;
-		int distortionPitch = ((width * 2 + 7) / 8); // 2 for 555
+		int distortionPitch = width * 2; // 2 for 555
 
 		if (width == 0 && height == 0)
 			continue;




More information about the Scummvm-git-logs mailing list