aboutsummaryrefslogtreecommitdiff
path: root/engines/griffon
diff options
context:
space:
mode:
authorEugene Sandulenko2019-11-06 17:47:37 +0100
committerEugene Sandulenko2019-11-13 22:07:08 +0100
commit6409c3804eedf44ca5b6109d9e728c853b148fe4 (patch)
tree56b20d7c3e2c8cef6b69b77db6188d0ff67195a8 /engines/griffon
parent7b05a02a97b4614b0f8eac9ff056dc9cb1045f86 (diff)
downloadscummvm-rg350-6409c3804eedf44ca5b6109d9e728c853b148fe4.tar.gz
scummvm-rg350-6409c3804eedf44ca5b6109d9e728c853b148fe4.tar.bz2
scummvm-rg350-6409c3804eedf44ca5b6109d9e728c853b148fe4.zip
GRIFFON: Implement quitting from the endgame
Diffstat (limited to 'engines/griffon')
-rw-r--r--engines/griffon/cutscenes.cpp46
1 files changed, 35 insertions, 11 deletions
diff --git a/engines/griffon/cutscenes.cpp b/engines/griffon/cutscenes.cpp
index f615db4df2..b96e469d1a 100644
--- a/engines/griffon/cutscenes.cpp
+++ b/engines/griffon/cutscenes.cpp
@@ -283,9 +283,7 @@ void GriffonEngine::endOfGame() {
int ticks1 = _ticks;
int ya = 0;
- _videoBuffer2->fillRect(Common::Rect(0, 0, _videoBuffer2->w, _videoBuffer2->h), 0);
- _videoBuffer3->fillRect(Common::Rect(0, 0, _videoBuffer3->w, _videoBuffer3->h), 0);
- _videoBuffer2->copyRectToSurface(_videoBuffer->getPixels(), _videoBuffer->pitch, 0, 0, _videoBuffer->w, _videoBuffer->h);
+ _videoBuffer->copyRectToSurface(_videoBuffer2->getPixels(), _videoBuffer2->pitch, 0, 0, _videoBuffer2->w, _videoBuffer2->h);
float ld = 0;
bool ldstop = false; // CHECKME: Check if actually used
@@ -308,15 +306,19 @@ void GriffonEngine::endOfGame() {
break;
_videoBuffer->fillRect(Common::Rect(0, 0, _videoBuffer->w, _videoBuffer->h), 0);
+ _videoBuffer2->setAlpha(ya);
+ _videoBuffer2->blit(*_videoBuffer);
- _videoBuffer->setAlpha(ya);
- _videoBuffer3->copyRectToSurface(_videoBuffer2->getPixels(), _videoBuffer2->pitch, 0, 0, _videoBuffer2->w, _videoBuffer2->h);
- _videoBuffer3->copyRectToSurface(_videoBuffer->getPixels(), _videoBuffer->pitch, 0, 0, _videoBuffer->w, _videoBuffer->h);
+ g_system->copyRectToScreen(_videoBuffer->getPixels(), _videoBuffer->pitch, 0, 0, _videoBuffer->w, _videoBuffer->h);
- g_system->copyRectToScreen(_videoBuffer3->getPixels(), _videoBuffer3->pitch, 0, 0, _videoBuffer3->w, _videoBuffer3->h);
- g_system->updateScreen();
+ if (g_system->getEventManager()->pollEvent(_event)) {
+ if (_event.type == Common::EVENT_QUIT) {
+ _shouldQuit = true;
+ return;
+ }
+ }
- g_system->getEventManager()->pollEvent(_event);
+ g_system->updateScreen();
g_system->delayMillis(10);
_ticksPassed = _ticks;
@@ -399,6 +401,11 @@ void GriffonEngine::endOfGame() {
if (_event.kbd.keycode == Common::KEYCODE_ESCAPE)
break;
+
+ if (_event.type == Common::EVENT_QUIT) {
+ _shouldQuit = true;
+ return;
+ }
}
g_system->updateScreen();
@@ -427,7 +434,13 @@ void GriffonEngine::endOfGame() {
g_system->copyRectToScreen(_videoBuffer3->getPixels(), _videoBuffer3->pitch, 0, 0, _videoBuffer3->w, _videoBuffer3->h);
g_system->updateScreen();
- g_system->getEventManager()->pollEvent(_event);
+ if (g_system->getEventManager()->pollEvent(_event)) {
+ if (_event.type == Common::EVENT_QUIT) {
+ _shouldQuit = true;
+ return;
+ }
+ }
+
g_system->delayMillis(10);
_ticksPassed = _ticks;
@@ -480,6 +493,11 @@ void GriffonEngine::endOfGame() {
}
if (g_system->getEventManager()->pollEvent(_event)) {
+ if (_event.type == Common::EVENT_QUIT) {
+ _shouldQuit = true;
+ return;
+ }
+
if (_event.type == Common::EVENT_KEYDOWN && keywait < _ticks)
break;
}
@@ -504,7 +522,13 @@ void GriffonEngine::theEnd() {
g_system->copyRectToScreen(_videoBuffer->getPixels(), _videoBuffer->pitch, 0, 0, _videoBuffer->w, _videoBuffer->h);
g_system->updateScreen();
- g_system->getEventManager()->pollEvent(_event);
+ if (g_system->getEventManager()->pollEvent(_event)) {
+ if (_event.type == Common::EVENT_QUIT) {
+ _shouldQuit = true;
+ return;
+ }
+ }
+
g_system->delayMillis(10);
_ticksPassed = _ticks;