aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/screen_v2.cpp
diff options
context:
space:
mode:
authorathrxx2012-11-11 14:07:58 +0100
committerathrxx2012-11-11 19:14:30 +0100
commit1bb8f22567e71796bba4f98a6ff4353ec84df197 (patch)
tree488d1502c6cd8bede091da6edbb28c10c800ee80 /engines/kyra/screen_v2.cpp
parent9840744acc6e43135ef5e28d041b1d55dd86804b (diff)
downloadscummvm-rg350-1bb8f22567e71796bba4f98a6ff4353ec84df197.tar.gz
scummvm-rg350-1bb8f22567e71796bba4f98a6ff4353ec84df197.tar.bz2
scummvm-rg350-1bb8f22567e71796bba4f98a6ff4353ec84df197.zip
KYRA: finish implementation of new HOF sequence player code
Diffstat (limited to 'engines/kyra/screen_v2.cpp')
-rw-r--r--engines/kyra/screen_v2.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/engines/kyra/screen_v2.cpp b/engines/kyra/screen_v2.cpp
index 11314604e7..407d73a8ec 100644
--- a/engines/kyra/screen_v2.cpp
+++ b/engines/kyra/screen_v2.cpp
@@ -356,6 +356,42 @@ void Screen_v2::copyPageMemory(int srcPage, int srcPos, int dstPage, int dstPos,
memcpy(dst, src, numBytes);
}
+void Screen_v2::copyRegionEx(int srcPage, int srcW, int srcH, int dstPage, int dstX, int dstY, int dstW, int dstH, const ScreenDim *dim, bool flag) {
+ int x0 = dim->sx << 3;
+ int y0 = dim->sy;
+ int w0 = dim->w << 3;
+ int h0 = dim->h;
+
+ int x1 = dstX;
+ int y1 = dstY;
+ int w1 = dstW;
+ int h1 = dstH;
+
+ int x2, y2, w2;
+
+ calcBounds(w0, h0, x1, y1, w1, h1, x2, y2, w2);
+
+ const uint8 *src = getPagePtr(srcPage) + (320 * srcH) + srcW;
+ uint8 *dst = getPagePtr(dstPage) + 320 * (y0 + y1);
+
+ for (int y = 0; y < h1; y++) {
+ const uint8 *s = src + x2;
+ uint8 *d = dst + x0 + x1;
+
+ if (flag)
+ d += (h1 >> 1);
+
+ for (int x = 0; x < w1; x++) {
+ if (*s)
+ *d = *s;
+ s++;
+ d++;
+ }
+ dst += 320;
+ src += 320;
+ }
+}
+
bool Screen_v2::calcBounds(int w0, int h0, int &x1, int &y1, int &w1, int &h1, int &x2, int &y2, int &w2) {
x2 = 0;
y2 = 0;