aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorSven Hesse2011-09-03 19:51:03 +0200
committerSven Hesse2011-09-14 18:54:27 +0200
commit918fe978e2d4f1e149cf8040e087b7b70e54c9d4 (patch)
tree2dc1dae50385a1df696daa7fe7d6e82038456639 /engines
parent96961b2c2d8fff0fe4d4b093000e02dc6147aecf (diff)
downloadscummvm-rg350-918fe978e2d4f1e149cf8040e087b7b70e54c9d4.tar.gz
scummvm-rg350-918fe978e2d4f1e149cf8040e087b7b70e54c9d4.tar.bz2
scummvm-rg350-918fe978e2d4f1e149cf8040e087b7b70e54c9d4.zip
GOB: Add ANIObject::setPause()
Diffstat (limited to 'engines')
-rw-r--r--engines/gob/aniobject.cpp15
-rw-r--r--engines/gob/aniobject.h7
-rw-r--r--engines/gob/minigames/geisha/diving.cpp4
3 files changed, 24 insertions, 2 deletions
diff --git a/engines/gob/aniobject.cpp b/engines/gob/aniobject.cpp
index c6a9234eb9..9974874bbf 100644
--- a/engines/gob/aniobject.cpp
+++ b/engines/gob/aniobject.cpp
@@ -26,8 +26,8 @@
namespace Gob {
-ANIObject::ANIObject(const ANIFile &ani) : _ani(&ani), _visible(false),
- _x(0), _y(0), _background(0), _drawn(false) {
+ANIObject::ANIObject(const ANIFile &ani) : _ani(&ani),
+ _visible(false), _paused(false), _x(0), _y(0), _background(0), _drawn(false) {
setAnimation(0);
setPosition();
@@ -45,6 +45,14 @@ bool ANIObject::isVisible() const {
return _visible;
}
+void ANIObject::setPause(bool pause) {
+ _paused = pause;
+}
+
+bool ANIObject::isPaused() const {
+ return _paused;
+}
+
void ANIObject::setAnimation(uint16 animation) {
_animation = animation;
_frame = 0;
@@ -152,6 +160,9 @@ void ANIObject::clear(Surface &dest, int16 &left, int16 &top,
}
void ANIObject::advance() {
+ if (_paused)
+ return;
+
if (_animation >= _ani->getAnimationCount())
return;
diff --git a/engines/gob/aniobject.h b/engines/gob/aniobject.h
index 357c2a9bcc..c5352dd2b5 100644
--- a/engines/gob/aniobject.h
+++ b/engines/gob/aniobject.h
@@ -42,6 +42,12 @@ public:
/** Is the object currently visible? */
bool isVisible() const;
+ /** Pause/Unpause the animation. */
+ void setPause(bool pause);
+
+ /** Is the animation currently paused? */
+ bool isPaused() const;
+
/** Set the current position to the animation's default. */
void setPosition();
/** Set the current position. */
@@ -81,6 +87,7 @@ private:
uint16 _frame; ///< The current frame.
bool _visible; ///< Is the object currently visible?
+ bool _paused; ///< Is the animation currently paused?
int16 _x; ///< The current X position.
int16 _y; ///< The current Y position.
diff --git a/engines/gob/minigames/geisha/diving.cpp b/engines/gob/minigames/geisha/diving.cpp
index 0d216abf43..6130ebad78 100644
--- a/engines/gob/minigames/geisha/diving.cpp
+++ b/engines/gob/minigames/geisha/diving.cpp
@@ -58,6 +58,8 @@ bool Diving::play(uint16 playerCount, bool hasPearlLocation) {
objects.push_back(_water);
objects.push_back(&shark);
+ objects.push_back(_lungs);
+ objects.push_back(_heart);
shark.enter(EvilFish::kDirectionLeft, 90);
@@ -109,10 +111,12 @@ void Diving::init() {
_lungs->setAnimation(0);
_lungs->setPosition();
_lungs->setVisible(true);
+ _lungs->setPause(true);
_heart->setAnimation(1);
_heart->setPosition();
_heart->setVisible(true);
+ _heart->setPause(true);
}
void Diving::deinit() {