[Scummvm-git-logs] scummvm master -> 376df2f14cf1047bacdf25512ce872361aa13d61

athrxx athrxx at scummvm.org
Thu May 6 15:17:23 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:
376df2f14c KYRA: fix bug no. 12514 ("Graphic glitch in Legend of Kyrandia 3")


Commit: 376df2f14cf1047bacdf25512ce872361aa13d61
    https://github.com/scummvm/scummvm/commit/376df2f14cf1047bacdf25512ce872361aa13d61
Author: athrxx (athrxx at scummvm.org)
Date: 2021-05-06T17:16:51+02:00

Commit Message:
KYRA: fix bug no. 12514 ("Graphic glitch in Legend of Kyrandia 3")

(regression from 8f41adc9)

Changed paths:
    engines/kyra/graphics/screen.cpp


diff --git a/engines/kyra/graphics/screen.cpp b/engines/kyra/graphics/screen.cpp
index f299fd3924..08b59dd3cb 100644
--- a/engines/kyra/graphics/screen.cpp
+++ b/engines/kyra/graphics/screen.cpp
@@ -1035,6 +1035,7 @@ void Screen::copyRegionToBuffer(int pageNum, int x, int y, int w, int h, uint8 *
 		h = _screenHeight - y;
 	}
 
+	int pitch = w;
 	if (x < 0) {
 		dest += -x * _bytesPerPixel;
 		w += x;
@@ -1049,7 +1050,7 @@ void Screen::copyRegionToBuffer(int pageNum, int x, int y, int w, int h, uint8 *
 	uint8 *pagePtr = getPagePtr(pageNum);
 
 	for (int i = y; i < y + h; ++i)
-		memcpy(dest + (i - y) * w * _bytesPerPixel, pagePtr + i * SCREEN_W * _bytesPerPixel + x * _bytesPerPixel, w * _bytesPerPixel);
+		memcpy(dest + (i - y) * pitch * _bytesPerPixel, pagePtr + i * SCREEN_W * _bytesPerPixel + x * _bytesPerPixel, w * _bytesPerPixel);
 }
 
 void Screen::copyPage(uint8 srcPage, uint8 dstPage) {




More information about the Scummvm-git-logs mailing list