aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwhiterandrek2018-06-02 22:02:21 +0300
committerEugene Sandulenko2018-06-28 23:51:32 +0200
commita531381f2b80aa8f0bf8c10610eaad6a3256415f (patch)
tree6e394a8f131e73b72ef6cc52bcb8a06edfa40794
parent127e2fdf55117777198926cc1a809ea9f71ea1c2 (diff)
downloadscummvm-rg350-a531381f2b80aa8f0bf8c10610eaad6a3256415f.tar.gz
scummvm-rg350-a531381f2b80aa8f0bf8c10610eaad6a3256415f.tar.bz2
scummvm-rg350-a531381f2b80aa8f0bf8c10610eaad6a3256415f.zip
PINK: change pause/unpause to pause method with parameter
-rw-r--r--engines/pink/objects/actions/action.h3
-rw-r--r--engines/pink/objects/actions/action_cel.cpp8
-rw-r--r--engines/pink/objects/actions/action_cel.h4
-rw-r--r--engines/pink/objects/actions/action_sound.cpp9
-rw-r--r--engines/pink/objects/actions/action_sound.h3
-rw-r--r--engines/pink/objects/actions/action_still.h1
-rw-r--r--engines/pink/objects/actions/action_talk.cpp12
-rw-r--r--engines/pink/objects/actions/action_talk.h3
-rw-r--r--engines/pink/objects/actors/inventory_actor.h2
-rw-r--r--engines/pink/objects/pages/page.cpp10
-rw-r--r--engines/pink/objects/pages/page.h3
-rw-r--r--engines/pink/sound.cpp14
-rw-r--r--engines/pink/sound.h4
13 files changed, 20 insertions, 56 deletions
diff --git a/engines/pink/objects/actions/action.h b/engines/pink/objects/actions/action.h
index 7dd0d2a9be..9c4e9023e1 100644
--- a/engines/pink/objects/actions/action.h
+++ b/engines/pink/objects/actions/action.h
@@ -42,8 +42,7 @@ public:
Actor *getActor() { return _actor; }
- virtual void pause() {};
- virtual void unpause() {};
+ virtual void pause(bool paused) {};
protected:
Actor *_actor;
diff --git a/engines/pink/objects/actions/action_cel.cpp b/engines/pink/objects/actions/action_cel.cpp
index 8e868a199b..0881542155 100644
--- a/engines/pink/objects/actions/action_cel.cpp
+++ b/engines/pink/objects/actions/action_cel.cpp
@@ -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
diff --git a/engines/pink/objects/actions/action_cel.h b/engines/pink/objects/actions/action_cel.h
index bf1ae2961d..60b85e0c64 100644
--- a/engines/pink/objects/actions/action_cel.h
+++ b/engines/pink/objects/actions/action_cel.h
@@ -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() {};
diff --git a/engines/pink/objects/actions/action_sound.cpp b/engines/pink/objects/actions/action_sound.cpp
index ffbd29389e..a80130bffc 100644
--- a/engines/pink/objects/actions/action_sound.cpp
+++ b/engines/pink/objects/actions/action_sound.cpp
@@ -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
diff --git a/engines/pink/objects/actions/action_sound.h b/engines/pink/objects/actions/action_sound.h
index 6e18f97c67..f5d1401917 100644
--- a/engines/pink/objects/actions/action_sound.h
+++ b/engines/pink/objects/actions/action_sound.h
@@ -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;
diff --git a/engines/pink/objects/actions/action_still.h b/engines/pink/objects/actions/action_still.h
index a62b201ce8..90c5c7d01d 100644
--- a/engines/pink/objects/actions/action_still.h
+++ b/engines/pink/objects/actions/action_still.h
@@ -33,6 +33,7 @@ public:
virtual void toConsole();
virtual void end();
+ virtual void pause(bool paused) {}
protected:
virtual void onStart();
diff --git a/engines/pink/objects/actions/action_talk.cpp b/engines/pink/objects/actions/action_talk.cpp
index 555e6fe95d..7ecd40d975 100644
--- a/engines/pink/objects/actions/action_talk.cpp
+++ b/engines/pink/objects/actions/action_talk.cpp
@@ -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
diff --git a/engines/pink/objects/actions/action_talk.h b/engines/pink/objects/actions/action_talk.h
index 61ef1a452f..e14e6bcc87 100644
--- a/engines/pink/objects/actions/action_talk.h
+++ b/engines/pink/objects/actions/action_talk.h
@@ -37,8 +37,7 @@ public:
virtual void end();
- void pause() override;
- void unpause() override;
+ void pause(bool paused) override;
protected:
virtual void onStart();
diff --git a/engines/pink/objects/actors/inventory_actor.h b/engines/pink/objects/actors/inventory_actor.h
index 4e6edef5a1..9fad7f6b06 100644
--- a/engines/pink/objects/actors/inventory_actor.h
+++ b/engines/pink/objects/actors/inventory_actor.h
@@ -39,7 +39,7 @@ public:
}
}
- void pause() {}
+ void pause(bool paused) override {}
};
} // End of namespace Pink
diff --git a/engines/pink/objects/pages/page.cpp b/engines/pink/objects/pages/page.cpp
index 5f5b99a6f5..844bd9462b 100644
--- a/engines/pink/objects/pages/page.cpp
+++ b/engines/pink/objects/pages/page.cpp
@@ -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);
}
}
diff --git a/engines/pink/objects/pages/page.h b/engines/pink/objects/pages/page.h
index 08be3a2ccc..2927f071ea 100644
--- a/engines/pink/objects/pages/page.h
+++ b/engines/pink/objects/pages/page.h
@@ -47,8 +47,7 @@ public:
CelDecoder *loadCel(Common::String &fileName);
virtual void clear();
- void pause();
- void unpause();
+ void pause(bool paused);
PinkEngine *getGame();
diff --git a/engines/pink/sound.cpp b/engines/pink/sound.cpp
index 10fb049727..333093e063 100644
--- a/engines/pink/sound.cpp
+++ b/engines/pink/sound.cpp
@@ -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) {
diff --git a/engines/pink/sound.h b/engines/pink/sound.h
index 9d7007419f..a5e7cca6ed 100644
--- a/engines/pink/sound.h
+++ b/engines/pink/sound.h
@@ -45,9 +45,7 @@ public:
bool isPlaying();
- void pause();
- void resume();
- void stop();
+ void pause(bool paused);
uint32 getCurrentSample();
void setBalance(int8 balance);