aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2016-09-18 21:12:46 -0400
committerPaul Gilbert2016-09-18 21:12:46 -0400
commit96b5fc817cff0b237e179ec3017aa6fd06a284e2 (patch)
treeb6bbb58be482419e7f643dca3b1b9b40bc1131e9
parent78132c5138c5a989add6afae75ee63bf0fc2ed8a (diff)
downloadscummvm-rg350-96b5fc817cff0b237e179ec3017aa6fd06a284e2.tar.gz
scummvm-rg350-96b5fc817cff0b237e179ec3017aa6fd06a284e2.tar.bz2
scummvm-rg350-96b5fc817cff0b237e179ec3017aa6fd06a284e2.zip
XEEN: Fix merging graphic pages to screen
-rw-r--r--engines/xeen/events.cpp2
-rw-r--r--engines/xeen/screen.cpp13
-rw-r--r--engines/xeen/worldofxeen/darkside_cutscenes.cpp6
3 files changed, 13 insertions, 8 deletions
diff --git a/engines/xeen/events.cpp b/engines/xeen/events.cpp
index e50d689d9f..f89164903c 100644
--- a/engines/xeen/events.cpp
+++ b/engines/xeen/events.cpp
@@ -150,7 +150,7 @@ bool EventsManager::wait(uint numFrames, bool interruptable) {
return true;
}
- return false;
+ return _vm->shouldQuit();
}
void EventsManager::ipause(uint amount) {
diff --git a/engines/xeen/screen.cpp b/engines/xeen/screen.cpp
index 59978cf3d5..bcd298d118 100644
--- a/engines/xeen/screen.cpp
+++ b/engines/xeen/screen.cpp
@@ -369,14 +369,17 @@ void Screen::horizMerge(int xp) {
for (int y = 0; y < SCREEN_HEIGHT; ++y) {
byte *destP = (byte *)getBasePtr(0, y);
- const byte *srcP = (const byte *)_pages[0].getBasePtr(0, y);
+ const byte *srcP = (const byte *)_pages[0].getBasePtr(xp, y);
Common::copy(srcP, srcP + SCREEN_WIDTH - xp, destP);
if (xp != 0) {
+ destP = (byte *)getBasePtr(SCREEN_WIDTH - xp, y);
srcP = (const byte *)_pages[1].getBasePtr(0, y);
- Common::copy(srcP + SCREEN_WIDTH - xp, srcP + SCREEN_WIDTH, destP + SCREEN_WIDTH - xp);
+ Common::copy(srcP, srcP + xp, destP);
}
}
+
+ markAllDirty();
}
void Screen::vertMerge(int yp) {
@@ -389,11 +392,13 @@ void Screen::vertMerge(int yp) {
Common::copy(srcP, srcP + SCREEN_WIDTH, destP);
}
- for (int y = SCREEN_HEIGHT - yp; y < SCREEN_HEIGHT; ++y) {
+ for (int y = 0; y < (SCREEN_HEIGHT - yp); ++y) {
const byte *srcP = (const byte *)_pages[1].getBasePtr(0, y);
- byte *destP = (byte *)getBasePtr(0, y);
+ byte *destP = (byte *)getBasePtr(0, SCREEN_HEIGHT - yp + y);
Common::copy(srcP, srcP + SCREEN_WIDTH, destP);
}
+
+ markAllDirty();
}
void Screen::draw(void *data) {
diff --git a/engines/xeen/worldofxeen/darkside_cutscenes.cpp b/engines/xeen/worldofxeen/darkside_cutscenes.cpp
index f845a6271f..99f634671a 100644
--- a/engines/xeen/worldofxeen/darkside_cutscenes.cpp
+++ b/engines/xeen/worldofxeen/darkside_cutscenes.cpp
@@ -351,7 +351,8 @@ bool DarkSideCutscenes::showDarkSideEnding() {
if (!(xp % 22))
sound.playSound(whoosh);
- events.wait(1);
+ if (events.wait(1))
+ return false;
if (++ctr % 2)
frameNum = (frameNum + 1) % 10;
@@ -361,11 +362,10 @@ bool DarkSideCutscenes::showDarkSideEnding() {
else if (xp > 150)
++yp;
}
-
- // Play landing thud
if (events.wait(10))
return false;
+ // Play landing thud
sound.playSound("thud.voc");
while (!_vm->shouldQuit() && !events.isKeyMousePressed()
&& sound.isPlaying()) {