aboutsummaryrefslogtreecommitdiff
path: root/engines/prince
diff options
context:
space:
mode:
authorlukaslw2014-07-24 18:59:26 +0200
committerlukaslw2014-07-24 18:59:26 +0200
commit1f88852de548a02e42c9fc8a546fc377117f87ae (patch)
tree45ae533b80c3d5f0be91421484c0341be198025f /engines/prince
parent9c9da0d65a413ad1992bf066b9df922d4b93013f (diff)
downloadscummvm-rg350-1f88852de548a02e42c9fc8a546fc377117f87ae.tar.gz
scummvm-rg350-1f88852de548a02e42c9fc8a546fc377117f87ae.tar.bz2
scummvm-rg350-1f88852de548a02e42c9fc8a546fc377117f87ae.zip
PRINCE: blackPalette(), setPalette() update - allow game quit
Diffstat (limited to 'engines/prince')
-rw-r--r--engines/prince/object.cpp2
-rw-r--r--engines/prince/prince.cpp16
2 files changed, 17 insertions, 1 deletions
diff --git a/engines/prince/object.cpp b/engines/prince/object.cpp
index e4dece4426..c8cdc75083 100644
--- a/engines/prince/object.cpp
+++ b/engines/prince/object.cpp
@@ -43,7 +43,7 @@ Object::~Object() {
delete _surface;
_surface = nullptr;
}
- if (_zoomSurface) {
+ if (_zoomSurface != nullptr) {
_zoomSurface->free();
delete _zoomSurface;
_zoomSurface = nullptr;
diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp
index 31702484d8..90629801e9 100644
--- a/engines/prince/prince.cpp
+++ b/engines/prince/prince.cpp
@@ -1779,6 +1779,14 @@ void PrinceEngine::blackPalette() {
fadeStep--;
_graph->setPalette(blackPalette);
_system->updateScreen();
+ Common::Event event;
+ Common::EventManager *eventMan = _system->getEventManager();
+ eventMan->pollEvent(event);
+ if (shouldQuit()) {
+ free(paletteBackup);
+ free(blackPalette);
+ return;
+ }
pause();
}
free(paletteBackup);
@@ -1800,6 +1808,14 @@ void PrinceEngine::setPalette() {
fadeStep++;
_graph->setPalette(blackPalette);
_system->updateScreen();
+ Common::Event event;
+ Common::EventManager *eventMan = _system->getEventManager();
+ eventMan->pollEvent(event);
+ if (shouldQuit()) {
+ _graph->setPalette(paletteBackup);
+ free(blackPalette);
+ return;
+ }
pause();
}
_graph->setPalette(paletteBackup);