KYRA: - fix copyBlockToPage() glitch

(fix for negative out-of-bounds x offsets - apparently never used like that before)
This commit is contained in:
athrxx
2020-07-30 22:19:13 +02:00
parent 9d8c249015
commit 8f41adc969
+2 -1
View File
@@ -1074,6 +1074,7 @@ void Screen::copyBlockToPage(int pageNum, int x, int y, int w, int h, const uint
h = _screenHeight - y;
}
int pitch = w;
if (x < 0) {
src += -x * _bytesPerPixel;
w += x;
@@ -1095,7 +1096,7 @@ void Screen::copyBlockToPage(int pageNum, int x, int y, int w, int h, const uint
while (h--) {
memcpy(dst, src, w * _bytesPerPixel);
dst += SCREEN_W * _bytesPerPixel;
src += w * _bytesPerPixel;
src += pitch * _bytesPerPixel;
}
}