aboutsummaryrefslogtreecommitdiff
path: root/kyra/screen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kyra/screen.cpp')
-rw-r--r--kyra/screen.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/kyra/screen.cpp b/kyra/screen.cpp
index c95ce3bfeb..f99786211b 100644
--- a/kyra/screen.cpp
+++ b/kyra/screen.cpp
@@ -1404,7 +1404,11 @@ void Screen::copyScreenFromRect(int x, int y, int w, int h, uint8 *ptr) {
x <<= 3; w <<= 3;
uint8 *src = ptr;
uint8 *dst = &_pagePtrs[0][y * SCREEN_W + x];
- memcpy(dst, src, w);
+ for (int i = 0; i < h; ++i) {
+ memcpy(dst, src, w);
+ src += w;
+ dst += SCREEN_W;
+ }
}
void Screen::copyScreenToRect(int x, int y, int w, int h, uint8 *ptr) {
@@ -1412,7 +1416,11 @@ void Screen::copyScreenToRect(int x, int y, int w, int h, uint8 *ptr) {
x <<= 3; w <<= 3;
uint8 *src = &_pagePtrs[0][y * SCREEN_W + x];
uint8 *dst = ptr;
- memcpy(dst, src, w);
+ for (int i = 0; i < h; ++i) {
+ memcpy(dst, src, w);
+ dst += w;
+ src += SCREEN_W;
+ }
}
} // End of namespace Kyra