Skip to content

Commit

Permalink
PEGASUS: Actually pause the game now
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Hoops committed Sep 30, 2011
1 parent 9be43b2 commit 485b427
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
9 changes: 8 additions & 1 deletion engines/pegasus/movie.cpp
Expand Up @@ -163,12 +163,19 @@ void Movie::stop() {
}

void Movie::resume() {
if (_video && _video->isPaused())
if (_video)
_video->pauseVideo(false);

TimeBase::resume();
}

void Movie::pause() {
if (_video)
_video->pauseVideo(true);

TimeBase::pause();
}

void Movie::checkCallBacks() {
TimeBase::checkCallBacks();

Expand Down
1 change: 1 addition & 0 deletions engines/pegasus/movie.h
Expand Up @@ -60,6 +60,7 @@ class Movie : public Animation, public PixelImage {
virtual void start();
virtual void stop();
virtual void resume();
virtual void pause();

virtual void moveMovieBoxTo(const tCoordType, const tCoordType);

Expand Down
16 changes: 14 additions & 2 deletions engines/pegasus/pegasus.cpp
Expand Up @@ -1759,13 +1759,13 @@ void PegasusEngine::setAmbienceLevel(uint16 ambientLevel) {

void PegasusEngine::pauseMenu(bool menuUp) {
if (menuUp) {
// TODO: Pause engine
pauseEngine(true);
_screenDimmer.startDisplaying();
_screenDimmer.show();
_gfx->updateDisplay();
useMenu(new PauseMenu());
} else {
// TODO: Resume engine
pauseEngine(false);
_screenDimmer.hide();
_screenDimmer.stopDisplaying();
useMenu(0);
Expand Down Expand Up @@ -1855,4 +1855,16 @@ tNeighborhoodID PegasusEngine::getCurrentNeighborhoodID() const {
return kNoNeighborhoodID;
}

void PegasusEngine::pauseEngineIntern(bool pause) {
Engine::pauseEngineIntern(pause);

if (pause) {
for (Common::List<TimeBase *>::iterator it = _timeBases.begin(); it != _timeBases.end(); it++)
(*it)->pause();
} else {
for (Common::List<TimeBase *>::iterator it = _timeBases.begin(); it != _timeBases.end(); it++)
(*it)->resume();
}
}

} // End of namespace Pegasus
2 changes: 1 addition & 1 deletion engines/pegasus/pegasus.h
Expand Up @@ -180,6 +180,7 @@ friend class InputHandler;

protected:
Common::Error run();
void pauseEngineIntern(bool pause);

Notification _shellNotification;
virtual void receiveNotification(Notification *notification, const tNotificationFlags flags);
Expand Down Expand Up @@ -233,7 +234,6 @@ friend class InputHandler;
bool playMovieScaled(Video::SeekableVideoDecoder *video, uint16 x, uint16 y);
void throwAwayEverything();
void shellGameInput(const Input &input, const Hotspot *cursorSpot);
bool isPaused() { return false; } // TODO

// Menu
GameMenu *_gameMenu;
Expand Down

0 comments on commit 485b427

Please sign in to comment.