PINK: change pause/unpause to pause method with parameter

This commit is contained in:
whiterandrek 2018-06-02 22:02:21 +03:00 committed by Eugene Sandulenko
parent 127e2fdf55
commit a531381f2b
13 changed files with 20 additions and 56 deletions

View File

@ -42,8 +42,7 @@ public:
Actor *getActor() { return _actor; }
virtual void pause() {};
virtual void unpause() {};
virtual void pause(bool paused) {};
protected:
Actor *_actor;

View File

@ -82,12 +82,8 @@ ActionCEL::~ActionCEL() {
end();
}
void ActionCEL::pause() {
_decoder->pauseVideo(1);
}
void ActionCEL::unpause() {
_decoder->pauseVideo(0);
void ActionCEL::pause(bool paused) {
_decoder->pauseVideo(paused);
}
} // End of namespace Pink

View File

@ -44,9 +44,7 @@ public:
virtual bool initPalette(Director *director);
void pause() override;
void unpause() override;
void pause(bool paused) override;
protected:
virtual void onStart() {};

View File

@ -85,14 +85,9 @@ void ActionSound::update() {
_actor->endAction();
}
void ActionSound::pause() {
void ActionSound::pause(bool paused) {
if (_sound)
_sound->pause();
}
void ActionSound::unpause() {
if (_sound)
_sound->resume();
_sound->pause(paused);
}
} // End of namespace Pink

View File

@ -42,8 +42,7 @@ public:
virtual void end();
virtual void update();
void pause() override;
void unpause() override;
void pause(bool paused) override;
private:
Sound *_sound;

View File

@ -33,6 +33,7 @@ public:
virtual void toConsole();
virtual void end();
virtual void pause(bool paused) {}
protected:
virtual void onStart();

View File

@ -60,16 +60,10 @@ void ActionTalk::end() {
_sound = nullptr;
}
void ActionTalk::pause() {
ActionCEL::pause();
void ActionTalk::pause(bool paused) {
ActionCEL::pause(paused);
if (_sound)
_sound->pause();
}
void ActionTalk::unpause() {
ActionCEL::unpause();
if (_sound)
_sound->resume();
_sound->pause(paused);
}
} // End of namespace Pink

View File

@ -37,8 +37,7 @@ public:
virtual void end();
void pause() override;
void unpause() override;
void pause(bool paused) override;
protected:
virtual void onStart();

View File

@ -39,7 +39,7 @@ public:
}
}
void pause() {}
void pause(bool paused) override {}
};
} // End of namespace Pink

View File

@ -83,15 +83,9 @@ void Page::clear() {
_resMgr.clear();
}
void Page::pause() {
void Page::pause(bool paused) {
for (uint i = 0; i < _actors.size(); ++i) {
_actors[i]->pause();
}
}
void Page::unpause() {
for (uint i = 0; i < _actors.size(); ++i) {
_actors[i]->unpause();
_actors[i]->pause(paused);
}
}

View File

@ -47,8 +47,7 @@ public:
CelDecoder *loadCel(Common::String &fileName);
virtual void clear();
void pause();
void unpause();
void pause(bool paused);
PinkEngine *getGame();

View File

@ -34,7 +34,7 @@ Sound::Sound(Audio::Mixer *mixer, Common::SafeSeekableSubReadStream *stream)
: _mixer(mixer), _fileStream(stream) {}
Sound::~Sound() {
stop();
_mixer->stopHandle(_handle);
delete _fileStream;
}
@ -42,16 +42,8 @@ bool Sound::isPlaying() {
return _mixer->isSoundHandleActive(_handle);
}
void Sound::pause() {
_mixer->pauseHandle(_handle, true);
}
void Sound::resume() {
_mixer->pauseHandle(_handle, false);
}
void Sound::stop() {
_mixer->stopHandle(_handle);
void Sound::pause(bool paused) {
_mixer->pauseHandle(_handle, paused);
}
void Sound::play(Audio::Mixer::SoundType type, int volume, bool isLoop) {

View File

@ -45,9 +45,7 @@ public:
bool isPlaying();
void pause();
void resume();
void stop();
void pause(bool paused);
uint32 getCurrentSample();
void setBalance(int8 balance);