aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2008-03-30 03:18:16 +0000
committerJohannes Schickel2008-03-30 03:18:16 +0000
commitb7a3dfd9df028dceaf4982e016c48f9be09833b6 (patch)
tree20e836ed0a854da934f89da7b633d4b2e6db9056 /engines
parent91e30d8e50d90928e71856f5b79ef2034714d02d (diff)
downloadscummvm-rg350-b7a3dfd9df028dceaf4982e016c48f9be09833b6.tar.gz
scummvm-rg350-b7a3dfd9df028dceaf4982e016c48f9be09833b6.tar.bz2
scummvm-rg350-b7a3dfd9df028dceaf4982e016c48f9be09833b6.zip
Always clip rect to copy in Screen::copyRegion now, like the original does.
This fixes bug #1537373 "KYRA1: Crash when meeting Zanthia". svn-id: r31318
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/animator_v1.cpp2
-rw-r--r--engines/kyra/animator_v2.cpp2
-rw-r--r--engines/kyra/screen.cpp44
-rw-r--r--engines/kyra/screen.h3
4 files changed, 24 insertions, 27 deletions
diff --git a/engines/kyra/animator_v1.cpp b/engines/kyra/animator_v1.cpp
index 6973176df8..69dc473d32 100644
--- a/engines/kyra/animator_v1.cpp
+++ b/engines/kyra/animator_v1.cpp
@@ -391,7 +391,7 @@ void ScreenAnimator::copyChangedObjectsForward(int refreshFlag) {
if (ypos + height > 136)
height = 136 - ypos;
- _screen->copyRegion(xpos << 3, ypos, xpos << 3, ypos, width << 3, height, 2, 0, Screen::CR_CLIPPED);
+ _screen->copyRegion(xpos << 3, ypos, xpos << 3, ypos, width << 3, height, 2, 0);
curObject->refreshFlag = 0;
_updateScreen = true;
}
diff --git a/engines/kyra/animator_v2.cpp b/engines/kyra/animator_v2.cpp
index 2ebc719d42..ff215ad4ce 100644
--- a/engines/kyra/animator_v2.cpp
+++ b/engines/kyra/animator_v2.cpp
@@ -188,7 +188,7 @@ void KyraEngine_v2::refreshAnimObjects(int force) {
height -= height + y - 144;
_screen->hideMouse();
- _screen->copyRegion(x, y, x, y, width, height, 2, 0, Screen::CR_CLIPPED | Screen::CR_NO_P_CHECK);
+ _screen->copyRegion(x, y, x, y, width, height, 2, 0, Screen::CR_NO_P_CHECK);
_screen->showMouse();
curObject->needRefresh = false;
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index ac212b5026..783d66fc05 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -515,30 +515,28 @@ void Screen::copyToPage0(int y, int h, uint8 page, uint8 *seqBuf) {
void Screen::copyRegion(int x1, int y1, int x2, int y2, int w, int h, int srcPage, int dstPage, int flags) {
debugC(9, kDebugLevelScreen, "Screen::copyRegion(%d, %d, %d, %d, %d, %d, %d, %d, %d)", x1, y1, x2, y2, w, h, srcPage, dstPage, flags);
- if (flags & CR_CLIPPED) {
- if (x2 < 0) {
- if (x2 <= -w)
- return;
- w += x2;
- x1 -= x2;
- x2 = 0;
- } else if (x2 + w >= SCREEN_W) {
- if (x2 > SCREEN_W)
- return;
- w = SCREEN_W - x2;
- }
+ if (x2 < 0) {
+ if (x2 <= -w)
+ return;
+ w += x2;
+ x1 -= x2;
+ x2 = 0;
+ } else if (x2 + w >= SCREEN_W) {
+ if (x2 > SCREEN_W)
+ return;
+ w = SCREEN_W - x2;
+ }
- if (y2 < 0) {
- if (y2 <= -h )
- return;
- h += y2;
- y1 -= y2;
- y2 = 0;
- } else if (y2 + h >= SCREEN_H) {
- if (y2 > SCREEN_H)
- return;
- h = SCREEN_H - y2;
- }
+ if (y2 < 0) {
+ if (y2 <= -h )
+ return;
+ h += y2;
+ y1 -= y2;
+ y2 = 0;
+ } else if (y2 + h >= SCREEN_H) {
+ if (y2 > SCREEN_H)
+ return;
+ h = SCREEN_H - y2;
}
assert(x1 + w <= SCREEN_W && y1 + h <= SCREEN_H);
diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h
index eb4e495596..add8473eff 100644
--- a/engines/kyra/screen.h
+++ b/engines/kyra/screen.h
@@ -74,8 +74,7 @@ public:
enum CopyRegionFlags {
CR_X_FLIPPED = 0x01,
- CR_CLIPPED = 0x02,
- CR_NO_P_CHECK = 0x04
+ CR_NO_P_CHECK = 0x02
};
enum DrawShapeFlags {