Skip to content

Commit

Permalink
PRINCE: blackPalette(), setPalette() update - allow game quit
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaslw committed Jul 24, 2014
1 parent 9c9da0d commit 1f88852
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion engines/prince/object.cpp
Expand Up @@ -43,7 +43,7 @@ Object::~Object() {
delete _surface;
_surface = nullptr;
}
if (_zoomSurface) {
if (_zoomSurface != nullptr) {
_zoomSurface->free();
delete _zoomSurface;
_zoomSurface = nullptr;
Expand Down
16 changes: 16 additions & 0 deletions engines/prince/prince.cpp
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 1f88852

Please sign in to comment.